Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 perusing the Monastery: (5)
As of 2014-07-12 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (241 votes), past polls