Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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";


Comment on Re: Print output file to a directory
Download Code
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 surveying the Monastery: (13)
As of 2014-07-11 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (232 votes), past polls