in reply to can not flush stdout
You really don't want the -p option here ... from perlrun:#!/usr/bin/perl -p
that's why you need to enter a carriage return. If there are no arguments, the while(<>) idiom will open and read STDIN.-p causes Perl to assume the following loop around your program, which makes it iterate over filename arguments somewhat like sed: LINE: while (<>) { ... # your program goes here } continue { print or die "-p destination: $!\n"; }
|
|---|