Weekly Perl Script [Issue 7]
j proctor
jproctor at oit.umass.edu
Fri Jul 23 08:32:44 CDT 1999
On the Jax.PM jacksonville-pm-list;
j proctor <jproctor at oit.umass.edu> wrote -
>>> while (++$len <= length) {
>>> print substr($_, $len, 1)
>>> if (index("abcdefghijklmnopqrstuvwxyz",
>>> substr($_ , $len, 1)) > -1);
>>> }
>>
>>
>> print split(/[^a-z]+/, $_);
> Very good :) When you moving back to Jax, FL ???
No time soon. Jacksonvile is purgatory--you have to stay there until you
figure out where you're really supposed to be. In the last year and a
half, I've gotten quite fond of Western Mass.
> The BONUS is also misleading - the script does nothing more funny
> than simply ignore any data lines that start with a Capital letter.
>
> So, you get credit for being first to answer and you get credit for
> answering the BONUS without really knowing - your solution - on
> the surface without testing - appears to do the same thing as the
> code you've replaced.
I tested it, and my version does *not* skip lines with initial caps
(although it does ignore the capital itself). On considering it, I
couldn't see why yours would skip a line either, so I checked, and it
behaved identically (it skipped the letter but not the line).
So, I eagerly await your explanation. :)
j
The Jacksonville Perl Monger's Group is operated by -
Bill -Sneex- Jones ( sneex at usa.net ),
to whom send all praises, complaints, or comments...
More information about the Jacksonville-pm
mailing list