fork(3) download
  1. #!/usr/bin/perl
  2. my $string1 = "foobar";
  3. my $string2 = "foo bash";
  4. print "String1 " . $string1 =~ m/foo(?!bar)/g . "\n";
  5. print "String2 " . $string2 =~ m/foo(?!bar)/g . "\n";
Success #stdin #stdout 0s 5632KB
stdin
Standard input is empty
stdout
String1 
String2 1