in reply to Collect numbers without the text

open my $f, '<', 'fname.txt'; my @f = map { /(\d+)/g } <$f>;
voilą! if your file is too big, you should instead:
open my $f, '<', 'fname.txt'; my @f; push @f, /(\d+)/g while <$f>;
[]s, HTH, Massa (κς,πμ,πλ)