On Jun 15, Rod Za said: >I am trying to read a binary file (HP-PCL file >(windows printer)) to count the number of pages and >copies.
You probably want to look at the unpack() function, which allows you to convert binary data into the stuff it represents. For instance, if you have read a string from a file that contains two signed longs and an unsigned short, you can get those numeric values like so: ($long_1, $long_2, $short) = unpack "llS", $string; >I got a C code that works good - but i want to do that >in Perl to learn. If you showed us relevant portions of the C code, we could help you in the translation process. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ CPAN ID: PINYAN [Need a programmer? If you like my work, let me know.] <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>