Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: selcting a specific file

by swampyankee (Parson)
on Oct 23, 2007 at 02:58 UTC ( [id://646631]=note: print w/replies, xml ) Need Help??


in reply to selcting a specific file

My experience is that all the -X file operators work on Windows and FreeBSD. You could try

@files = grep { -s and -f} @files;
I would make sure that it's actually a file; directories on *ix-ish systems have non-zero size. It would probably also make sense to check to see if you have the required permissions for copying the file into another location, e.g. on *ix, you need write access in the target directory.

Copying files can be done with File::Copy or system,


...kudos to blazar for his observation about _ and the -X operators.


emc

Information about American English usage here and here.

Any Northeastern US area jobs? I'm currently unemployed.

Replies are listed 'Best First'.
Re^2: selcting a specific file
by blazar (Canon) on Oct 24, 2007 at 14:35 UTC
    @files = grep { -s and -f} @files;

    I personally believe that this is fine, but to avoid a double stat one would better

    @files = grep { -s and -f _} @files;

    Of course it would be nice to also have chained -X's, and IIRC 5.10 has them.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found