A Peek into Pugs Internals #36

Use case

my $obj;
if (/Car=(?:(Ferrari)|(ModelT)(\d\d\d\d))/) {
    if ($1) {
        $obj = Car->new({color => "red", ... });
        ...
    } elsif ($2) {
        $obj = Car->new({color => "black", year => $3});
        ...
    }
}
Copyright © 2006 Gaal Yahas