Weekly Perl Script [Issue 7]
Bill Jones
bill at fccj.org
Fri Jul 23 09:17:12 CDT 1999
On the Jax.PM jacksonville-pm-list;
"Bill Jones" <bill at fccj.org> wrote -
> 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);
>>>> }
>>>
>>>
>
> 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
Mea Culpa :(
This line:
if (index("abcdefghijklmnopqrstuvwxyz",
should say:
unless (index("abcdefghijklmnopqrstuvwxyz",
And what was funny is that It only prints the Capital letters :(
(I do not remember what I was thinking at the time, and must have
really changed my mind before posting...)
Example output:
Inside of a, I found
Inside of AAA, I found AAA
Inside of AAAS, I found AAAS
Inside of Aarhus, I found A
Inside of Aaron, I found A
Inside of AAU, I found AAU
Inside of ABA, I found ABA
Inside of Ababa, I found A
Inside of aback, I found
Inside of abacus, I found
Inside of abalone, I found
Inside of abandon, I found
Inside of abase, I found
Inside of abash, I found
Inside of abate, I found
Inside of abater, I found
Inside of abbas, I found
Inside of abbe, I found
Inside of abbey, I found
Inside of abbot, I found
Inside of Abbott, I found A
Boy, was I way off;
-Sneex- :]
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