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

Re^2: Odd workings of split

by Ralesk (Pilgrim)
on Mar 30, 2012 at 23:17 UTC ( [id://962698]=note: print w/replies, xml ) Need Help??


in reply to Re: Odd workings of split
in thread Odd workings of split

Nice summary, thanks :)

Re your 2nd code snippet, I swear I’ve run into Perl (5.10) complaining about )[ before, but I have no idea anymore what I did to make it not like it. Your code does work though… Much to my surprise really.

Replies are listed 'Best First'.
Re^3: Odd workings of split
by Jenda (Abbot) on Mar 31, 2012 at 07:16 UTC

    The important thing is that the () is abound the whole subroutine call, not just around the parameters. split("\n", $cmd[$_])[0] would not work.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-18 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found