in reply to Re: Re: Re: Re: Re: Unpack for VMS binary files
in thread Unpack for VMS binary files
Regardless, as I said before, the code you've posted is wrong. (Which is a separate issue) You can't just go throwing a space between the two variables, nor can you just throw them together and hope for the best when a sub is going to decode the data, especially if it's binary data.. Won't work. The subroutine as written takes a single 64 bit quantity encoded as a VMS quadword time, so if that isn't what you have, you'll have problems. The code you wrote there definitely won't do it.
Given the original format, just read in the record and pass it to the subroutine, and it should work fine. If you don't want to do that, then:
will.$unix_time = quad_to_epoch(substr($record, 0, 8));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Re: Unpack for VMS binary files
by maderman (Beadle) on Feb 26, 2003 at 21:05 UTC |