#!/usr/bin/perl $[ = 1; # set array base to 1 print "Enter modifier (e.g ISIN), input file, output file, each separated by a space\n"; $enter = ; @fields = split(/ /,$enter, 99999); #save array of modifiers my @input; use Tie::File; #use Tie:File to get data from xml doc tie @input, 'Tie::File', $fields[2]; @all = join("", @input); #join all of the lines of input together in one string $all = "@all"; @stories = split(/<\?xml/, $all, 99999); #split up the string by story, using the $fields[3]"); #print that new array to a new file print "@matches";