$s = <stdin>;
foreach ($s) {
print;
}
Running the code simply outputs the input:
[perl] perl helloworld.pl hello world hello world [perl]
Simply replacing print with say doesn't work. The use feature statement is required for the code to run.
use feature ':5.12.4';
$s = <STDIN>;
foreach ($s) {
say;
}