in reply to Re^3: how to pull in all params that are numbered
in thread how to pull in all params that are numbered
The same behaviour occurs when test being evaluated is param(). Additionally, while (param()){} will not modify $_. Perhaps you tested the script without any arguments, in which case it would have behaved as expected.
Here is a simple test:
You can verify it by adding the parameters on the commandline, e.g.#!/usr/bin/perl use strict; use warnings; use CGI qw(param); my $runs =0; my @num; print "Content-type: text/plain\n\n"; while(param()) { printf "run %d\n", $runs++; if ($runs > 10) { print "Ran over 10 times\n"; exit; } }
perl foo.pl a=b
|
---|