in reply to Re^3: Cannot access HTTP::Response content properly
in thread Cannot access HTTP::Response content properly

Hello All, Thank you so far. I took all your suggestions (e.g. decoded_content(), file handles, variable declarations, etc). It turns out though, that my hunch was right. I should have done an "ls -l" on the file and I would have discovered it was not an empty file. If you hadn't figured out already I am on a Unix/Linux system. Contrary to my original posting I thought I had done a "cat" when in actuality I had done a "more". Funny enough, regardless of whether I decode the content or not, something shows up with the "cat" command but not the "more" command. Also, I am able to edit the file in "vi" and see something. I am still stumped by the output though. Assuming that I know the contents of my file should be two lines of text separated by a newline. For example, "The Cat" and "The Dog" on separate lines:

If I "cat" the file, I get:

The Cat
The Dog

If I "vi" the file, I get:

@^T@^h@^e@^ @^C@^a@^t@^
@^T@^h@^e@^ @^D@^o@^g@^ @^

Just for giggles, I did an "od -c", and I got:

0000000 \0 T \0 h \0 e \0 C \0 a \0 t \0 \n \0 T
0000020 \0 h \0 e \0 D \0 o \0 g \0 \n

So for the $64 million questions, why is this showing up empty when I "more" the file, why is the calling program seeing it as empty as does the "more" command, and what's with these characters?
  • Comment on Re^4: Cannot access HTTP::Response content properly

Replies are listed 'Best First'.
Re^5: Cannot access HTTP::Response content properly
by ikegami (Patriarch) on Nov 03, 2009 at 15:14 UTC
    The file is encoded using UTF-16be