PERL Tutorial Example: Use of if-else control structure in perl

PERL Tutorial Example: Use of if-else control structure in perl

PERL Example Base Tutorial: Use of if-else control structure in perl
 

create a file named "perl-tutorial-example-if-else.pl" then copy and paste the below code:

$CanYou = "Yes";

print "Can you program in PERL? - ";

if($CanYou eq "Yes")
{
 print "Yes i can";
}
else
{
 print "Sorry boss!!! i don't/can't";
}
 

PERL Example Base Tutorial: Use of if-else control structure in perl description

 Now run the program (perl-tutorial-example-if-else.pl) from command prompt & get the result as desired:
 

PERL Tutorial Example: Use of if-else control structure in perl - output in the command prompt

The result in the windows command prompt

No comments:

Post a Comment

leave your comments here..