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