Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Output to file question

by beable (Friar)
on Jul 22, 2004 at 01:29 UTC ( [id://376434]=note: print w/replies, xml ) Need Help??


in reply to Output to file question

Here's another way, using the Tie::File module:
#!/usr/bin/perl use strict; use warnings; use Tie::File; my $mac = "this is the variable to be written to a file"; # tie array to output file tie my @array, 'Tie::File', "outputfile.txt" or die "can't open file: +$!"; # write $mac to file push @array, $mac; # all finished untie @array; __END__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://376434]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-24 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found