in reply to Help with redirecting Find::File results

It prints to STDOUT. Either run it from the command line and redirect the output or edit it to open a file and print to that file.

  • Comment on Re: Help with redirecting Find::File results

Replies are listed 'Best First'.
Re^2: Help with redirecting Find::File results
by clarkk12 (Initiate) on Oct 27, 2004 at 18:53 UTC
    Where in my code might I "edit it to open a file and print to that file"? I'm new to perl, and have been banging my head at this problem for three days. I know how to use OPEN, I just don't know how to incorporate the code I have.

    Thanks for your input, I'd appreciate any other help you can provide.

      All you have to do is change where you print in doexec(). Suppose you've opened OUTPUT earlier in the program. Change your subroutine to something like:

      sub doexec { my $okCw shift; my @command = @_; # copy so we don't try to s/// aliases to consta +nts for my $word (@command) { $word =~ s#{}#$name#g } if ($ok) { print OUTPUT "@command"; return 0 unless <STDIN> =~ /^y/; } chdir $cwd; #sigh system @command; chdir $File::Find::dir; return !$?; }