Re: writing to a notepad in perl



rajendra <rajendra.prasad@xxxxxxxxxxxx> wrote:


open(f,">test.txt");


You should use uppercase filehandles.

You should always, yes *always*, check the return value from open():

open F, '>test.txt' or die "could not open 'test.txt' $!";

Even better, use lexical filehandles and the 3-arg form of open:

open my $F, '>', 'test.txt' or die "could not open 'test.txt' $!";


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
.