The built-in function chop removes one character from the end of a string, not from the beginning.
Here are a couple of observations regarding variable initialisation in the OP:
This line:
my ( $lines , $type , $major_version , $revision_number , $flags , $si +ze , $extended_size , $number_flags , $extended_flags ) = "\0";
initialises $lines to \0, leaving $type, $major_version, etc., undefined. Maybe this is what you intended; but, if you want to initialise all the variables to null, you need = ("\0") x 9;.
This line:
my @word = "\0" x 5;
initialises the array @word to contain a single element, namely a string consisting of 5 consecutive null characters. If you want an array containing five elements, each a single null character, you need:
my @word = ("\0") x 5;
By the way, I think you should give careful attention to the example code provided by Tux, below. By studying this code you will gain valuable insight into how your own coding style can be improved.
Update: Fixed typo, thanks to Tux.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^5: ID3 tag version 2.4.0 Pack and Unpack (text encoding byte)
by Athanasius
in thread ID3 tag version 2.4.0 Pack and Unpack
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |