fork(2) download
  1. print "================== /g ====================\n";
  2. {
  3. my $txt = "abc3de";
  4. while( $txt =~ /\G[a-z]/g )
  5. {
  6. print "$&";
  7. }
  8. while( $txt =~ /\G./g )
  9. {
  10. print "$&";
  11. }
  12. }
  13. print "\n================== /gc ===================\n";
  14. {
  15. my $txt = "abc3de";
  16. while( $txt =~ /\G[a-z]/gc )
  17. {
  18. print "$&";
  19. }
  20. while( $txt =~ /\G./g )
  21. {
  22. print "$&";
  23. }
  24. }
  25. print "\n================== done ==================\n";
  26.  
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
================== /g ====================
abcabc3de
================== /gc ===================
abc3de
================== done ==================