Re: sub-routine help needed.

2001-11-18 Thread John W. Krahn
[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]

Re: sub-routine help needed.

2001-11-18 Thread Jeff 'japhy' Pinyan
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, @

Re: sub-routine help needed.

2001-11-17 Thread John W. Krahn
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

Re: sub-routine help needed.

2001-11-17 Thread Leon
@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: <

Re: sub-routine help needed.

2001-11-17 Thread John W. Krahn
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

Re: sub-routine help needed.

2001-11-17 Thread Paul Johnson
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

Re: sub-routine help needed.

2001-11-17 Thread Leon
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: > > > >

Re: sub-routine help needed.

2001-11-16 Thread Andrea Holstein
"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

Re: [PBML] sub-routine help needed.

2001-11-16 Thread J.E. Cripps
> Thanks Cripps & Members, > What should be the way to simplify the undermentioned working code as Part 1 > and part 2 are repetition. Actually they aren't. Look at them and see. :-) It's late here. It might be late where you are too. That makes things that are different look alike sometimes.

Re: sub-routine help needed.

2001-11-16 Thread Rex Arul
!" <[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. >

Re: sub-routine help needed.

2001-11-16 Thread John W. Krahn
"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

Re: [PBML] sub-routine help needed.

2001-11-16 Thread Leon
}; }; print $count; }; end of script # - Original Message - From: "J.E. Cripps" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 16, 2001 4:17 PM Subject: Re: [PBML] sub-routine help needed.

Re: sub-routine help needed.

2001-11-16 Thread Jos I. Boumans
> 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 = &

Re: [PBML] sub-routine help needed.

2001-11-16 Thread J.E. Cripps
Given this code: > 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 /$match/i, $record

sub-routine help needed.

2001-11-15 Thread MerryChristmas!
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 = &count; sub count {