in reply to Re: regex needed
in thread regex needed

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] );

print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'