Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033636]
[Corion]: Oh - I released a new version of some module, thanks to a pull request. But I don't consider "update Makefile.PL" and "update author tests" as "writing code" ;-D
[marto]: sounds fun, the opposite of my weekend :P
[Corion]: marto: You wrote Perl? Or did you have to work (and wrote Perl)?
[marto]: the fun part, I had no fun this weekend, very stressful :)
[Corion]: But I feel an introductory talk gestating, working title "Reading CPAN" - how to read module documentation, how to judge a module, how to read the module tests/examples
[Corion]: marto: Ouch :-/ The kids are making trouble?
[Corion]: Meh - food becons, and colleagues are staring at me, talk to you later, sorry!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-08-21 09:30 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.