Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: Regex to Array lookup question

by Marshall (Abbot)
on Apr 07, 2020 at 05:45 UTC ( #11115151=note: print w/replies, xml ) Need Help??

in reply to Re^2: Regex to Array lookup question
in thread Regex to Array lookup question

When using a __DATA__ segment, you can't use an __END__ segment. Delete that __END__ line that you added. This is the reason that I embedded the output as a Perldoc instead of attaching the output after an __END__ segment.

Also, add "use strict;" to the code like I did. This will help you as you experiment with the code.

Update: this error: "JSON error at line 110, byte 2639/2647: Unexpected character '_' parsing initial state: expecting whitespace: 'n', '\r', '\t', ' ' at ./ line 8, <DATA> line 1." Is complaining about the first underscore in the __END__ line that you added. The result is invalid JSON syntax. Error messages are often hard to figure out.

Replies are listed 'Best First'.
Re^4: Regex to Array lookup question
by Aldebaran (Deacon) on Apr 07, 2020 at 06:28 UTC

    My mistake:

    $ ./ URL =,20/tsra_sct,40?s +ize=medium tsra_sct => 'Thunderstorm (medium cloud cover)' URL =,30/tsra_hi,3 +0?size=medium tsra_hi => 'Thunderstorm (low cloud cover)' URL =,30/rain_sh +owers?size=medium rain_showers => 'Rain showers (high cloud cover)' URL = bkn => 'Mostly cloudy' $
      This is more like a "boo-boo" than a mistake. I am glad that you can run my code now. Let the Monks know how to help you further.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2020-06-01 06:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found