Hello Athanasiis,
Thank you for your time and effort. It does help me to understand, a few things. But still I have not figure out how to solve my problem. Or let me put it this way, I have not figure it out why id3info produces different output than mine. I still can not understand, where I am going wrong and I add one extra bit. Well in case that $00 was adding the extra bit, by applying chop($flags) should have done the job but still the same problem.
Thank you again for your time and effort.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
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,
| [reply] [d/l] [select] |
| [reply] [d/l] [select] |