in reply to XOR, AND or NAND'ing bitstrings.

Yet another way to do this (the main point is to put "0b" before a bit string to turn it in a number, and then eval. If you don't like those extra ones got from ~, feel free to chop them by doing a substr):
use strict; print "or: ", sprintf("%b", eval("0b$ARGV[0] | 0b$ARGV[1]")), "\n"; print "and: ", sprintf("%b", eval("0b$ARGV[0] & 0b$ARGV[1]")), "\n"; print "xor: ", sprintf("%b", eval("0b$ARGV[0] ^ 0b$ARGV[1]")), "\n"; print "not: ", sprintf("%b", ~eval("0b$ARGV[0]")), "\n"; print "nand: ", sprintf("%b", ~eval("0b$ARGV[0] & 0b$ARGV[1]")), "\n";