The stupid question is the question not asked PerlMonks

### Re: Pointers and References

by kcott (Bishop)
 on Nov 23, 2020 at 04:40 UTC Need Help??

```\$ perl -E '
my \$x = 5;
...
SCALAR(0x60008a1c8)
5
8
```
```\$ perl -E 'my \$x = 5; say \$x; my \$y = \\\\\$x; \$\$\$\$\$y += 3; say \$x'
5
8
```
```\$ perl -E 'say for \(qw{1 2 3})'
SCALAR(0x60008a730)
SCALAR(0x60008a7d8)
SCALAR(0x60008a748)
```
```\$ perl -E 'my @x = qw{1 2 3}; say for @x; my \$y = \@x; say \$y'
1
2
3
ARRAY(0x60008a8e8)
```
```\$ perl -E 'my @x = qw{1 2 3}; say for @x; my \$y = \@x; say \$y; say for
+ @\$y'
1
...
1
2
3
```
```\$ perl -E 'my @x = qw{1 2 3}; say for @x; my \$y = \\@x; say \$y'
1
2
3
REF(0x600003e80)
```
```\$ perl -E 'my @x = qw{1 2 3}; say for @x; my \$y = \\@x; say \$y; say \$\$
+y; say for @\$\$y'
1
...
1
2
3
```
```\$ alias perle
alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
+'
```
```\$ perl -E '\$x =5'

...

\$ perle 'my \$x = 5; say @\$x'
Can't use string ("5") as an ARRAY ref while "strict refs" in use ...
```

Create A New User
Node Status?
node history
Node Type: note [id://11124049]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2021-06-15 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
What does the "s" stand for in "perls"? (Whence perls)

Results (69 votes). Check out past polls.

Notices?