Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

by adrianh (Chancellor)
on Aug 24, 2003 at 11:31 UTC ( #286181=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
in thread Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

Read Arrays are not lists and Scalars, Lists, and Arrays and repeat to yourself three times - "('foo', 'bar', 'baz') is not an array" ;-)

I'm with Abigail-II. The \ operator has lots of weird cases that surprise you. For example:

\@foo # reference to array @foo \(@foo, $a) # list of reference to array @foo and scalar $a \(@foo) # list of references to contents of @foo


Comment on Re^3: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
Download Code
Replies are listed 'Best First'.
Re: Re: Re: Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
by bradb (Sexton) on Aug 25, 2003 at 00:42 UTC
    Read Arrays are not lists and Scalars, Lists, and Arrays and repeat to yourself three times - "('foo', 'bar', 'baz') is not an array" ;-)

    I can't be blamed if you don't read my post. ;-) I didn't say ('foo', 'bar', 'baz') was an array, I said If I ask for a reference to an array that contains ('foo', 'bar', 'baz').

    HTH.

      My bad ;-)

      However, I think the point about the non-obvious behaviour of the \ operator still stands.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-07-08 03:18 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 (93 votes), past polls