|
Posted by fourfour2 on June 3, 2008, 3:52 am
Please log in for more thread options > fourfo...@gmail.com wrote:
> >> This works in Perl 5 but not Perl 4:
>
> >> ...
> >> $string1=3D"thisisstring(one)";
> >> @stringlist=3D("thisisstring(one)", "thisisafunnystring");
>
> > I mean
> > $potatoe=3D"thisisstring(one)";
> > @listofpotatoes=3D("thisisstring(one)", "thisisafunnystring");
>
> > if (( !grep { $potatoe eq $_ ) @listofpotatoes {
> > =A0 =A0print "Not found in list....\n"
>
> > }
> >> syntax error,next 2 tokens :grep {"
>
> I don't believe you when you say that the above code works in Perl 5.
> Please copy and paste the code you post; don't type it with multiple typos=
.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl- Hide quoted text -
>
> - Show quoted text -
#this works in perl 5, not perl 4
$potatoe=3D"thisisapotatoe(one)";
@listofpotatoes=3D("thisisapotatoe(one)", "thisisanoldpottit");
if ( !grep { $potatoe eq $_ } @listofpotatoes) {
print "Not found in list....\n";
}
|