Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Printing Fixed Width Strings and Spliting String into Multiple Lines

by mmartin (Monk)
on Feb 08, 2012 at 14:37 UTC ( #952513=note: print w/ replies, xml ) Need Help??


in reply to Printing Fixed Width Strings and Spliting String into Multiple Lines

Hey Cheesgui, thanks for the reply, I'll give that a try.


Hey oko1, also thanks for the reply. That looks pretty simple to do, I'll definatly give that a try and see how it goes... Thanks.


Hello GrandFather, thanks for the knowledge! I know it was a little messy but it was more or less just a test script that I wrote on the fly just to see how it would work... But I will take your fixes and add them before I transfer it over to the actual script.
You said don't call subs using '&'... Is that just an older way of doing it?
Also, what do you mean by "Don't use prototype subs"..?


Again, thanks everybody for your suggestions!

Thanks,
Matt



Comment on Re: Printing Fixed Width Strings and Spliting String into Multiple Lines
Re^2: Printing Fixed Width Strings and Spliting String into Multiple Lines
by chessgui (Scribe) on Feb 08, 2012 at 15:00 UTC
    Don't use my solution if you just have to print the data. I measured the time and it is slower than doing it with substr.
      Ok cool, no problem... Thanks for the follow-up.


      Thanks,
      Matt

      In the context of anything to do with file I/O the differences you may have measured are likely to be completely irrelevant. Even for lakh (105) lines is the difference likely to be more than a second?

      Benchmarking stuff is often fun, but seldom relevant and very seldom a good reason to prefer one technique over another. It is generally better to make the code clear and maintainable even if there is a small execution speed penalty.

      True laziness is hard work

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-09-23 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (219 votes), past polls