SPUG: Yet another silly question

Brian Van Horne bvh at speakeasy.net
Sat Jan 19 16:36:41 CST 2002


This should do it:

  # create dir if it doesn't already exist
  
  my $directory = '/absolute/path/to/dir/';
  mkdir($directory) unless -d $directory;

Brian

-- 
"The mind is not a vessel to be filled but a fire to 
be kindled."                              - Plutarch

On Sat, 19 Jan 2002, Susanne Bullo wrote:

> Ok, I am trying to figure out the coding for checking to see if a directory
> exists and if it doesn't, create it.  I've gotten out my "Perl For Dummies"
> book and did a lot of searching and am still stumped.  Anyone have a quick
> and easy answer for me?
> 
> Thanks!
> 
> Susanne Bullo - Sweet Homes
> 


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list