in reply to Help with error msg "Useless use..."

A question: do you really need to join your array into a string?

Unless you need your scalar $pms for something else later in your programme, I would suggest doing away with this line:

my $pms = join("\n", @foundfiles) . "\n";

and printing your array directly:

print "$_\n" for @foundfiles; print MYOUTPUT "$_\n" for @foundfiles;

dave

Replies are listed 'Best First'.
Re: Re: Help with error msg "Useless use..."
by Lori713 (Pilgrim) on Sep 15, 2003 at 17:58 UTC
    Good question. I was thinking the join was necessary because it was joining the path info to the new line character. Of course, this just goes to show you what happens when you steal snippets, tinker with them, and just THINK you know how they work! ;-)

    I tried it your way and it works just fine! Thanks for showing me another way (which always adds more dimension to my learning and understanding Perl!).