Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Mini-Tutorial: Dereferencing Syntax

by ikegami (Pope)
on Sep 17, 2012 at 05:03 UTC ( #993959=note: print w/replies, xml ) Need Help??


in reply to Re: Mini-Tutorial: Dereferencing Syntax
in thread Mini-Tutorial: Dereferencing Syntax

$$foo is not a shorthand for $foo->.

>perl -E"$foo=\'foo'; say $$foo;" foo >perl -E"$foo=\'foo'; say $foo->;" syntax error at -e line 1, near "->;" Execution of -e aborted due to compilation errors.

You're probably thinking of the equivalency of $$foo[...] and $foo->[...] and of $$foo{...} and $foo->{...}, but that's already mentioned.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993959]
help
Chatterbox?
[GotToBTru]: "I did it my $way"
[JohnCub]: I hope $way isn't a hashref. ;)
[GotToBTru]: many times i've been told I made a real hash of thiings
[GotToBTru]: so .. perhaps it should b e
[thepkd]: Just wondering why $aohoaoh[0]->{'foo '}[0]->{'bar'} would be difficult to read and understand?
[thepkd]: I am a noob and find it easier

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2016-12-06 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (105 votes). Check out past polls.