For what its worth, I plan to implement some code that will be handling rather large amounts of data, but the data is likely to arrive in aprox 8kb chunks from a filehandle with a sysread call.In that case, let sysread do the work for you.
sysread FILEHANDLE,SCALAR,LENGTH,OFFSETTest script:An OFFSET may be specified to place the read data at some place in the string other than the beginning.
Result:$_ = "Old buffer "; sysread DATA, $_, 4, length; print; __DATA__ datadatadata
Old buffer dataSo this effectively can be used to append.
In reply to Re: simply appending to a scalar...
by bart
in thread simply appending to a scalar...
by abachus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |