in reply to Suggestions
This converts all the data lines from a filehandle (I use DATA) to 7bit binary strings.
while (my $line = <DATA>){ chomp $line; for (split//, $line) { print unpack "b7", $_; } print "\n"; } __DATA__ Hello World! -JAPH
First we chomp off the newline. Then we get to the guts of it. How this works is the split//, $line part splits our line on null characters which generates an array/list which contains all the characters in line with each single character stored as an element of this array. The for iterates over this array and assigns each element to the magical $_ variable. We then use unpack to generate our bitstring. The "b7" specifies a 7 bit template which is sufficient for the ASCII char set. We then print each char (now a 7bit bitstring)in turn. We need to print a newline to maintain our file structure
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|