Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: diff-servers.pl - Diff directory trees across machines

by stevieb (Canon)
on Aug 24, 2015 at 14:02 UTC ( [id://1139683]=note: print w/replies, xml ) Need Help??


in reply to diff-servers.pl - Diff directory trees across machines

After a quick glance, I'd move the use Data::Dumper; from the middle of the script to the top of it. That keeps all of your use statements together so it's easy to see exactly what you're using at a glance, and also if you ever lose the requirement of the Dumper statements, you may forget to remove the use statement (because it is buried) which will load the module unnecessarily.

One other thing is that I'd do a check to ensure the correct number of args are passed in. Change this:

my( $server1, $server2 )= @ARGV;

...to something like this:

die "Usage: script.pl server1 server2" if @ARGV != 2; my ($server1, $server2) = @ARGV;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found