Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Parse data from a line to get 2 variables

by Anonymous Monk
on May 13, 2006 at 01:41 UTC ( #549156=note: print w/replies, xml ) Need Help??


in reply to Re^4: Parse data from a line to get 2 variables
in thread Parse data from a line to get 2 variables


\S+ matches one or more non-whitespace characters
\s+ matches one or more whitespace chars

So

my ($lot,$prod) = m/(\S+)\s+(\S+)/;

is matching the lotnumber and putting it into $lot,
matching the tab and throwing it away,
then matching the product code and putting it into $prod

  • Comment on Re^5: Parse data from a line to get 2 variables

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://549156]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2022-05-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?