in reply to Re: Re: returning data from a for() loop?
in thread returning data from a for() loop?
When you call split with an empty pattern "//", it automatically splits into individual characters and returns that list of characters.my @chars = split(//, $string);
To print the results out as you have, then do this...
The split() works as I stated above.print join("\n", split(//, $string)), "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re4: returning data from a for() loop?
by strfry() (Monk) on Jun 08, 2001 at 23:33 UTC |