Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Pointers and References

by kcott (Bishop)
on Nov 23, 2020 at 04:40 UTC ( #11124049=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -E '
        my $x = 5;
    ...
    SCALAR(0x60008a1c8)
    5
    8
    
  2. or download this
    $ perl -E 'my $x = 5; say $x; my $y = \\\\$x; $$$$$y += 3; say $x'
    5
    8
    
  3. or download this
    $ perl -E 'say for \(qw{1 2 3})'
    SCALAR(0x60008a730)
    SCALAR(0x60008a7d8)
    SCALAR(0x60008a748)
    
  4. or download this
    $ perl -E 'my @x = qw{1 2 3}; say for @x; my $y = \@x; say $y'
    1
    2
    3
    ARRAY(0x60008a8e8)
    
  5. or download this
    $ perl -E 'my @x = qw{1 2 3}; say for @x; my $y = \@x; say $y; say for
    + @$y'
    1
    ...
    1
    2
    3
    
  6. or download this
    $ perl -E 'my @x = qw{1 2 3}; say for @x; my $y = \\@x; say $y'
    1
    2
    3
    REF(0x600003e80)
    
  7. or download this
    $ 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
    
  8. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
    +'
    
  9. or download this
    $ perl -E '$x =5'
    
    ...
    
    $ perle 'my $x = 5; say @$x'
    Can't use string ("5") as an ARRAY ref while "strict refs" in use ...
    

Log In?
Username:
Password:

What's my password?
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?