Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using warnings and strict #20

Open
chrstphrchvz opened this issue May 16, 2018 · 1 comment
Open

using warnings and strict #20

chrstphrchvz opened this issue May 16, 2018 · 1 comment

Comments

@chrstphrchvz
Copy link
Collaborator

As I dig further into Perl programming advice, one consensus is that

use warnings;
use strict;

should always be present.

Since these are commented out in most of the files, I'm guessing HSW12 had tried using these at one point. But after attempting to enable these again I quickly found why they were probably left disabled.

Of the hundreds of 'errors' that appear if I try enabling them:

  • Most are regarding the typeglobs used as constants, e.g.:
Variable "$parse_display_regs" is not imported at .\hsw12_pod.pm line 804.
...
Global symbol "$parse_display_regs" requires explicit package name (did you forget to declare "my $parse_display_regs"?) at .\hsw12_pod.pm line 804.

I think Readonly (which is readily available from package managers) should work, whereas use constant has known limitations.

  • Similar errors regarding variables that aren't declared as my or are being declared twice; some of these I already committed fixes for. Some of these are typos/mispellings; these are understandable, and often there is correct spelling in use as well. But for hsw12_asm.pm (which I haven't spent as much time looking through before), I'm wondering if there's an issue where fixing those spelling issues might change the functionality.

Just writing this to document what I'm up to. I'm not stuck yet, but would be curious if this is something that's been looked into before or had encountered issues with.

@hotwolf
Copy link
Owner

hotwolf commented May 27, 2018

Hello Christopher,

"use warning" and "use strict" are just disabled out of laziness. As long as my Perl code was interpreted correctly, I was fine with using the quickest way to implement it.

Regards,
Dirk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants