in reply to Comparing strings

if its an array you can compare both in the following way
@union = @intersection = @difference = (); %count = (); foreach $element (@a, @b) { $count{$element}++ } foreach $element (keys %count) { push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference } +, $element; } foreach $int (@difference){ if ($int ne " "){ @fname = split(/ /, $int); print "\n difference elements --> $fname[0]\n"; } }

Edited by planetscape - added code tags

( keep:0 edit:20 reap:0 )

Replies are listed 'Best First'.
Re^2: Comparing strings
by tanyeun (Sexton) on Jul 25, 2006 at 00:55 UTC
    thanks, monks ^^
    although some of your suggestions
    are above my level
    I'll work hard to keep up with it