Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Saving data to file

by codiac (Beadle)
on Apr 08, 2014 at 11:49 UTC ( #1081492=note: print w/replies, xml ) Need Help??


in reply to Saving data to file

map might be an easier way to do this.
my $data = [1,0,1,2,3,4,5,6,7,8,9,11,2,2,3,34,5,6,7,8,81]; output($data); sub output { open my $fh, '>>', "output.txt"; print $fh map {"$_\n"} @{$_}; close $fh; }
If you use qw, then you need to change the call to output.
my @data = qw( 1 0 1 2 3 4 5 6 7 8 9 11 2 2 3 34 5 6 7 8 81 ); output(\@data);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2023-09-26 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?