|
Posted by fourfour2 on June 3, 2008, 1:13 pm
Please log in for more thread options wrote:
> fourfour2@gmail.com wrote:
> >> fourfo...@gmail.com wrote:
>
> >>>>>> syntax error,next 2 tokens :grep {"
> >> [...]
> >>> #this works in perl 5, not perl 4
> >>> $potatoe=3D"thisisapotatoe(one)";
> [...]
> > Since I got special characters in the string, =A0grep(EXPR,LIST) doesn't=
> > handle these.
>
> > if (!grep(/^$potatoe$/, @listofpotatoes)) {
> > =A0 print "$potatoe is not in list";
> > }
>
> > This prints: potatoe is not in list
>
> Really? =A0I don't see how it's possible that it printed 'potatoe' there
> when the value is 'thisisapotatoe(one)'. Maybe it's a Dan Quayle bug.
You're right. Sorry.
>
> > But it is.
> > I think it's b/c of the parenthesis in the string.
>
> > Any suggestions?
>
> Ahhh.. You can always use a 'for' loop.- Hide quoted text -
No. Don't want that.
Thanks.
> - Show quoted text -
|