Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: (MeowChow) Re2: Arrow Operator Oddment

by bjelli (Pilgrim)
on Jun 03, 2002 at 11:17 UTC ( #171196=note: print w/ replies, xml ) Need Help??


in reply to Re: (MeowChow) Re2: Arrow Operator Oddment
in thread Arrow Operator Oddment

The problem is: MeowChow created a normal Array and a normal Hash:

@l = 0..10; %h = (a => 1, b => 2);

But then read from them as if they were a reference to an array and a reference to a hash:

print @l->[4]; # prints 4 print %h->{b}; # prints 2

This would be the normal way to access the array and the hash:

print $l[4]; # prints 4 print $h{b}; # prints 2
--
Brigitte    'I never met a chocolate I didnt like'    Jellinek
http://www.horus.com/~bjelli/         http://perlwelt.horus.at


Comment on Re: Re: (MeowChow) Re2: Arrow Operator Oddment
Select or Download Code
Re: Re: Re: (MeowChow) Re2: Arrow Operator Oddment
by Cody Pendant (Prior) on Jun 06, 2002 at 04:40 UTC
    Thank you for clearing that up.
    --
    ($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://171196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-07-04 21:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls