Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Parsing using m//g

by pbeckingham (Parson)
on Sep 25, 2006 at 15:48 UTC ( #574763=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    name1=value1
               name2  = value2
    
  2. or download this
        while (<$input>)
        {
    ...
            # name is in $1, value is in $2
          }
        }
    
  3. or download this
    name1=value1
                 name2 = value2
    ...
     more
    name4=
      value4
    
  4. or download this
        my $contents = do {local $/; <$input>};
        while ($contents =~ / ANSWER_HERE /msg)
        {
          # name is in $1, value is in $2
        }
    
  5. or download this
        my $contents = do {local $/; <$input>};
        my $name = qr/\s* [^=\s]+ \s*/x;
    ...
        {
          # name is in $1, value is in $2
        }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-07-05 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls