Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 examining the Monastery: (16)
As of 2014-10-22 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (118 votes), past polls