[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] From the Perl Conference 3.0 Perl quiz (1)



If you're gonna reply with a spoiler, mark it a spoiler.

If you were there, don't jump in so fast :-)

Here's the code... this is it... just these two lines.
Why doesn't this generate a syntax error?

    } BEGIN {
      @ARGV = <*m*>;

Or, as Jon Orwant said - there were no modules in use, no other lines in
the script. A print statement inserted anywhere, before or after or between
these two lines would print.

What _is_ the single unshown thing that makes this work without a syntax
error? (and how?)

This amused me... (I amuse easily).
If you do put in those print statements,

   print "hello, ";
   } BEGIN {
     @ARGV = <*m*>;
   print "world\n";

what do you get? and why?
-- --
       |\      _,,,---,,_       Vicki Brown <vlb@cfcl.com>
 ZZZzz /,`.-'`'    -.  ;-;;,_   Journeyman Sourceror: Scripts & Philtres
      |,4-  ) )-,_. ,\ (  `'-'  P.O. Box 1269  San Bruno  CA  94066
     '---''(_/--'  `-'\_) http://www.cfcl.com/~vlb  http://www.macperl.com

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe