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

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



Read my "reposting" of this... it explains the puzzle a little better.

D

At 02:36 PM 8/25/99 -0400, Chaim Frenkel wrote:
>Sorry, I can't reproduce it here.
>
>         } BEGIN {
>         @ARGV = <*m*>;
>
>Unmatched right bracket at /tmp/q.pl line 1, at end of line
>syntax error at /tmp/q.pl line 1, near "}"
>Execution of /tmp/q.pl aborted due to compilation errors.
>
>You must have left out something. Like a command line switch?
>
><chaim>
>
> >>>>> "VB" == Vicki Brown <vlb@cfcl.com> writes:
>
>VB> If you're gonna reply with a spoiler, mark it a spoiler.
>VB> If you were there, don't jump in so fast :-)
>
>VB> Here's the code... this is it... just these two lines.
>VB> Why doesn't this generate a syntax error?
>
>VB>     } BEGIN {
>VB>       @ARGV = <*m*>;
>
>VB> Or, as Jon Orwant said - there were no modules in use, no other lines in
>VB> the script. A print statement inserted anywhere, before or after or 
>between
>VB> these two lines would print.
>
>VB> What _is_ the single unshown thing that makes this work without a syntax
>VB> error? (and how?)
>
>VB> This amused me... (I amuse easily).
>VB> If you do put in those print statements,
>
>VB>    print "hello, ";
>VB>    } BEGIN {
>VB>      @ARGV = <*m*>;
>VB>    print "world\n";
>
>VB> what do you get? and why?
>
>
>--
>Chaim Frenkel                                        Nonlinear Knowledge, Inc.
>chaimf@pobox.com                                               +1-718-236-0183
>
>==== 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