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

Re^2: use of strict ....

by perlknight (Pilgrim)
on Nov 05, 2006 at 16:01 UTC ( #582320=note: print w/replies, xml ) Need Help??

in reply to Re: use of strict ....
in thread use of strict ....

Than why would it work if I took the "use strict" pragma out? BTW, it's a typal, it should be "CRITICAL". I took a look at, it's a hash, not a method. To clarify, you saying I should use single qoute:
instead of double qoute:
because it intrepret the double qoute as:

Replies are listed 'Best First'.
Re^3: use of strict ....
by imp (Priest) on Nov 05, 2006 at 18:50 UTC
    It doesn't matter if you use single, double, or no quotes. any of these are fine.

    The error was that you forgot the '$', so perl was treating ERRORS as a subroutine invocation, and passing the hashref {"CRITICAL" => undef} as the argument.

    You can verify that behaviour like this:

    use Data::Dumper; sub ERRORS { print "ERRORS called\n"; print Dumper(\@_); } $a = ERRORS{"CRITICAL"};
    Which outputs:
    ERRORS called $VAR1 = [ { 'CRITICAL' => undef } ];
    By the way - in the future instead of saying "strict will puke" it would be better to provide the error.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2023-03-28 22:15 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (70 votes). Check out past polls.