Re: Creating a Logon Form

[email protected] (PekinSOFT) Wed, 10 Dec 2008 09:33:36 -0800 (PST)
Newsgroups perl.beginners.cgi
Organization http://groups.google.com
Message-ID <51e8514f-725d-4cc0-a3ea-ecebe30e15d0@y18g2000yqn.googlegroups.com>
On Dec 9, 10:15 pm, [email protected] (John W. Krahn) wrote:
> Say that you pass the string "hiyall2008153639492" to strip_string and
> the length of that string is 19 characters.  At the start of the loop $i
> is 0 and length($_[0]) - $i is 19 so your expression says:
>
>        $ret .= substr("19", 1);
> Or:
>
>         $ret .= "9";
>
> At the next iteration through the loop $i is 1 so you have:
>
>         $ret .= substr("18", 1);
>
John, I understand what you are saying here, but in my script, I'm not
looping $_[0] - $i times.  I set my loop up to loop $_[0] - 9 times,
so what you are describing shouldn't be happening.  The logic that I
was attempting with this loop was to add each character, one at a
time, from the provided string to the $ret variable, stopping 9
characters shy of the end of the string.  However, with it set up the
way it is, for some reason I'm either getting the 9 characters that I
didn't want or a whole other bunch of 9 characters that I have no clue
from whence they came.  Kinda frustrating, really.

Cheers,

Sean C.
PekinSOFT Systems