Help for this page

Select Code to Download


  1. or download this
    # return ($1, $2, ...) matched against $s
    sub _groups {
    ...
        }
        return @groups
    }
    
  2. or download this
    if (/$re/mgc) {
        @groups = _groups($_); # ($1, $2, ...)
    }
    
  3. or download this
    Title: The Moor's Last Sigh
    Author: Salman Rushdie
    ...
    Title: The God of Small Things
    Author: Arundhati Roy
    Publisher: Bar
    
  4. or download this
    my $text = THE EXAMPLE TEXT ABOVE ...
    my $re_title = qr/Title: (.*?)$/;
    ...
            $book{title} = $1;
        }
        ...
    
  5. or download this
        if (@groups = $text =~ /Title: (.*?)$/mgc) {
            $book{title} = $1;
        }