Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Compare Directories and List Changed or Missing Files

by Hofmator (Curate)
on Aug 16, 2001 at 13:49 UTC ( [id://105317]=note: print w/replies, xml ) Need Help??


in reply to Compare Directories and List Changed or Missing Files

Some suggestions:

  • You can use different delimiters in s///, so
    $sourceDir =~ s/\/\$/\$/; # is better written as $sourceDir =~ s#/\$#$#;
    btw, what is that supposed to do? It replaces a '/$' with a '$' sign, I see no obvious use for that ...
  • Instead of comparing files with a call to the external command diff - use File::Compare - it's portable and doesn't spawn an external process.

-- Hofmator

Replies are listed 'Best First'.
Re: Re: Compare Directories and List Changed or Missing Files
by sierrathedog04 (Hermit) on Aug 16, 2001 at 18:37 UTC
    Thanks for the suggestions about an alternate delimiter and using File::Compare.

    The regex ought to have been:

    $sourceDir =~ s#/$##;

    which would have removed a trailing forward slash at the end of a directory name. What I actually wrote was, as you mention, pointless.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found