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 ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-23 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found