Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -l
    
    ...
    chomp $str1;
    print "Match" if $str1 eq $str2;
    print "No match" unless $str1 eq $str2;
    
  2. or download this
    #!/usr/bin/perl -l
    
    ...
    my $str2 = 'Mahesh';
    chomp $str1;
    print $str1 eq $str2 ? 'Match' : 'No match';