Why is it that you have to "\" out the @ symbol in the regex below?

#!/usr/bin/perl -w
use strict;

opendir(TEMP_DIR, "/home/slutz/temp");
        my @items = grep(/\.BAD/,readdir(TEMP_DIR));
closedir(TEMP_DIR);

my ($file, $line);

foreach $file (@items) {
        print "Going into file : $file\n";
        open(FIN, $file) || warn "cant open the damn file : $!";
        foreach $line ($file){
                if ( $line =~ [EMAIL PROTECTED]/i ) {
                        rename "$file", "bad_email/$file" || die "$!";
                        print "moved file $file to bad_email/$file\n";
                }
        }
        close(FIN);
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to