output: both strings are same. My question is why it doesn't executing elsif. What's the wrong in me code.I'm purely beginner please let us know#!/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"; }
In reply to Perl If and Elsif statement help by rammohan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |