hara said:
Suppose i have got a hex number
There is no such thing but for the sake of argument let's assume you meant a
number in hexadezimal format
i.e $hex
i want to concatenate it with "E0000000"
that is if hex number is 00200000
That is not a number in hexadezimal but in octal format. If you want
hexadezimal format then use 0x as the prefix.
See "perldoc perldata"
then i want the result to be "E0200000"
???
If I concatenate "E0000000" with "00200000" then I would expect to get
""E000000000200000" (or something similar after figuring out what you
actually mean with all those contradicting numeral systems).
Did you mean "add" instead of "concatenate" by chance?
Step one: figure out which numeral system you want to use AND THEN USE THE
PROPER PREFIX.
Step two: figure out which operation you want to perform AND THEN USE IT
(obviously it is not concatenation)
Step three: printf() the result using the correct printf format specifier
for your desired numeral system
Join is giving a garbage value
If i am doing 00200000 | E0000000
then also getting garbage value.
That's not surprising. You are starting out with garbage (00200000 is not
hex but octal, "E0000000" is a string with a numerical value of 0). I cannot
say if a bitwise is what you are looking for. To me it looks more like a
plain addition, but of course I may be wrong.
And join is just concatenation on steroids.
Kindly help me getting it right.
Then what about if FINALLY you follow the posting guidelines and post some
real Perl code? How do you expect us to help you when keep throwing tiny,
unrelated code fragments at us which contradict not only each other but also
what you are writing in clear text.
jue