CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate: Re: [FishMonger] perl script to gather dbtable size and memory: Edit Log

Veteran / Moderator

Jul 14, 2013, 8:05 AM

Views: 6552
Re: [FishMonger] perl script to gather dbtable size and memory

That's quite funny, FishMonger.

When I first saw Jeffersno1's original post, I thought that I was going to suggest a solution based on the split function. Then, seeing the two solutions proposed by Bill and you, I decided that there was no point suggesting a third solution.

With Jeffersno1's new post stating that there can be multiple spaces, I looked at the Text::CSV documentation and found it difficult to figure out what this module would do with such input or if it was even possible to change some configuration items to have it do the expected processing. It is also not practical to preprocess the lines to remove the extra spaces (or we would need to preprocess the whole file). So I tought: OK, I'll try to give a a solution modifying Bill's proposal and wait to see if FishMonger has an idea with the CSV module.

Just one small comment on your code: I think it would be slightly simpler (and possibly slightly faster if the file is large) to do the tr/// before the split:

    $row =~ tr/"//d ;  
my @row = split /\s+/, $row;

(This post was edited by Laurent_R on Jul 14, 2013, 8:06 AM)

Edit Log:
Post edited by Laurent_R (Veteran) on Jul 14, 2013, 8:06 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives