There’s a third alternative using uc :
#23456789_123456789_123456789_123456789_12
perl -nlE'65^unpack"%c*","?"x30&uc or say'
Those spaces around or are annoying... Let's use something else to express conditionnal printing. With -p, x= does the job:
#23456789_123456789_123456789_123456789_1
perl -ple'$_ x=65==unpack"%c*","?"x30&uc'
While we're looking at those switches... Why the -l? Removing it and adding ord("\n") (10) to the target (65) shaves another stroke:
#23456789_123456789_123456789_123456789_
perl -pe'$_ x=75=~unpack"%c*","?"x30&uc'
There's a much shorter solution using a 6-bit checksum. The problem is that it comes up with a few false positives (words whose value is 1, 129, 193...):
#23456789_123456789_123456789_1234
perl -ple'$_ x=1==unpack"%6c*",uc'
perl -pe'$_ x=11==unpack"%6c*",uc'
Using a 5-bit checksum removes the need for uc, but brings even more false positives:
#23456789_123456789_123456789_1
perl -ple'$_ x=1==unpack"%5c*"'
perl -pe'$_ x=11==unpack"%5c*"'
perl -nlE'1^unpack"%5c*"or say'
perl -nE'11^unpack"%5c*"or say'
|