use strict; use File::Spec; my $str = " /home/madam ~/madam"; my @strarray = split(" ",$str); for (@strarray){ if ( -d $_){ print "path present : $_\n"; } else { print "path not present : $_\n"; } }
but both paths are same. why it is not understanding ~/madam? Thanks, Madamthe output is : path present : /home/madam path not present : ~/madam
In reply to how to expand home directory ~ by Madam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |