in reply to processing key value pairs of a hash
First of all: You write good code.
Now on to the critisism (I don't quite understand what you are trying to achive (your file at the top has 2 fields but in your script you seem to deal with 10 of them and I had too much beer to guess what you probably could mean - which is why I will focus purely on formal stuff :-)
1) "perl -w" in the she-bang line and "use warnings" are pretty much the same thing (won't hurt of course :-)
2) You should check the result of your open-statements e.g. "open my $fh, "file" or die $!;"
3) Don't repeat yourself. Put the (common) directory that your files share into a variable, then you only have to change one line of code should you ever want to access files in a different directory.
4) Why chomp the first line when you want to discard it anyway?
5)The keys of your %clone_hash seem to be strings so you should simply sort them using cmp.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: processing key value pairs of a hash
by toolic (Bishop) on Apr 14, 2009 at 20:52 UTC | |
by morgon (Priest) on Apr 14, 2009 at 21:08 UTC | |
by toolic (Bishop) on Apr 14, 2009 at 21:19 UTC | |
by lomSpace (Scribe) on Apr 15, 2009 at 13:06 UTC | |
by lomSpace (Scribe) on Apr 15, 2009 at 13:05 UTC | |
|
Re^2: processing key value pairs of a hash
by lomSpace (Scribe) on Apr 15, 2009 at 13:04 UTC |