in reply to Re^3: turn off strict for production code
in thread turn off strict for production code

In any case, I'd rather find this error definitely, rather than have the program fail in weird and unpredictable ways.
Using symbolic references is bad form, but it doesn't necessarily mean there's a bug to be found.
  • Comment on Re^4: turn off strict for production code

Replies are listed 'Best First'.
Re^5: turn off strict for production code
by ikegami (Patriarch) on Sep 12, 2005 at 16:14 UTC

    That's true in the general case, but in blahblahblah's case, he specifically called them errors. I was providing help to blahblahblah, not making a general comment.

    In general, it's probably a good idea to explicitely state no strict 'refs' when using symbolic references. no strict 'refs' could be applied to the whole file, but if possible, it should be localized. For example:

    my $ref = do { no strict 'refs'; \*{$sym} };
      Did he call them errors because they produced incorrect results when run without 'use strict', or did he call them errors because when 'use strict' is in force, the program dies with messages like...
      Can't use string ("joe") as a SCALAR ref while "strict refs" in use at ./refs.pl line 6.
        Why would he want strict on in dev if he was using sym refs intentionally? Anyway, you should be asking him, not me.