http://www.perlmonks.org?node_id=1059344


in reply to syntax question

Assuming that you're in some loop and the next command is how you "exclude a field ending in X", you have the right idea. The parentheses around the regular expression are not needed. I would usually write that as next if $fld0 =~ /X$/;, but if ($fld0 =~ /X$/) { next; } is effectively the same.

Another option: next if substr($fld0,-1,1) eq "X"; (substr)