in reply to How to remove non-numbers from string

Perhaps something like this:
#!/usr/bin/perl my $string=('data12.csv'); $string=~ s/\D//g; $string = 0 if $string eq ''; print "$string\n";

Replies are listed 'Best First'.
Re^2: How to remove non-numbers from string
by AnomalousMonk (Archbishop) on Jun 21, 2015 at 20:47 UTC

    Or even:

    c:\@Work\Perl\monks>perl -wMstrict -le "my $string = 'data.csv'; $string =~ s/\D//g; $string ||= 0; print qq{'$string'}; " '0'


    Give a man a fish:  <%-(-(-(-<

Re^2: How to remove non-numbers from string
by kgherman (Novice) on Jun 21, 2015 at 20:44 UTC
    hum... I wonder why didn't I think about this way? Thank you, works great!