Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Writing many lines to a file

by gri6507 (Deacon)
on Jul 16, 2012 at 12:47 UTC ( [id://982026]=note: print w/replies, xml ) Need Help??


in reply to Writing many lines to a file

It looks like you are just starting with Perl. One of the key features of Perl is that There Is More That One Way To Do It (TIMTOWTDI). Depending on the exact problem you are trying to solve, the solution may be different. However, given what little background you have specified in your post, one easy way to accomplish what you want is with the following one line

print MYFILE "abc, def\n" for (1 .. 100);

I rather suspect that your actual problem may be somewhat different, so please post any follow up questions here, after reading about How do I post a question effectively?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-18 05:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found