or, more traditionally,use File::Slurp "write_file"; write_file("filename", $mac) or die "Error writing to file: $!";
(Ideally, you should check if the print and close fail also; this is commonly overlooked.)open my $handle, "> filename" or die "Couldn't open file: $!"; print $handle $mac; close $handle;
In reply to Re: Output to file question
by ysth
in thread Output to file question
by dannyp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |