in reply to Valid Numbers or decimals
#!/usr/bin/perl my @numbers = (0, 3.14, 5 , "any strings can come here 234 "); print "@numbers\n"; my @numgoods = grep{/^(\d*\.?\d+)$/ } @numbers; print "@numgoods\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Valid Numbers or decimals
by eieio (Pilgrim) on May 06, 2005 at 11:54 UTC | |
by reasonablekeith (Deacon) on May 06, 2005 at 12:38 UTC | |
by zentara (Cardinal) on May 06, 2005 at 16:20 UTC |