Operator precedence and print's hunger for a filehandle get in the way. perl parses that as
(print (split /:/))[1];
And therefore thinks that (split /:/) should be a filehandle (not sure about that) and then you're taking a slice of the whole mess (which definitely won't fly). Extra parentheses are all you need.
print( (split /:/)[1] );
In reply to Re:x2 regex needed
by grinder
in thread regex needed
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |