Am rather a beginner at perl and was wondering how to do the following. I've
read in a text file containing a list of file paths. the list is read in to
an array. I want to scan through the whole array and remove all lines with
end as .txt and .scc. i.e remove that element in the array. My file list
looks like this:
D:\Liberate\Connect\app\pages\servicemanager\splash.gif
D:\Liberate\Connect\app\pages\servicemanager\splash.html
D:\Liberate\Connect\app\pages\servicemanager\vssver.scc
D:\Liberate\Connect\app\pages\servicemanager\sounds\enter.wav
D:\Liberate\Connect\app\pages\servicemanager\sounds\key.wav
D:\Liberate\Connect\app\pages\servicemanager\sounds\vssver.scc
and my code thus far is:
#\usr\local\bin\perl
$file = 'flashimage.txt'; # Name the file
open(INFO, $file); # Open the file
@lines = <INFO>; # Read it into an array
close(INFO); # Close the file
foreach $eachline (@lines) {
$eachline =~ s/scc//g
}
print @lines;