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
|
|---|