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


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to