> (my $orders_dir) > File 121212.TXT ...contains > 12345.html <spaces> CR > 12346.html <spaces> CR > > Here is the piece I'm having trouble w/ > > foreach my $html (@htmls) { > if ($html =~ /^($_)\s*/) { > my $msg = MIME::Lite->new (
Where does it fail? if ($html =~ /^($_)\s*/) $_ has no value since you forloop is assigning to $html so I am not sure what you are trying to match with ($_) looking at your sample data this would work if ( $html =~ /^(\d+\.html)/ ){ my $filename = $1; } filename would contain your files. ^ Beg line \d+ any number of digits (0-9) \. followed by a period html followed by html the () capture the match into $1. HTH, Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>