Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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?
[chacham]: Chlorine Trifluoride

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (None)
    As of 2017-04-28 11:22 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      I'm a fool:











      Results (521 votes). Check out past polls.