If I just want the STDIN (or any file content) in a variable, and don't like to loop, I usually use this idiom:
my $var; SLURP: { local $/; $var= <>; }
local-izing $/ in a block undefines it and so no $var gets the whole filecontent sithout looping and reassembling it line by line.
In reply to Re^2: Need help with Piping
by Skeeve
in thread Need help with Piping
by moroshko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |