in reply to Re: Re: Compare of array
in thread Compare of array

Undefined subroutine &Embperl::__5::Compare

Without seeing the details of what you're doing, it's hard to be sure (especially since I've never used Embperl), but this looks to me like it might be a namespace issue. When you call the Compare subroutine, try expressly specifying which one you mean:

@td = Today([$year,$month,$day]); @tod=($year,$month,$date); $c=Data::Compare::Compare($td,$tod); if ($c==1) { $bgcolor="#c0c0c0"; } else { $bgcolor="#FFFFFF"; }

For comparing dates, though, I would probably be using DateTime or one of the other modules specifically designed to work with dates.

One last question: did you use the module whose routine you were trying to call? Your code needs to say something like use Data::Compare before you can call anything it defines.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/