Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Creating new folders

by apl (Monsignor)
on Feb 03, 2008 at 18:55 UTC ( #665844=note: print w/replies, xml ) Need Help??


in reply to Creating new folders

Building on what plobsing said, I'd suggest
use File::Path 'mkpath'; CreateIfNotPresent( "e:/web/public_html/eagle_f91/ffinfo/protected/ima +ges/$Game" ); CreateIfNotPresent( "e:/web/public_html/eagle_f91/ffinfo/protected/ima +ges/$Game/$SubSet" ); CreateIfNotPresent( "e:/web/public_html/eagle_f91/ffinfo/protected/ima +ges/$Game/$SubSet/thmb" ); sub CreateIfNotPresent { my ( $dir ) = @_; unless (-d $dir) { mkpath($dir) or die "Could not mkpath '$dir': $!\n" } }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2021-10-23 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (88 votes). Check out past polls.

    Notices?