http://qs321.pair.com?node_id=1033636


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";