is not right. You are trying to read from the output! And print goes by default to STDOUT which in this case is the terminal.my $output = <STDOUT>; print STDOUT "$input";
You need to open a file handle for output like this:
Note that I used "forward slash" instead of "back slash" in the path name. This is completely fine on Windows and will save yourself a lot of pain because "\" means something very special in Perl.open OUT, '>', 'c:/users/lastgen/docs/saved_ppid' or die "unable to open out file $!"; print OUT "something";
Update: If c:/users/lastgen/docs/saved_ppid is a directory then of course you need a target file like: c:/users/lastgen/docs/saved_ppid/ppid.txt. I see stevieb posted while I was typing. That code shows the preferred way for a file handle, using a lexical variable ($wfh) instead of what I did, a bare word (OUT). I did it that way because it might be easier for you to get started with and look at bit more obvious.
In reply to Re: Saving my output to a folder
by Marshall
in thread Saving my output to a folder
by LastGen Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |