[Pdx-pm] Not a syntax error?

Steve Bonds 9nn24e402 at sneakemail.com
Mon May 2 15:57:08 PDT 2005


Perl folks:

While debugging a problem with a script I noticed some strange
behavior from Perl.  I've grown used to Perl's ability to find syntax
errors to protect me from myself, but it seems to have failed in this
case.  Take the following test case:

-----
#!/usr/local/bin/perl -w
print "This is a line without a semicolon\n".
exit 1;
-----

It almost seems like the print line uses string concatenation to
absorb the exit line-- but it doesn't.  The exit line is executed
properly and the above perl terminates with status 1, however the
output from the print statement is never seen.

This didn't generate a warning using perl 5.8.0.  Should it have?

  -- Steve


More information about the Pdx-pm-list mailing list