Ross Larner <[EMAIL PROTECTED]> wrote:
>Hello.  I am attempting to print a string one character at a time.
>Right now I am using one while loop with chop to create a new string,
>the reverse of the original string, then another while loop with chop
>on the reversed string to print out the characters.  I'm sure there's
>a more straight-forward way of doing this - any ideas?

Use a regex to iterate over the characters of the string:

while ($string =~ /(.)/gs) {
    my $char = $1;
    # ...
}

-- 
Sean McAfee                                                [EMAIL PROTECTED]
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!

Reply via email to