Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Non-traditional, Line by Line Compilation in Perl

by Anonymous Monk
on Dec 07, 2011 at 11:39 UTC ( [id://942225]=note: print w/replies, xml ) Need Help??


in reply to Non-traditional, Line by Line Compilation in Perl

Replies are listed 'Best First'.
Re^2: Non-traditional, Line by Line Compilation in Perl
by Anonymous Monk on Dec 07, 2011 at 11:42 UTC
    Example, all oneliners :D
    $ perl -c -e " use strict; use warnings; BEGIN { $sumeet = 1; } $grove +r = 1; } " Global symbol "$sumeet" requires explicit package name at -e line 1. BEGIN not safe after errors--compilation aborted at -e line 1. $ perl -c -e " use strict; use warnings; BEGIN { our $sumeet = 1; } $g +rover = 1; } " Global symbol "$grover" requires explicit package name at -e line 1. Unmatched right curly bracket at -e line 1, at end of line syntax error at -e line 1, near "; }" -e had compilation errors. $ perl -c -e " use strict; use warnings; BEGIN { our $sumeet = 1; } $g +rover = 1; " Global symbol "$grover" requires explicit package name at -e line 1. -e had compilation errors. $ perl -c -e " use strict; use warnings; BEGIN { our $sumeet = 1; } ou +r $grover = 1; " -e syntax OK
Re^2: Non-traditional, Line by Line Compilation in Perl
by sumeetgrover (Monk) on Dec 07, 2011 at 11:55 UTC
    Agreed, compilation would be based on statements, separated by semicolon!

      Agreed, compilation would be based on statements, separated by semicolon!

      We don't need no stinkin semicolons !:)

      $ perl -c -e " use strict; use warnings; { $foo = 1 } { $bar }} " Global symbol "$foo" requires explicit package name at -e line 1. Global symbol "$bar" requires explicit package name at -e line 1. Unmatched right curly bracket at -e line 1, at end of line syntax error at -e line 1, near "}}" -e had compilation errors.
      $ perl -e " use strict; use warnings; { our $foo = 1 } { our $bar } p +rint 666" 666

        Well, I certainly do prefer using semicolons, having first learned C programming. I also regard using semi colons at the end of programming statements to be a good programming / software-development practice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://942225]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-19 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found