You're trying to select out of a list those items that match a certain criterion. Why not use the perl built-in that means "select those items out of the list that match this"?
Namely, grep:
use LWP; my $browser = LWP::UserAgent->new(); @links = grep { my $response = $browser->head($_); $response->content_type =~ m[^text/(html|plain)$]} @links; foreach (@links) { print "$_\n"; }
If you wanted to, you don't even need the "response" variable.
Note that you should probably also include the types text/xml and application/xhtml+xml in your list of what types are "text". (Servers should be serving xhtml documents as application/xhtml+xml these days)
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
In reply to Re: Checking URL's and deleting element arrays without HTML
by fizbin
in thread Checking URL's and deleting element arrays without HTML
by lampros21_7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |