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?

Answer Posted / neo

Both are same

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of c over Perl?

727


you are required to replace a char in a string and store the number of replacements. How would you do that?

694


Mention the difference between die and exit in Perl?

844


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

752


What are the arguments and what do they mean in perl programming?

745


Why is it hard to call this function: sub y { "because" } ?

713


What is the difference between die and exit in perl?

751


What is eval function in perl?

721


List all the features of perl programming?

684


What syntax is used for grep() function?

786


When would `local $_' in a function ruin your day?

724


What is qq (double q)operator in perl?

769


What is the difference between use and require in perl?

652


List the prefix dereferencer in Perl.

744


Explain which feature of PERL provides code reusability?

918