Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: How to check lines that start with the same word then delete one of them

by LanX (Archbishop)
on Apr 10, 2020 at 13:26 UTC ( #11115320=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to check lines that start with the same word then delete one of them
in thread How to check lines that start with the same word then delete one of them

Pretty much what I meant, thanks!

Minor nitpick, I'd assign the first match to a normal var.

Special vars like $1 can get overwritten easily by "more code" before seen is set.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^4: How to check lines that start with the same word then delete one of them

Replies are listed 'Best First'.
Re^5: How to check lines that start with the same word then delete one of them
by hippo (Chancellor) on Apr 10, 2020 at 13:38 UTC

    Cool - glad we're in agreement.

    You are quite right about limiting the chances of stomping on $1 and friends, of course. The test script could be polished no doubt but I didn't want to spend/waste time on that before agnes00 confirmed that this does actually solve the problem. The requirements as stated were a little wooly.

      > I didn't want to spend/waste time on that ... The requirements as stated were a little wooly.

      That's why I thanked you for implementing it. :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2020-06-01 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (2 votes). Check out past polls.

    Notices?