in reply to Output redirection using “require” in perl
Use select:
$ cat b.pl #!/usr/bin/env perl use strict; use warnings; print "foo!\n"; $ perl -I. -e 'require "b.pl";' foo! $ perl -I. -e 'open my $o, ">out"; select $o; require "b.pl";' $ cat out foo!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Output redirection using “require” in perl
by bliako (Abbot) on Jul 03, 2018 at 10:24 UTC | |
|
Re^2: Output redirection using “require” in perl
by haukex (Archbishop) on Jul 03, 2018 at 09:58 UTC |