in reply to Slice misuse ?
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\
|
|---|