in reply to Hash comparing
(and similarly for $FILE2PKG). As it stands, every value of %FILE1PKG is a reference to an entire (albeit 1-key) hash, and it's those hashrefs that you're trying to compare.$FILE1PKG{$PACKAGE1[0]} = $PACKAGE1[1];
Further, notice that the last argument, 2, on your splits is saying not to grab more than 2 fields. That's why the REV is trailing along with the VERSION. If you want to discard everything but the first two fields, then you can do something like my ( $key, $value ) = split(',', $_);.
There are other issues, like the absence of use strict; use warnings; and the non-declaration of various variables, but I think those are the ones that are affecting your functionality.
Also, did you really want to use a string-comparison eq?
UPDATE: On further reading, your OUTPUT does not come from the INPUT you provided. Also, I've stricken the comment about split because I guess from your example data that you want to carry the REV data inside the VERSION. Notice, though, that this looks like CSV, so you should be parsing it with something like Text::CSV, not hand-rolling.
|
|---|