--- 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?

Absolutely. Try this:

 my @chars = split //, $str;

that should match the space between every character, and so split
between each. =o)

If for some reason that behaves oddly (and I won't even go into the
case where it might), try this:

my @chars = split /(?:somePatternThatWillNeverMatch)?/, $str;

the ()? means one or none of that pattern, and none is a match, so
it'll work -- but you should never need that.

Have fun!

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to