I have a 4-element array named arr. Each element contains 1 byte of binary data. I need to output these elements in sequence into a file. Currently I am doing this and it works:
print FILE pack ("C", $arr [0]). pack ("C", $arr [1]) . pack ("C", $arr [2]) . pack ("C", $arr [3]);(I have to use pack(), otherwise what is output to the file is the decimal value of the byte in ASCII.)
My question is: is there a better way of doing this?
In reply to Writing the elements of an array to a file by bontchev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |