Update: To reduce it even more:#!/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;
#!/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';
In reply to Re: Comparing Strings
by Khen1950fx
in thread Comparing Strings
by maheshkumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |