http://qs321.pair.com?node_id=11116767


in reply to Global symbol "$buidTarget" requires explicit package name

Shit happens and #MeToo. As already mentioned. My very best error was when I typed use Net::SNMP instead of use Net::SMTP many years ago and wondered why the stuff I programmed didn’t work. I wrote an email to the author and received a very friendly reply. You may also consider Pair Programming 🤪😎🦆 Best regards

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Replies are listed 'Best First'.
Re^2: Global symbol "$buidTarget" requires explicit package name
by perlancar (Hermit) on May 14, 2020 at 01:04 UTC
    This gives me an idea for a perl critic policy that warns against declaring package names, subroutine names, variable names, or even hash keys that are prone to misspellings. Wondering what metrics should I use.

      I happened upon this list of common misspellings just the other day. Not convinced that many of them would turn up frequently in code anyway, but it might be one place to start. Maybe different policies for different (natural) languages would be easiest?

      ... metrics ...

      Anything that's spelled. That's what I usually mispel. :)


      Give a man a fish:  <%-{-{-{-<

        See also Mispel as well as Mispelchen.

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      I’m dreaming since years about something like this: use Acme::LapsusLinguae;. If I wrote use Cuke; but meant use Nose; I would get an compile time error with some in-depth explanation.

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Maybe a policy that prohibits variables within a given minimum Levenshtein distance? That might work regardless of language.