Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: -f not identifying .txt files

by betterworld (Deacon)
on Sep 24, 2010 at 16:04 UTC ( #861842=note: print w/ replies, xml ) Need Help??


in reply to -f not identifying .txt files

As others have said, the problem is probably that you don't have the full path name in your -f argument.

I like to use Path::Class because it avoids these problems:

use Path::Class qw(dir); my $dir = dir("/path/to/dir"); my @files = $dir->children; my $examplefile = $files[0] or die "no files"; print "is plain file" if -f $examplefile; # Or: print "is plain file" unless $examplefile->is_dir;


Comment on Re: -f not identifying .txt files
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://861842]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2015-07-07 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls