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

Re: [FWP] So, you think you know Perl?



Michael G Schwern <schwern@pobox.com> wrote:

>               LINE:
>                 while (<>) {
>                     print q
>                 } continue {
>                     print or die "-p destination: $!\n";
>                 }
> 
> And q}{ is a syntax error... OH!  but q}} isn't!

Yes, but if it were q}} there would be a syntax error because 
of the missing } to close the block.  That's why my prediction 
was that it would print

    Missing right bracket at -e line 1, at end of line
    syntax error at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.

I briefly thought that somehow newlines were being treated 
as delimiters, but it looks like there's a semicolon being 
added after the q, so it's q;;.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC

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