Who's code was it?
Code corrections:
$o->unique means you are calling the unique method of the $o object, which your code doesn't show being instantiated anywhere. The problem you listed was with the %tmp, which is basically incorrect syntax when you are trying to assign a value to a hash element.#!/usr/bin/perl -w use strict; my $o; sub unique { my $self=shift; my %tmp; map { $tmp{$_}=1 } @_; return keys %tmp; } my @array = qw(apples cheeries apples bananas apples); #$o->unique(@array); print unique(@array); 1;
Celebrate Intellectual Diversity
In reply to Re: compile errors
by InfiniteSilence
in thread compile errors
by pglenski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |