in reply to Best way to do this

I'd probably use split to break paths to directories, and check the last one is numeric:
#!/usr/bin/perl use warnings; use strict; while (my $line = <>) { my $last = ( split m{/}, $line )[-1]; print "$last" if $last =~ /^[0-9]+$/; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Best way to do this
by PetreAdi (Sexton) on Sep 29, 2014 at 08:14 UTC
    Thank you