in reply to Data length in strings
$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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Data length in strings
by Hofmator (Curate) on Jul 24, 2001 at 15:38 UTC |