in reply to Re: Subroutines within if statements
in thread Subroutines within if statements

chomp isn't needed if you use "$" in your regexp.

Conversely, "\z" is sufficient if chomp is used.