in reply to Reading environment variables in perl
I think this is what you are having trouble with.
use File::Path qw(make_path remove_tree); my $sysParmSQL = qq{ select sys_vale from system_data where sys_name = 'OUT_DIR' }; my $sth= $dbh->prepare($sysParmSQL); $sth->execute; my $consolidatedPath = $sth->fetchall_arrayref({}); if ( $consolidatedPath->{sys_name} ) { unless ( -d $consolidatedPath->{sys_name} ) { print "Creating the directory : $consolidatedPath\n"; make_path( $consolidatedPath); } # do something here }else{ print "WARNING : DIR not found !!! Please configure the paramete +r \n" exit(1); }
|
---|