in reply to Re^5: Align given substring(s) in lines
in thread Align given substring(s) in lines

Well said! I think your perspective on strict also depends on your background. If you've done a lot of things in awk before coming to Perl, you'll appreciate why it can be useful not to use strict. But you'll also appreciate the benefits that strict provides. The great thing about Perl is that it allows both strict and no strict and even somewhat strict.

  • Comment on Re^6: Align given substring(s) in lines

Replies are listed 'Best First'.
Re^7: Align given substring(s) in lines
by haukex (Archbishop) on Apr 29, 2021 at 14:10 UTC
    If you've done a lot of things in awk before coming to Perl, you'll appreciate why it can be useful not to use strict.

    I admit I haven't, but if you mean oneliners, then yes, those are usually written without strict and warnings and it leads to more concise code with its own kind of beauty. At least in my mind, omitting strict and warnings in oneliners is usually acceptable because they are so short that proofreading and testing them is a relatively simple task.

    (OTOH, roughly 95% of the oneliners I post here I actually develop with -wMstrict turned on, only to then remove the switches once I'm satisfied the code works, so it gets shorter and fits on one line. An artifact of this that some might notice is my abuse of $a and $b due to them being exempt from the checks...)

      I meant both one-liners and larger scripts; I find that awk can be used with great success in both ways. Here is a simple markup language implemented in awk, for example. It does approach the border of what is reasonable (and maintainable) awk code, though.
      An artifact of this that some might notice is my abuse of $a and $b due to them being exempt from the checks...

      Clever!