#!/usr/bin/perl use strict; use warnings; use FileHandle; my $log = '/root/Desktop/log.txt'; my $fh1 = FileHandle->new("> $log") or die $!; print $fh1 "this is a test\n"; $fh1->close; my $fh2 = FileHandle->new(">> $log") or die $!; if (defined $fh2) { print $fh2 "bar"; $fh2->close; }
In reply to Re: error using FileHandle Module
by Khen1950fx
in thread error using FileHandle Module
by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |