Eindeutig nach alter Pascal-Konvention gehören Subs vor den Hauptteil.
NEIN!
#!C:/Programme/Perl/bin/perl.exe -w
#
use strict;
BEGIN {
use CGI::Carp qw(carpout);
open(LOG, ">>error.txt") or die "Unable to append to error.txt: $!\n";
carpout(*LOG);
}
&my_func; # Old Style
my_func(); # Good Style
sub my_func{
print "hallo\n";
}
my_func; # CIA/Mossad Style
sleep(10);
exit;
__END__
PS: Wer parameterlose Subs mit runden Klammern aufruft, ist ein Javaweichspüler.
Behalte deine Polemik für dich. Wer will schon deinen Chaoscode.
mfg Beat;
--
/|
<°)))o>< __ / | /|
/__\ _|___/ | ><o(((°>
OvVVvO __ | ><o(((°>
<°)))o>< /v v\/ |
<°)))o>< ^ ^/_/_ ><o(((°>
^^^^/___/
---- ><o(((°>
><o(((°> ><o(((°>
<°)))o>< ><o(((°>o
/|
<°)))o>< __ / | /|
/__\ _|___/ | ><o(((°>
OvVVvO __ | ><o(((°>
<°)))o>< /v v\/ |
<°)))o>< ^ ^/_/_ ><o(((°>
^^^^/___/
---- ><o(((°>
><o(((°> ><o(((°>
<°)))o>< ><o(((°>o