#!/usr/bin/perl -w use strict; use warnings; for (my $i = 1; $i <= 60; $i++) { sleep 1; print "$i\n"; } #### #!/usr/bin/perl -w use strict; use warnings; my $cmd = "proc1.pl"; open(my $pipefh, "$cmd |") or die "Unable to pipe to command '$cmd' ($!)\n"; my $out; while ($out = <$pipefh>) { print $out; } #### #!/usr/bin/perl -w use strict; use warnings; $| = 1; for (my $i = 1; $i <= 60; $i++) { sleep 1; print "$i\n"; }