,
*.htm, *.html, *.gif, *.jpeg.
. script *.html , *.htm, "htm". .
: , , , .
: .
:
use strict;
use warnings;
if ( $#ARGV != 1 ) {
print
"Incorrect number of arguments.\nArguments: Text_LinkFile, Output_File\n";
die $!;
}
open FILE_LINKS, $ARGV[0] or die $!;
open FILE_RESULT, ">$ARGV[1]" or die $!;
my @Links;
foreach (<FILE_LINKS>) {
my @tempArray;
my (@Matches) =( $_ =~ m/((https?|ftp):\/\/[^\s]+\.(html?|gif|jpe?g))/g );
for ( my $i = 0 ; $i < $#Matches ; $i += 3 ) {
push( @Links, $Matches[$i] );
}
}
print FILE_RESULT join( "\n", @Links );
:
http:
http: