in reply to Re^3: does perl have a concept of "int main()"? (variable scoping question)
in thread does perl have a concept of "int main()"? (variable scoping question)

But if you really want to mimic the C/C++ behavior (I am not really convinced by the idea, but let's assume you want to do it for the sake of argument), .... trying to write C code in Perl is probably not a very good idea

Perl lets you get away with a lot , but most noobs won't understand it, so if you're going to emulate something until you learn what's what, its good to emulate

Main( @ARGV ); exit( 0 );

After you learn what's what, you'll know why you're emulating good practices and continue doing it :) even if it resembles or mimics C

Just because perl allows and we can read and follow spaghetti code of the type  my $...; sub foo {} my $...; foo(); ... sub bar {} ... bar(); doesn't make it a good idea ; its down right irritating for no other reason than to be irritating; so you used cat as your editor, congratulations, now use pico to fix it :)

chromatics free book Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too. discusses this in Chapter 10 under "Handling Main"

Its also discussed in tyes template at (tye)Re: Stupid question (and see one discussion of that template at Re^2: RFC: Creating unicursal stars

  • Comment on Re^4: does perl have a concept of "int main()"? (variable scoping question , cat as program editor)
  • Select or Download Code