Another is near the top of the file to say:
main() if !caller;
sub main {
# ...
exit 0;
}
On Fri, Mar 6, 2009 at 9:35 AM, Yitzchak Scott-Thoennes
<[email protected]> wrote:
> On Thu, March 5, 2009 1:12 pm, Shlomi Fish wrote:
>> my $filename = "hello.txt";
>>
>> sub print_filename {
>> print $filename, "\n";
>> }
>
> One thing you can do is to do the initialization at compile time:
>
> my $filename;
> BEGIN { $filename = "hello.txt" }
>
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://perl.org.il/mailman/listinfo/perl
>
--
Gaal Yahas <[email protected]>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl