in reply to Comparing Strings

I removed the if-else. This is easier on my eyes:).
#!/usr/bin/perl -l use autodie; use strict qw/refs/; use warnings FATAL => 'all'; print "Enter a word: "; my $str1 = <STDIN>; my $str2 = 'Mahesh'; chomp $str1; print "Match" if $str1 eq $str2; print "No match" unless $str1 eq $str2;
Update: To reduce it even more:
#!/usr/bin/perl -l use strict; use warnings; print "Enter a word: "; my $str1 = <STDIN>; my $str2 = 'Mahesh'; chomp $str1; print $str1 eq $str2 ? 'Match' : 'No match';

Replies are listed 'Best First'.
Re^2: Comparing Strings
by AnomalousMonk (Archbishop) on Jun 24, 2012 at 20:24 UTC

        use strict qw/refs/;
        use warnings FATAL => 'all';

    Just out of curiosity: Why do you avoid enabling all strictures, but then escalate all warnings to fatality?