Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^7: Entity statistics

by choroba (Cardinal)
on Nov 12, 2024 at 16:55 UTC ( [id://11162662]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Entity statistics
in thread Entity statistics

> I get the following error

It's not an error, it's a warning. You can easily tell it from the W in the diagnostics output: "(W uninitialized)".

The most probable reason is some of the regexes didn't match anything, so their corresponding element in the array is undefined. You can print 0 instead of an undefined value using the defined-or operator //:

print {$out} "$regex:\t\t", $tally[$i] // 0, "\n";
or you can prepopulate the array with zeros:
my @tally = (0) x @regexes;

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2026-02-09 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.