Conditional statement example with regular expressions

#!/usr/bin/perl

$string = "BluE";

if ($string =~ m/^blue$/i || $string =~ m/^green$/i) {
    print "found it";
} else {
    print "didn't find it";
}

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.