Help for this page

Select Code to Download


  1. or download this
    use constant NAME => "abc";
    # read some user input
    ...
    # I need to check if the input string contains my constant
    # Something like the following is what I need:
    if ($input =~ /NAME/) { print "Matched!"; }
    
  2. or download this
    my $name = NAME;
    if ($input =~ /$name/) { ... }