Point of this exercise is to open a folder, open a file, extract some info and output it. I've got the folder open, but die-ing on file opening. Don't understand why. Do you?<br><br>Also, where can I change my profile settings from "programmer" to "technical user"? (or should it be "wannabe" ;-)!<br><br>Here's the code so far:<br><br>#!/usr/local/bin/perl -w<br>#------------------------<br># Purpose: Open a folder, print file names from the folder, <br># open each file and extract dates in all possible date formats, <br># print each date along with name of file it came from. Learn the <br># next thingie in Perl to open the file of enlightenment <br># -----------------------<br><br>$dir = 'c:/windows/desktop/DATE'; #temporary assignment to directory DATE<br><br>opendir DIR, $dir or die "Error: could not open directory $dir $!\n" ; #open or die<br><br>while ($file = readdir DIR) { #read files in directory<br> next if $file=~/^\./; #avoid . and ..<br> print "Found a file: $file\n"; #check by printing directory file names<br><br>@file=$file;<br><br>foreach $file (@file) {<br> open FILE or die "Error: could not open file $file in directory $dir $!\n" ; #open or die<br><br>print "Here's a file: $file"; #check by printing directory file names<br><br> @words = split /\s+/; #split words in file<br><br> foreach $words(@words){ #search each token<br><br> if ($words =~/(\d{1,4}¦$months)\/¦\-\d{1,4}¦(\d{1,4}¦$months)\/¦\-\d{1,4}/) <br> <br> #a numeric or text month, one or two digit day, 2 or 4 digit year with backslash or dash <br><br> {print "$file\t$words\n";} #print each match per file, tabbed<br><br> }<br> }<br>}<br><br>