I think you wanted:
You need to use the unary + to disambiguate the parentheses which otherwise perl will parse as introducing the argument list for print which gives rise to the syntax error with the [0]print +('abcd' =~ /(\w)\w(\w)/ )[0];
/J\
In reply to Re: Slice misuse ?
by gellyfish
in thread Slice misuse ?
by blogical
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |