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

Explain splicing of arrays?

515


Which has highest precedence in between list and terms? Explain?

436


Does Perl have objects? If yes, then does it force you to use objects? If no, then why?

542


What are the options that can be used to avoid logic errors in perl?

516


What is cpan in perl?

542






What does a die() function do in perl?

538


What is -> symbol in perl?

566


How the interpreter is used in Perl?

531


What is the difference between single (') and double (") quote in a string in perl?

483


How to read a single line from a file in perl?

535


Give an example of the -i and 0s option usage.

465


How do I generate a list of all .html files in a directory?

527


Explain what is perl language?

506


Why we use CGI?

2109


Explain socket programming in perl?

502