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

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



I'm not sure I understand. Is that code supposed to run without errors? Call
me (or my perl 5.005_03) crazy, but when I try to run that I get:

Unmatched right bracket at ./mytest line 2, at end of line
syntax error at ./mytest line 2, near "}"
Execution of ./mytest aborted due to compilation errors.

-b


-----Original Message-----
From: Vicki Brown <vlb@cfcl.com>
To: <fwp@technofile.org>
Date: Wednesday, August 25, 1999 09:49 AM
Subject: [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
>


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