Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: perlish way of splitting file records

by VSarkiss (Monsignor)
on Jun 01, 2006 at 16:39 UTC ( #553088=note: print w/replies, xml ) Need Help??


in reply to Re: perlish way of splitting file records
in thread perlish way of splitting file records

The parenthesis following print is assumed to contain its arguments. You can either enclose everything in parens as you've done, or disambiguate in some other way, such as with unary plus. Consider:

$ perl -MO=Deparse -e 'print ((split /:/,<FILEHANDLE>)[3])' print((split(/:/, <FILEHANDLE>, 0))[3]); -e syntax OK $ perl -MO=Deparse -e 'print +(split /:/,<FILEHANDLE>)[3]' print((split(/:/, <FILEHANDLE>, 0))[3]); -e syntax OK

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553088]
help
Chatterbox?
and the fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2017-11-23 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (328 votes). Check out past polls.

    Notices?