Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Print output file to a directory

by fisher (Priest)
on May 15, 2013 at 08:26 UTC ( #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
Node Status?
node history
Node Type: note [id://1033636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-08-24 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (347 votes). Check out past polls.