$str = join ' ',<>;
If you just want to slurp all the lines, concatenated (you usually don't want those spaces we just added):
Note the use of local (not my!) to set the special variable $/.{ local $/; # Temporarily set $/=undef: "total slurp mode" $str = <>; # Slurp it all in one go! }
You're still working on your computer, though! So you cannot (or should not) read huge files into memory. Reading huge files into memory is grounds for LARTing on many systems!
How large is `huge' depends on your computer; it's almost certainly well below 2GB, though!
In reply to Re: Data length in strings
by ariels
in thread Data length in strings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |