campbell has asked for the wisdom of the Perl Monks concerning the following question:
I would like to take each member of an array, and remove anything in that member that is not a digit.
I tried this:
but this did not work: I just ended up with nothing. What am I doing wrong!?foreach $n(@array) { $num=s/\D//i; print $num; }
Yours humbly,
Campbell
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Removing non digits
by jeffa (Bishop) on Jul 23, 2003 at 15:00 UTC | |
|
Re: Removing non digits
by perlplexer (Hermit) on Jul 23, 2003 at 15:02 UTC | |
|
Re: Removing non digits
by dga (Hermit) on Jul 23, 2003 at 15:09 UTC | |
by sauoq (Abbot) on Jul 23, 2003 at 17:57 UTC | |
|
Re: Removing non digits
by The Mad Hatter (Priest) on Jul 23, 2003 at 15:10 UTC |