Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Pointers and References

by kcott (Archbishop)
on Nov 23, 2020 at 04:40 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124049]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2024-04-19 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found