in reply to Perl Syntax check
You can enable strict and warnings on the command line. That ought to fix it fix it.
yields:perl -cw -Mstrict -e "Welcome Back"
-e syntax OKOops. It works with a single word:
perl -cw -Mstrict -e Welcome
Bareword "Welcome" not allowed while "strict subs" in use at -e line 1. -e had compilation errors.But with two words, it's problematic:
produces:perl -MO=Deparse -e "Welcome Back"
'Back'->Welcome; -e syntax OKSyntaxwise, it's OK, even under strict.
This is the so-called indirect object syntax, which often is problematic as it doesn't always work as intended. I wish strict had a way to disallow it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Syntax check
by alandev (Scribe) on Jul 12, 2006 at 11:13 UTC |