in reply to How to read encrypted data from informix database into a single variable

If you are on Windows, any "\n" in the token might be converted to "\r\n" on output; undefining $/ doesn't fix that. See binmode.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
  • Comment on Re: How to read encrypted data from informix database into a single variable

Replies are listed 'Best First'.
Re^2: How to read encrypted data from informix database into a single variable
by Dev (Initiate) on May 15, 2007 at 13:32 UTC

    No, i am on HP-UX. i think working with hex dump, would be an better option for my problem

    I have taken, hex unload to a file. It contains around 25,000 records. It is not possible to extract a single record (unique keys are such, that i cannot use them at runtime). So now i want to read , 32 bytes of this file ( the hex dump) at a time (in an scalar variable) and skip 2 bytes after - each 32 byte read. can you suggest me a way to do this!

      Well, I'd do something along these lines..
      open my $fh, '<', $file or die "Can't read '$file': $!\n"; while((my $len = read $fh, my $record, 32) == 32) { # do something with $record ... (read $fh, my $junk, 2) == 2 or last; }

      Oh wait... yes, use strict, use warnings :-)

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        I took a hex dump and analysing hex dump, was good idea. It simplified lot of things. I took, unload of encrypted data in an file. And then from byte patterns and using simple read() and seek(), i was able to extract the actual encrypted data bytes as i intended to do. Thank you for your inputs :) . have a nice day