Why not write a subroutine?
sub write_file { my $filename = shift; local *FH; open( FH, "> $filename" ) or die "Cannot open '$filename': $!\n"; log( "Opened '$filename' ); print FH @_; close FH; log( "Closed '$filename' ); }
In reply to Re: Replicate open() and close()
by chromatic
in thread Replicate open() and close()
by BigLug
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |