Molnar, Bradley on Tue, 17 Dec 2002 22:50:30 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Perl and a large concatination


Ok, here is my problem, I have been trying for a while to write a script
that runs and based on the current directory, gets a list of all
subdirectories and trys to open a file in each one. 

I know the file name will the 'srquote' so, that isn't a puzzle. I had it
working with several files as long as they were all in the same directory,
but, when I try to open them up in different directories, nothing works.
Here is my single directory version, any ideas anyone? 

thanks 

-brad

#!/usr/sbin/perl

@list=qx{ls};

open(OUTF,">>quote.txt");

flock(OUTF,2);

foreach $entry (@list) {

        $entry =~ tr/'\n'/'\0'/;

        open(INF, $entry) or die("Couldn't open file: $!");


        seek(OUTF,0,2);


              foreach $line (@a){
                    print OUTF "$line";
                    print "$line should be here";
              }


         close(INF);
}

close (OUTF);

print "all done, I think\n\n";
_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug