my $file = 'books/bookLIST.txt'; open my $info, $file or die "Could not open $file: $!"; while(my $line = <$info>) { foreach ($line) { chop; @vlinks = split(/:/,$_) ; print "$vlinks[0]$vlinks[2]$vlinks[3]" } } # each line in the text file is as follows: # Title of Book:title_of_book::Author's Name