[Israel.pm] A Perl 5 Gotcha

Gaal Yahas gaal at forum2.org
Thu Mar 5 23:41:40 PST 2009


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
<sthoenna at efn.org> 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
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list