Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: HTML::TableExtract - ugly - is there better way?

by rtwolfe (Initiate)
on Apr 10, 2017 at 03:31 UTC ( [id://1187543]=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::TableExtract - ugly - is there better way?
in thread HTML::TableExtract - ugly - is there better way?

Thanks NetWallah. Had not heard about Map before. Still a little confusing. Not sure what @$r 'is'. Assume is parsed version of @cols. Need to decode your regex bit by bit. But, thanks so much for fast response.
  • Comment on Re^2: HTML::TableExtract - ugly - is there better way?

Replies are listed 'Best First'.
Re^3: HTML::TableExtract - ugly - is there better way?
by NetWallah (Canon) on Apr 10, 2017 at 03:39 UTC
    This site loves to explain code .. so keep those questions coming.

    @$r is the same as @{ $r } .
    $r is an array-reference ... adding the @{ } around it converts that into an array that can be iterated.

    'map' will "transform" each element of the array, returning a modified array.

    The "transformation" is in the form of a regular-expression - in this case, it extracts "word" type characters (\w), decimals (.) and so on. See perlre.

    The result of this map is stored in the array @cols, which is later printed.

    Hope this helps. If still unclear .. experiment, and come back with more specific questions.

            ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found