I have some pretty technical Q's for something I'm trying to write, if anyone here knows alot of perl let me know and I can try and bore you with what I'm trying to accomplish...
Any perl geeks here?
Collapse
X
-
Re: Any perl geeks here?
Yo Stefhen, a work mate I know is a Perl crack. If you send me your questions and if you are not talking about a boat load of questions, I can forward them to him. Just drop me a PM or E-Mail. -
Re: Any perl geeks here?
i havent tried python yet, want to but havent gotten to it. i'm really liking ruby at the moment. perl regexp's > all though.
where else can you do this?
Code:sub parse_html { foreach (map {$host_files{$_}} sort keys %host_files) { open(HOST_LIST, "<$_"); while(<HOST_LIST>) { chomp; s/(.*?)\..*/$1/; $host = $_; if(open(HOST, sprintf("</webdocs/guts/sysrpt/$host/%04d%02d%02d.html", sub {($_[5]+1900, $_[4]+1, $_[3])}->(localtime(time()-24*60*60))))) { while(<HOST>) { if(/NAME.*cmd58/ .. /cmd59/) { s/<[^>]*>//gs; if(/^dg rootdg/ .. /^Disk group/) { if(/^pl /) { if(/ENABLED/) { s/.*? (.*?) .*/$1/; s/rootdisk-B0//; s/(.*?)-.*/$1/; chomp; push @{$vxprint{$host}}, $_; } } } } } close(HOST); } } close(HOST_LIST); } }
Comment
-
Re: Any perl geeks here?
^^^
Pretty sure that if I could ever figure out what you were trying to do there I could do it in half the number of lines with python and about 10 times more readable (comments??) But then I am pretty biased. Must be a reason so many people use perl. Shame I don't have time to pick anything up at the moment and python has made me super lazy
Also:
Code:import re
Comment
-
Re: Any perl geeks here?
yeah i just hacked that together for something at work and no one else is going to mess with it so i didnt bother to comment it
people rave about python, ive tried a bit to learn but havent yet, i guess maybe because of the whole syntax thing and sensitive indenting was just too different at the time and i didnt pick up on it.
Ruby is pretty cool, it is great how quick I can get things done in so little code and EVERYTHING is an object:
>> "3".class
=> String
>> "3".to_i
=> 3
>> "3".to_i.class
=> FixnumComment
-
[ms] Statistics
Collapse
Topics: 191,718
Posts: 1,236,864
Members: 53,129
Active Members: 73
Welcome to our newest member, newiron009.
Comment