[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
RE: [ic] Trying to add products using non-numeric quantities...
} You want this w/o the if? I think you can write:
}
} @quantities = map { s/(^=)?\D/$1/g; $_ }
}
} or better:
}
} @quantities = map { s/[^\d=]//g; $_ }
}
} or maybe faster like:
}
} #delete unknown (==not 0-9,=) chars and map something(?):
} @quantities = map { tr/0-9=//cd; $_ }
}
The problem was, if the first character is an equals sign, ignore it and
strip all non-digits past that FIRST equals sign. ie: "=1=4" should be "=14"
Of course, that first equals sign is optional, and may not occur at any
other location, so "=1a1" should be "=11", "1a=14" should be "114", etc.
--
Jeff Carnahan - jcarnahan@networq.com