Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Print output file to a directory

by fisher (Priest)
on May 15, 2013 at 08:26 UTC ( [id://1033636]=note: print w/replies, xml ) Need Help??


in reply to Print output file to a directory

it's easy enough. Just do like this:
#!/usr/bin/env perl mkdir "New Files"; open O, ">New Files/NewTextFile.txt" or die "Can't: $!"; print O "Hi there\n";

Replies are listed 'Best First'.
Re^2: Print output file to a directory
by fisher (Priest) on May 15, 2013 at 08:30 UTC
    Oh, oh, and you of course can 'cd' there if you like:
    mkdir "New Files"; chdir "New Files"; open O, ">NewTextFile.txt" or die "Can't: $!"; print O "Hi there\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-19 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found