in reply to Re: File existance check failure
in thread File existance check failure
Much Thanks.
With that I brewed the following:
sub fexist($) { my $str = shift; for (glob qq("$str")) { return 1 if -e "$_"; } return 0; }
However I have use for the Link, Directory, File result so:
sub fexist($) { my $str = shift; for (glob qq("$str")) { return 3 if -l "$_"; return 2 if -d "$_"; return 1 if -f "$_"; } return 0; }
Critiques ??
Comments ??
Suggestions ??
Improvements ??
Thanks
-Enjoy
fh : )_~
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: File existence check failure
by Athanasius (Archbishop) on Nov 11, 2012 at 04:11 UTC | |
by Festus Hagen (Novice) on Nov 11, 2012 at 04:38 UTC | |
Re^3: File existance check failure
by graff (Chancellor) on Nov 12, 2012 at 03:05 UTC |
In Section
Seekers of Perl Wisdom