Greetings, The second piece of code should look for "***** InTune " somewhere in the first line of the file if it does not, it should unlink the bad file and fire off the error, it seems to happen all the time regardless of the match.
Two quick questions here: I can't see why I am getting this error : Use of uninitialized value in print #!/usr/bin/perl -w # code test use strict; my $str = "***** InTune "; ($str) = ($str =~ m/(\*{5} InTune)/); print $str; __END__ is there a way to add a -e to check to see if we have a file to unlink ? # Check to make sure it is an inTune File open (FH, UPLOAD_DIR . "/$file") || error( $q, "Error reading $file for test : $!" ); while(<FH>){ if ($_ !~ /\*{5} InTune/){ unlink( UPLOAD_DIR . "/$file") or error( $q, "Problem deleting file $!"); error( $q, "The file you uploaded is not an inTune file. Only an inTune export file will be accepted." ); } last; } close FH; Thanks, Dave (kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX, USA) Visit my schedule page for up to the minute performance info: <http://www.coraconnection.com/cgi-bin/schedule.pl> ============================================== Cora Connection: Your West African Music Source Resources, Recordings, Instruments & More! <http://www.coraconnection.com/> ============================================== -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>