Agnus Dei (jackal) wrote,
Agnus Dei
jackal

using unless to create missing directory

#!/usr/bin/perl

$heap_dump_dir="/nfs/tmp/dumps";

unless(-d $heap_dump_dir){
        print "Creating $heap_dump_dir\n";
        mkdir $heap_dump_dir or die "Can not create $heap_dump_dir\n";
}
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 0 comments