Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: RegExp, grabbing first name

by hippo (Bishop)
on Feb 25, 2016 at 23:50 UTC ( [id://1156153]=note: print w/replies, xml ) Need Help??


in reply to Re^2: RegExp, grabbing first name
in thread RegExp, grabbing first name

But I don't have my data in a hash

The hash is used as a clear and concise way to list both the data which you have (the keys) with the results which you want (the values) and to test that an operation on the former yields the latter. There is no need for you to use a hash in your implementation. See How to ask better questions using Test::More and sample data for a recent discussion on why using a test in a question is a good idea and why (to my mind) using a test in an answer is equally beneficial.

The fact that my example iterates over a list (keys %names) should help you to use a similar list in your own code as do the examples from pod and ExReg.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found