Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: More on hex pack/unpack

by Corion (Patriarch)
on Jun 26, 2000 at 16:29 UTC ( [id://19873]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to More on hex pack/unpack

Egads - httptech is right - BBQs file is truncated at the first 0x1A character. Maybe using binmode() would be a good idea. I always use binmode whenever I open binary files, even on operating systems that don't claim to need it...

(0x1A is ^Z (EOF) under DOS, Win32 and the like and messes up reading from binary files, that's why you need binmode() for those files.)

Replies are listed 'Best First'.
RE: Re: More on hex pack/unpack
by Ovid (Cardinal) on Jun 26, 2000 at 18:28 UTC
    Corion, ^Z does more than just mess up reading from binary files. Consider the following code (I know it's nonsense, but bear with me):
    #/usr/bin/perl use CGI; my $query = new CGI; print "Where did this line go?\n";
    That code will work fine on linux, but in Active State Perl on my Windows box, that last line will never appear if I run it from the command line (admittedly, this might happen in all WinPerl versions). You can imagine my fun in debugging that.

    What's going on is that when I instantiate a new CGI object, I have to enter name=value pairs in offline mode. Then I press ^Z to stop that. Nothing else prints until I print a newline! (I've tried $| = 1 to no avail).

    Needless to say, this has made my life hell when I've debugged CGI scripts and forgotten about this little "feature".

    Update: To make matters worse, this feature appears to be intermittant. Every once in a while, with no code changes, "Where did this line go?" will appear.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19873]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.