Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: File::Find duplicate question

by 2teez (Vicar)
on Oct 25, 2014 at 02:48 UTC ( [id://1104947]=note: print w/replies, xml ) Need Help??


in reply to File::Find duplicate question

..And if I may a second question, how do I output paths with the slash leaning the Windows way?
Instead of doing it yourself, use either "canonpath" from File::Spec

... use File::Spec; ... sub check_file{ -f && push ... , File::Spec->canonpath($File::Find::name); }
or Path::Tiny
... use Path::Tiny; ... sub check_file{ -f && push ... , path($File::Find::name)->canonpath}); }
More so, with -w on your shebag line, no warning as used wouldn't work. You probably want to use warnings; instead.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^2: File::Find duplicate question
by Anonymous Monk on Oct 25, 2014 at 13:19 UTC
    Thanks for replying, I didn't know about File::Spec nor Path::Tiny I'm not sure I have access to those modules a work but I'll check it out.

      You may probably have to install Path::Tiny, but you definitely have File::Spec which has been in perl CORE since perl 5.00405, am sure you have better.
      However, need I say you somehow need look at "Path::Tiny".

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-29 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found