Now that you've added code...
Well, that's not going to work. Unless you've altered $/, <$inputfile> will process the input line by line. And grep will return all lines that have ".txt" anywhere (possibly several times) in the line.
HTML files aren't typically too big to slurp. One problem with file names is that there are a lot of troublesome characters that are allowed. Your sample data doesn't seem to have any space characters embedded in file names, so maybe you could give this a shot:
local $/ = undef; my $input = <$inputfile>; my( @txtFiles ) = $input =~ m/\s(\S+\.txt)\s/g;
It's always fragile to deal with HTML using regular expressions, and also fragile to try to detect filenames using regular expressions, so test thoroughly.
Dave
In reply to Re: Get a list of all txt file names listed in a html file
by davido
in thread Get a list of all txt file names listed in a html file
by francisxavier1234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |