fork download
  1. #!/usr/bin/perl
  2.  
  3. my $pattern = "mkdir a &";
  4. if ($pattern =~ /&$/) {
  5. print "Yes, there is a & at the end of the string."
  6. }
Success #stdin #stdout 0s 6056KB
stdin
Standard input is empty
stdout
Yes, there is a & at the end of the string.