#!/usr/bin/env perl -l use strict; use warnings; my $str = 'perl_script'; my $length = length $str; if ($str eq 'perl_script') { print 'Strings are the same.'; if ($length == 8) { print 'Length is exactly 8.'; } elsif ($length > 8) { print 'Length is more than 8.'; } else { print 'Length is less than 8.'; } } else { print 'Strings are different.'; } #### Strings are the same. Length is more than 8.