in reply to Re^2: does perl have a concept of "int main()"? (variable scoping question)
in thread does perl have a concept of "int main()"? (variable scoping question)
then all your variables are truly "local" (I really mean lexically scoped). But I think that Perl offers better alternatives; trying to write C code in Perl is probably not a very good idea. I was only saying that it can be done if you really want to.use strict; use warnings; main(); sub main { my $var1 = "foo"; my $var2 = "bar"; my $return_val = process_data ($var1, $var2); # ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: does perl have a concept of "int main()"? (variable scoping question , cat as program editor)
by Anonymous Monk on Dec 06, 2013 at 05:12 UTC |