perl file test operators and "$_" -
i'm going through o'reilly's "intermediate perl". -s used so:
print map { " $_\n" } grep { -s < 1000 } @argv; which gives warning:
warning: use of "-s" without parentheses ambiguous unterminated <> operator
though, when put parentheses around -s works charm. not sure if perl version related or mistype authors.
perl version: v5.18.2 built darwin-thread-multi-2level
what causing issue , can correct it?
< can start of term readline/glob shortcut.
print "[$_]\n" < b c >; < can start of infix operator numeric less-than operator.
print "foo\n" if $x < 3; -s can legally followed both, perl has guess 1 wanted when sees <. using of following instead of -s solves issue since none of them can followed term:
-s($_)-s()(-s)
Comments
Post a Comment