Jun 4, 2010, 8:58 AM
Post #2 of 5
There's no reason to use both the -W switch and the warnings pragma. The pragma is the preferred choice.
Re: [Bianca] Problem with Apache error.log entry
[In reply to]
Don't put multiple statements on a single line.
use IO::Handle; STDOUT -> autoflush (1);
Why are you using that module to only set autoflush, when it would be simpler to just set $| to a true value? i.e.,
That's a poor approach.
print CGI -> new -> header . <<HTML_TEIL;
<p>Bin da um $zeit mit PID $$</p>
Better written as:
my $cgi = CGI->new;
$cgi->p("Bin da um $zeit mit PID $$"),
It's better to use the 3 arg form of open and you should ALWAYS check the return code of an open call to verify that it was successful and take action if it wasn't.
open (my $fh,">test.parent.$$" . ".txt");
my $testfile = "test.parent.$$" . '.txt';
open my $fh, '>', $testfile or die "failed to open '$testfile' $!";