#!/usr/bin/perl my $fill = "RRREEEPPP"; my $end++; while() { my $line = $_; # $line =~ s/ZAGOR/Björn Stenberg/g; $line =~ s/Ö/\Ö/g; $line =~ s/ö/\ö/g; $line =~ s//\>/g; if($line =~ s/(LINK\((\"([^\"]*)\"))/$fill/) { my $url = $2; $url =~ s/@/\#%40;/g; $url =~ s/=/\#%3D;/g; $url =~ s/&/\&/g; $line =~ s/$fill/LINK\($url/; } print $line; if($line =~ /^ *ENDDATE/) { if($end++ == 15) { last; } } }