in reply to Re: Re: "for" surprise
in thread "for" surprise
sub search{ my ($item,$end) = @_; my $i; my $found = 1; foreach $i (0..$end) { if (some condition on the list){ return ($found, $i); } } return (0,0); }
since perl supports multiple return values, we could return $found as well if someone wants it.
|
|---|