in reply to POSIX-Style character classes

I see two problems:
  1. The mixing of ' and ". Your single quotes around the '42' are the first thing breaking you
  2. The semicolon afte the if { } and before the else
fappy@flux[62] tmp > perl -e 'if( q{42} =~ /[:^digit:]/) {print "42 is + a digit\n"} else {print "42 is not a digit\n"}'; 42 is not a digit

Now the questions remainns, what did you really want to test?