P
Peng Yu
Hi,
The following code would give the following error, if the dir 'xy'
does not exist.
print() on closed filehandle OUT at ./open.pl line 7.
I'm wondering if there is a perl command that is smart enough to
create an directory automatically when it opens a file for write.
Thanks,
Peng
#!/usr/bin/perl
use strict;
use warnings;
open(OUT, '>xy/abx.txt');
print OUT "Hello World\n";
The following code would give the following error, if the dir 'xy'
does not exist.
print() on closed filehandle OUT at ./open.pl line 7.
I'm wondering if there is a perl command that is smart enough to
create an directory automatically when it opens a file for write.
Thanks,
Peng
#!/usr/bin/perl
use strict;
use warnings;
open(OUT, '>xy/abx.txt');
print OUT "Hello World\n";