my $all = <>; do_something($1) while $all =~ /(\d+)/g;