Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: When is strict 'refs triggered

by tobyink (Canon)
on May 23, 2020 at 06:40 UTC ( [id://11117142]=note: print w/replies, xml ) Need Help??


in reply to When is strict 'refs triggered

This bit is weird and suggests you don't know how lexical variables work:

my $transseqchk->{transchk}=

And when you combine it with this, it suggests you don't fully understand the difference between hashes and hashrefs:

my %transseqchk;

To answer the question in the title, strict refs is triggered when you try to treat a non-reference (such as a string) as a reference.

perl -E'use strict; my $x = "foo"; $$x' perl -E'use strict; my $x = "foo"; @$x' perl -E'use strict; my $x = "foo"; %$x' perl -E'use strict; my $x = "foo"; &$x' perl -E'use strict; my $x = "foo"; $x->[0]' perl -E'use strict; my $x = "foo"; $x->{bar}' perl -E'use strict; my $x = "foo"; $x->()'

Replies are listed 'Best First'.
Re^2: When is strict 'refs triggered
by redtux (Sexton) on Jun 10, 2020 at 14:09 UTC
    re my $transseqchk->{transchk}=, I was using auto-vivification for $transseqchk. the %transseqchk is old code which I've deleted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found