Hey, i have been trying what pg has recommended but it doesn't seem to work. I have added
my $first = shift @links;
push @links, $first / 2 if (!($first % 2));
at the end my loop and obviously it gives me the error Argument "http://www.perlmonks.com/" isn't numeric in modulus (%) which makes sense. Then i try just putting my $first = shift @links;
push @links, $first;
at the end of my code but that doesn't seem to work either. The way i see it, when we shift $first from an array and add it to the end of the array doesn't that mean that $first will be processed again after all the current elements are processed, when we reach that again? I might have the wrong idea for this so could someone please explain? Thanks in advance
P.S: The "Argument "http://www.perlmonks.com/" isn't numeric in modulus (%)" is only for reference i havent used the perlmonks website in my loop!! |