Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: grep only lines having matched pattern

by Tux (Canon)
on Apr 02, 2021 at 07:43 UTC ( [id://11130708]=note: print w/replies, xml ) Need Help??


in reply to Re^2: grep only lines having matched pattern
in thread grep only lines having matched pattern

Using DATA in example code tells me nothing about the *real* source for the data. It can be a log file or a database or a process that pipes otther sources into a (stream of) single lines of log that have no line endings at all.

To *me* thinking out of that box has caused me to sometime be overprotective and think out of the box. It not only makes many lines in my code show more explicit what the intent is, but it also protects against the other ways in what this data can be supplied (in the future).

Be liberal on the recieving end and be strict on the producing end.

Been there, done that: you have no idea how completely valid CSV files get corrupted by people in the chain that want to "check" the content using a spreadsheet program like Excel and instead of exiting hit "OK" when the program asks them to write the changed data even if the change is just widening the column or changing the font.


Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-24 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found