Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^7: Align given substring(s) in lines

by haukex (Bishop)
on Apr 29, 2021 at 14:10 UTC ( #11131872=note: print w/replies, xml ) Need Help??


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

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...)

Replies are listed 'Best First'.
Re^8: Align given substring(s) in lines
by johnaj (Acolyte) on Apr 29, 2021 at 15:03 UTC
    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!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2021-09-24 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?