#!/usr/bin/perl use strict; use warnings; open(LIST,"test"); LI: while () { print $_; my $file=$_; my $f_=$file=~m,.\..,; #print "$f_\n"; # chomp($file); $file=~s#\n##; #print "$file\n"; #next; if ($f_!=1){ next LI; } open(FILER,"/media/sda1/Inetpub/wwwroot/CellSite/$file") or die "can't open $file: $!\n"; my $comm; $comm.=$_ while ; print "$1\n" while ($comm=~/()/gs); #or die "can't print: $_ : $!\n"; close FILER; } close LIST;