Wait, I think I need to change the stuff in the sub :)

On Wed, 21 Nov 2001, Pinar 2 wrote:

>
> Hi Japhy,
>
> I was practicing your difference script but I got the following
> error when I ran my script:
> syntax error at ./shopdiff.pl line 5, near "++ for "
> Execution of ./shopdiff.pl aborted due to compilation errors.
>
> Here is my script:
>
> #!/usr/local/bin/perl -w
>
> sub difference {
>     my %seen;
>     for (@_) { $seen{$_}++ for @$_ }
>     return grep $seen{$_} == 1, keys %seen;
>   }
> $listss = 'stopandshop';
> $listshaws = 'shaws';
>
> open (SS, $listss);
> open (SHAWS, $listshaws);
>
> @ss = <SS>;
> @shaws = <SHAWS>;
>
> @diff = difference (\@ss, \@shaws);
>
> print @diff, "\n";
>
> ------
>
> I created two lists stopandshop and shaws and put inside a few common
> items besides unique items.
>
> thanks for your help!
> Pinar
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to