in reply to Re: Help with redirecting Find::File results
in thread Help with redirecting Find::File results

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.

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

Replies are listed 'Best First'.
Re^3: Help with redirecting Find::File results
by PodMaster (Abbot) on Oct 28, 2004 at 05:14 UTC
Re^3: Help with redirecting Find::File results
by chromatic (Archbishop) on Oct 29, 2004 at 01:44 UTC

    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 !$?; }