in reply to Re: Writing the elements of an array to a file
in thread Writing the elements of an array to a file
Thanks!
Using a quantifier did the trick; I didn't know that using pack() this way was possible.
The documentation suggests that the quantifier should be surrounded by square brackets, as in pack ("C[4]", @arr)? I guess it doesn't matter.
Not sure I understand your remark about the binary data. The elements are the result of some bit-wise operations on data. Perl keeps them in its internal representation of numbers; I just want them output as binary data (bytes). If I don't use pack(), Perl just outputs them as it would output any number by default - as a decimal number in ASCII format, which isn't what I want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Writing the elements of an array to a file
by Athanasius (Archbishop) on Aug 31, 2015 at 15:56 UTC | |
|
Re^3: Writing the elements of an array to a file
by AnomalousMonk (Archbishop) on Aug 31, 2015 at 17:22 UTC | |
|
Re^3: Writing the elements of an array to a file
by choroba (Cardinal) on Aug 31, 2015 at 15:55 UTC |