Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re^4: Cleaning the Log

by demerphq (Chancellor)
on Sep 03, 2002 at 10:07 UTC ( [id://194717]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Cleaning the Log
in thread Cleaning the Log

Fails on
A{B}{BS}S}bout
:-)

Yves / DeMerphq
---
Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

Replies are listed 'Best First'.
Re: Re: Re^4: Cleaning the Log
by BrowserUk (Patriarch) on Sep 03, 2002 at 11:43 UTC

    Also the simple degenerate case of the user typing '{BS}', but then, so would any solution that didn't involve modifying the keystroke recorder!


    Well It's better than the Abottoire, but Yorkshire!
      Actually neither my version nor yours had this error.

      The key issue here is that you cant just replace .{BS} with // as this allows other char sequences to "become" a {BS} element. The process of converting {BS} to a \b char and _then_ converting the .\b's resolves this issue.

      But you are correct that ultimately there is no way to recover what was actually _entered_ into the computer without knowing the input rules that applied at the time of entry. Basically IMO this entire task is an interesting game but ultimately a futile one from the POV of actually solving the problem.

      Yves / DeMerphq
      ---
      Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

        Actually, you just brought me to the conclusion that this all was an excercise in futility because - duh, in hindsight - what happens if the user types the literal string {BS}? Whoops.

        Makeshifts last the longest.

Re^6: Cleaning the Log
by Aristotle (Chancellor) on Sep 03, 2002 at 12:54 UTC
    perl -pe's/{BS}/\b/g;1while s/(^|.)\010//' file

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2025-03-24 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (65 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.