Use eq instead of a regex: use warnings; use strict; while (<DATA>) { chomp; print "ERROR $_\n" unless $_ eq 'X'; } __DATA__ X XA XB [download]
use warnings; use strict; while (<DATA>) { chomp; print "ERROR $_\n" unless $_ eq 'X'; } __DATA__ X XA XB [download]
In reply to Re: Check if a variable contains only one letter? by toolic in thread Check if a variable contains only one letter? by Anonymous Monk