#!/usr/bin/perl -w use strict; use warnings; my$str = 'perl_script'; my$length = length $str; if ($str eq 'perl_script') { print 'both strings are same'; } elsif($length = 8){ print "the given string has 8 characters"; } elsif($length >8){ print "the given string has more that 8 characters"; } else{ print"Doen't matched both strings"; }