Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
When I run a perl program, I just redirect it the normal way
>perl myperlprogram.pl > c:/users/outputs/out.txt
But instead of having to write that path in the command line, can I for example do:
STDOUT path = 'c:/users/outputs/out.txt';
or, if it was possible to just take the path writing in the command, and save it to a variable($)?
And the WHY I want this,
1: Not having to write the SDTOUT path every time I want to run it (After having closed the console)
2: I'm manipulating a lot of data and printing to STDOUT (out.txt), and I want to open it again in the same program, so I can read it again, and do new manipulations
I could push it all into an array, but then I risk running out of memory, so I just print to STDOUT.
(And I'm on Windows 10 (Unfortunately))
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirecting Standard Output inside perl
by haukex (Archbishop) on Nov 09, 2017 at 11:42 UTC | |
|
Re: Redirecting Standard Output inside perl
by hippo (Archbishop) on Nov 09, 2017 at 11:37 UTC | |
by haukex (Archbishop) on Nov 09, 2017 at 17:50 UTC | |
|
Re: Redirecting Standard Output inside perl
by syphilis (Archbishop) on Nov 09, 2017 at 11:53 UTC | |
|
Re: Redirecting Standard Output inside perl
by soonix (Chancellor) on Nov 09, 2017 at 13:15 UTC |