in reply to Filename Parsing

Keep it nice and simple...
use strict; my %fnames; # use a hash to eliminate duplicates while (<DATA>) { if (/^(\w+_\d+)_\d+\w+/) { $fnames{$1} = 1; } } foreach (keys %fnames) { print "$_\n"; } __DATA__ smith_13_503_de7.p smith_13_502_de7.v jones_104_503_de7.p jones_104_502_de7.v

Replies are listed 'Best First'.
Re: Re: Filename Parsing
by The_Jesus (Novice) on Oct 03, 2003 at 15:32 UTC
    Thank you works great!