Mike Flannigan wrote:
>
> Newbie here.
> I'm trying to experiment with this code in FAQ4.
>
> I'd like to fix line 12 of this code first:
>
> use strict;
> use warnings;
>
> my @array1 = ("a","b","c","d","e","f","g");
> my @array2 = ("h","b",'c',"i","j","k","g");
>
> my @union = my @intersection = my @difference = ();
> my %count = ();
> foreach my $element (@array1, @array2) { $count{$element}++ }
> foreach my $element (keys %count) {
> push my (@union, $element);
^^
> push my (@{ $count{$element} > 1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED]
^^
> }), $element;
Remove the my() function and it will work.
push @union, $element;
push @{ $count{$element} > 1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED] },
$element;
> #<<<THIS IS LINE 12
> }
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]