On Thu, 28 Mar 2002 at 04:23:20 -0600, Dave Hoover wrote:

> This works for me with decimals:

> ($x="@a") =~ s/([\d.]+) ?/$min||=$1;$min=$1<$min?$1:$min/eg;

Sorry, this steps into the heffalump trap that "0" is false.

(There was a prolonged and bitter debate on p5p about whether to have an
"if defined" operator like ||. The "nos" won the day.
The debate wasn't fun, so would be off-topic for this group :-)

> > It's an interesting academic exercise, but for Larry's sake, don't use
> > it in a real program!

That should be for the Author's sake, don't you think?  (On scanning the
perl docs, I don't find the quotation that would make sense of that.
Anyone know when it went and where it was, exactly?)

Ian

Reply via email to