[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Some advice on perl: read byte to hex string



On Thu, Sep 21, 2006 at 01:07:01PM +0700, Welly Hartanto wrote:
> Yeah ... Of course more digging for Pearl is absolutely what I need.
> I was just so curious because the same algorithm which is "cross-worked" in
> java and vc++, but not in my <b>first</b> perl script.

The algorithm was fine.  The main reason your initial code produced the
wrong result seems to have been that the hex() function did the opposite
of what you expected.

However, doing it yourself is inefficient and open to errors, such as
using functions which do the opposite of what you intended.  Increasing
your familiarity with the language allows you to choose more efficient
and less error-susceptible, not to mention simpler and clearer,
alternatives.

> I've been interested in Pearl since it can be used either to make a
> "native"
> application and also web.

The same is true of both Java and C/C++.  While I'm a Perl junkie
myself, I have written web-based apps in low-level C and I hear there
are 1 or 2 people out there using Java on the web, too.

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)



Reply to: