in reply to "2" | "8" = ":" and 2|8=10

I cannot distinguish between an integer and a string. Is there a way?

You shouldn't need to discover whether a scalar actually contains the number or its string representation. The logic of your program will define which type of bitwise operation you want, and you can easily force this to be used.

If you want to do integer bitwise operation:

my $res = 0+$x | 0+$y;

If you want stringy bitwise use:

my $res = ''.$x | ''.$y;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.