Hello everyone,

First, this is a basic problem, but I have looked at it for over an
hour and wasted time.  Now, I'm asking for help.

For some reason nothing is being printed to the MY filehandle. Can
someone see what I'm doing wrong?

#!/usr/bin/perl
                                                                      
+                                                      
use warnings;
use strict;
use File::Find;

find sub {
    return unless -f;
    return unless $_ =~ /.\d+$/;
    print "$_\n";
    #print "$File::Find::name\n";
                                                                      
+                                                      
        open(SD, "$_") or die "can't open $_ $!\n";
        #my $fh = IO::File->new("> /tmp/savedata/new/$_") or die "Coul
+dn't open new for writing: $! \n";
        open(MY, "> /tmp/savedata/new/$_") or die "can't open new $_ $
+!\n";
                                                                      
+                                                      
                my @sd = <SD>;
                foreach (@sd) {
                        if ( $_ =~ /40187378|40187233|40187230|4018722
+9|40187234|40187232|40186526/ ) {
                                #print "match: $_\n";
                                my $line = $_;
                                print MY $line;
                        }
                }
                                                                      
+                                                      
        close MY;
        close SD;
}, ".";


Thanks,
Kevin
-- 
Kevin Old
[EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to