[posted and e-mailed]
Jeff 'Japhy' Pinyan wrote:
>
> Ok, here's my regex-vs-eq rant.
>
> [snip]
I know that beginners post and e-mail their replies without any
indication but I expected better of you. :-(
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
On Nov 17, John W. Krahn said:
>You might have a problem with this if there are any characters in $match
>that are special to regular expressions or $match is a sub-set of the
>array element so use either:
>
>my @filtered = grep /^\Q$match$/i, @array;
>
>Or:
>
>my @filtered = grep $_ eq $match, @
Leon wrote:
>
> [snip kuddos]
>
> Co-incidentally, before I received the final solution, last night as I was
> in the bed pondering about the problem, suddenly I got the solution as I
> toyed upon what Andrea Holstein & Charles K. Clarkson constant reminder (in
> the previous msg; long time ago
@filtered = grep /$match/i, @array;
print "Your search for $match returns ", scalar @filtered," records.\n";
print (join '', @filtered);
Thanks !
end of msg ###
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <
Leon wrote:
>
> First I would like to Thank ALL the Members for the help !
> Secondly I would like to Thank those that urge me to use "use strict" &
> "my".
>
> Unfortunately I think a lot of members have misunderstood my earlier-first
> question.
> My question is:- what must I do so that the ou
On Sat, Nov 17, 2001 at 05:48:44PM +0800, Leon wrote:
> First I would like to Thank ALL the Members for the help !
> Secondly I would like to Thank those that urge me to use "use strict" &
> "my".
>
> Unfortunately I think a lot of members have misunderstood my earlier-first
> question.
> My ques
eturn thing.
};
### end of script
- Original Message -
From: "Andrea Holstein" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 9:19 PM
Subject: Re: sub-routine help needed.
> "Merrychristmas!" wrote:
> >
> >
"Merrychristmas!" wrote:
>
> 1.@array = qw ( hello world hello how are you );
> 2.$match = 'HEllo';
> 3.print "Your search for $match returns $subroutine $count
> records\n";
>
> $subroutine = &count;
> sub count {
> foreach $record (@array){
> if (grep /$ma
!" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 4:04 AM
Subject: Re: sub-routine help needed.
> > Sigh ! My mind simply refuses to work. What must I do to print the
number
> of
> > records $count in line 3.
>
"Merrychristmas!" wrote:
>
> Sigh ! My mind simply refuses to work. What must I do to print the number of
> records $count in line 3.
> Thanks
>
> 1.@array = qw ( hello world hello how are you );
> 2.$match = 'HEllo';
> 3.print "Your search for $match returns $subroutine $count
> rec
> Sigh ! My mind simply refuses to work. What must I do to print the number
of
> records $count in line 3.
> Thanks
>
>
> 1.@array = qw ( hello world hello how are you );
> 2.$match = 'HEllo';
> 3.print "Your search for $match returns $subroutine $count
> records\n";
> $subroutine = &
11 matches
Mail list logo