Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Optimization tips

by jwkrahn (Abbot)
on Jul 21, 2022 at 19:38 UTC ( [id://11145642]=note: print w/replies, xml ) Need Help??


in reply to Optimization tips

I haven't read through all the code yet, but small tip: use tr/// instead of s/// for single character substitutions.

#Set common delimiter for (@lines2) { s/(\t|;)/\t/g } for (@rejects) { s/(\t|;)/\t/g }
#Set common delimiter tr/\t;/\t/ for @lines2, @rejects;

Replies are listed 'Best First'.
Re^2: Optimization tips
by NERDVANA (Deacon) on Jul 22, 2022 at 02:34 UTC
    More than that, I don't see the reason to replace a tab with a tab. That just wastes time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-26 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found