Scott E Robinson wrote:
>
> Okay, since i wasn't clear the first time, let me try again. Sorry, I'm
> not a professional programmer, I'm a true beginner.
>
> LONG VERSION:
>
> I think John W. Krahn's post is very close to what I was actually asking.
> John's solution showed me that the context
R. Joseph Newton wrote:
> Rob Dixon wrote:
>
> > my $key = ':L000:W000:M260:B271:8:A:';
> > my $regex = join '|', ($candidate =~ m/\w+/g);
>
> Slick! I like it. It's not my style exactly [I'd at least throw a
> comment in: "Set up or for regex"], but it definitely caught my
> fancy.<| :-
Rob Dixon wrote:
> my $key = ':L000:W000:M260:B271:8:A:';
> my $regex = join '|', ($candidate =~ m/\w+/g);
Slick! I like it. It's not my style exactly [I'd at least throw a comment in: "Set
up or for regex"], but it definitely caught my fancy.<| :-o )
Joseph
--
To unsubscribe, e-
Scott E Robinson wrote:
> Okay, since i wasn't clear the first time, let me try again. Sorry,
> I'm not a professional programmer, I'm a true beginner.
Don't apologise for not being a prefessional programmer: some
would consider it a thing to be proud of :-)
>
> SHORT VERSION:
>
> What I want is
Okay, since i wasn't clear the first time, let me try again. Sorry, I'm
not a professional programmer, I'm a true beginner.
SHORT VERSION:
What I want is Joseph's option 2b, if I understand him correctly. Given a
string of the form
:M260:
I want to get a count of its occurrences in a single
Scott E Robinson wrote:
>
> Thanks, Rob and Mark, but I'm pretty sure I'm trying to do something a
> little different from a count hash. Each token in the candidate string
> needs to be compared separately to all the target strings, and then count
> the number of matches. So take any token out o
Paul Johnson wrote:
> On Wed, Mar 12, 2003 at 03:09:36PM -0800, R. Joseph Newton wrote:
> > Mark Anderson wrote:
> >
> > > > It sounds like you need a count hash. You might try something like:
> > > >
> > > > my @tokens = split /:/;
> > > > foreach (@tokens) {
> > > >if ($tokenCount{$_}) {
[EMAIL PROTECTED] wrote:
> Thanks, Rob and Mark, but I'm pretty sure I'm trying to do something a
> little different from a count hash. Each token in the candidate string
> needs to be compared separately to all the target strings, and then count
> the number of matches. So take any token out of
To: <[EMAIL PROTECTED]>
.com>cc:
Subject: RE: COunting the number
R. Joseph Newton wrote:
> Mark Anderson wrote:
>
> > > It sounds like you need a count hash. You might try something
> > > like:
> > >
> > > my @tokens = split /:/;
> > > foreach (@tokens) {
> > >if ($tokenCount{$_}) {
> > > $tokenCount{$_}++;
> > >} else {
> > > $tokenCount{$_
On Wed, Mar 12, 2003 at 03:09:36PM -0800, R. Joseph Newton wrote:
> Mark Anderson wrote:
>
> > > It sounds like you need a count hash. You might try something like:
> > >
> > > my @tokens = split /:/;
> > > foreach (@tokens) {
> > >if ($tokenCount{$_}) {
> > > $tokenCount{$_}++;
> > >
"R. Joseph Newton" wrote:
>
> [EMAIL PROTECTED] wrote:
>
> > Hi! Maybe this is really easy, but hey, I'm a beginner with Perl.
> >
> > I'm trying to count the number of times a string is contained inside
> > another string. Here's a sample of my data, a set of colon-delimited
> > values from th
> > The following works the same and may or may not be easier to
> > understand/maintain.
> > $tokenCount{$_} is automatically created with a value of 0 when first
> > called, and
> > then is incremented to 1, so you don't have to test or create it
yourself.
> >
> > my @tokens = split /:/;
> > f
Mark Anderson wrote:
> > It sounds like you need a count hash. You might try something like:
> >
> > my @tokens = split /:/;
> > foreach (@tokens) {
> >if ($tokenCount{$_}) {
> > $tokenCount{$_}++;
> >} else {
> > $tokenCount{$_} = 1;
> >}
> > }
>
> The following works th
> It sounds like you need a count hash. You might try something like:
>
> my @tokens = split /:/;
> foreach (@tokens) {
>if ($tokenCount{$_}) {
> $tokenCount{$_}++;
>} else {
> $tokenCount{$_} = 1;
>}
> }
The following works the same and may or may not be easier to
unders
[EMAIL PROTECTED] wrote:
> Hi! Maybe this is really easy, but hey, I'm a beginner with Perl.
>
> I'm trying to count the number of times a string is contained inside
> another string. Here's a sample of my data, a set of colon-delimited
> values from the Perl Soundex function, with a few pure nu
16 matches
Mail list logo