fork(1) download
print "================== /g ====================\n";
{
    my $txt = "abc3de";
    while( $txt =~ /\G[a-z]/g )
    {
        print "$&";
    }
    while( $txt =~ /\G./g )
    {
        print "$&";
    }
}
print "\n================== /gc ===================\n";
{
    my $txt = "abc3de";
    while( $txt =~ /\G[a-z]/gc )
    {
        print "$&";
    }
    while( $txt =~ /\G./g )
    {
        print "$&";
    }
}
print "\n================== done ==================\n";
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
================== /g ====================
abcabc3de
================== /gc ===================
abc3de
================== done ==================