in reply to error using FileHandle Module

The SYNOPSIS for FileHandle shows
$fh = FileHandle->new("> FOO"); if (defined $fh) { print $fh "bar\n"; $fh->close; }
Try that.

Replies are listed 'Best First'.
Re^2: error using FileHandle Module
by atanug (Initiate) on Dec 16, 2010 at 11:15 UTC
    Try This one. This will work. use strict; use FileHandle; my $LOG = "log.txt"; my $fh = FileHandle->new(">> $LOG"); if (defined $fh) { print $fh "bar\n"; $fh->close; }