Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Removing Trailing Whitespace: Multiple ways.

by no_slogan (Deacon)
on May 11, 2001 at 22:43 UTC ( #79809=note: print w/replies, xml ) Need Help??


in reply to Removing Trailing Whitespace: Multiple ways.

Hey, good idea. The unpack solution assumes the length of the string is 8. It'll get a bit slower if it's generalized.

Update: Strike that. unpack "A*" runs faster than unpack "A8" on my machine. Anyone have an idea why that might be?

Benchmark: timing 1000000 iterations of unpack*, unpack8... unpack*: 7 wallclock secs ( 6.65 usr + 0.00 sys = 6.65 CPU) unpack8: 8 wallclock secs ( 7.40 usr + 0.00 sys = 7.40 CPU)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-12-07 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?