what I'm wondering is why when i run the client code via command line - it doesn't work.
but when i run the client code via browser by typing the http://localhost/client.pl, i was able to get the expected value.
Comment on Re^2: apache web service with perl client
So you have a script, which we do not know and which you do not show. And this script seems to produce different output depending on how it was called.
Well, without seeing the relevant code, it's hard to guess (at least for me). Sorry.