Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: create directories while creating a file

by tobyink (Canon)
on Jan 02, 2013 at 12:51 UTC ( [id://1011263]=note: print w/replies, xml ) Need Help??


in reply to create directories while creating a file

use Path::Class qw( file ); my $file = file '/tmp/foo/bar/baz.txt'; $file->dir->mkpath; print { $file->openw } "Hello world!\n";
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1011263]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found