in reply to Re^3: If condition failing..
in thread If condition failing..

Actually I want the other way like below,but if i use it i am getting the below error.

if ( $pathname_versions{$1} > $2) { #if the version in list2 i +s less than version for the same path in list1 print "IN\n"; }

Can't use string ("6") as a HASH ref while "strict refs" in use at orphan_overwrite.pl line 30, <IN> line 28

Replies are listed 'Best First'.
Re^5: If condition failing..
by Anonyrnous Monk (Hermit) on Dec 13, 2010 at 02:08 UTC
    Can't use string ("6") as a HASH ref

    This is probably because somewhere else you still have $pathname_versions{$1}{$2}.

    So, if $pathname_versions{$1} is now "6", for example, the {$2} would be trying to dereference the value "6", i.e. "6"->{$2}, which doesn't make much sense...