Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Rewrite for "How to get ($1, $2, ...)?

by ferreira (Chaplain)
on Feb 16, 2007 at 18:31 UTC ( #600499=note: print w/replies, xml ) Need Help??

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;
        }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://600499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2019-07-15 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?