in reply to Re^2: How to create a DNS message in perl?
in thread How to create a DNS message in perl?
But how can can i convert $QTYPE=23 to the hexa value of 2 octets which is '0023'
Wrong question.
You need to learn how to store 2316 into $QTYPE. Right now, you are storing 2310, a completely different number.
$QTYPE = 0x23; # 35
If you're starting with a string, you can use hex or oct.
$QTYPE = hex('23'); # 35 $QTYPE = oct('0x23'); # 35
So is there any function in perl which directly convert the domain name into the required hexa format
There's no builtin function. I've specified the format (from which a solution is easily derived using split, length, and pack 'C') in an earlier post. Furthermore, someone gave you the name of a module that supposedly does the work for you.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How to create a DNS message in perl?
by sanjay nayak (Sexton) on Jul 30, 2008 at 12:28 UTC | |
by ikegami (Patriarch) on Jul 30, 2008 at 20:11 UTC | |
by sanjay nayak (Sexton) on Jul 31, 2008 at 06:40 UTC |