in reply to Output to file question

One way:
use File::Slurp "write_file"; write_file("filename", $mac) or die "Error writing to file: $!";
or, more traditionally,
open my $handle, "> filename" or die "Couldn't open file: $!"; print $handle $mac; close $handle;
(Ideally, you should check if the print and close fail also; this is commonly overlooked.)

Replies are listed 'Best First'.
Re^2: Output to file question
by dannyp (Novice) on Jul 21, 2004 at 23:45 UTC
    Thanks