fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3. use strict;
  4. use warnings;
  5. use constant {
  6. MYSTR => "HGjfslT",
  7. };
  8. my $rec_str = "jfslT";
  9. if (MYSTR =~ /$rec_str/){
  10. print "Matches!";
  11. }
  12. if (MYSTR =~ /^$rec_str$/){
  13. print "This will not match!";
  14. }
  15. $rec_str = "HGjfslT";
  16. if (MYSTR =~ /^$rec_str$/){
  17. print "This will match!";
  18. }
Success #stdin #stdout 0.02s 4808KB
stdin
Standard input is empty
stdout
Matches!This will match!