vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:
my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; }
Are these two while loop are doing the same functionality ? What may be the difference?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Alternative for push
by BrowserUk (Patriarch) on Mar 27, 2009 at 06:12 UTC | |
|
Re: Alternative for push
by chromatic (Archbishop) on Mar 27, 2009 at 05:59 UTC | |
|
Re: Alternative for push
by CountZero (Bishop) on Mar 27, 2009 at 07:13 UTC | |
|
Re: Alternative for push
by GrandFather (Saint) on Mar 27, 2009 at 10:18 UTC | |
|
Re: Alternative for push
by cdarke (Prior) on Mar 27, 2009 at 12:51 UTC | |
|
Re: Alternative for push
by Anonymous Monk on Mar 27, 2009 at 04:44 UTC |