in reply to returning data from a for() loop?
push @x,substr($i,$_,1) for(0 .. length $i);
Update:Or this (uses map):
@x = map{substr($i,$_,1)}0 .. length $i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: returning data from a for() loop?
by strfry() (Monk) on Jun 08, 2001 at 23:26 UTC |