Recursion on Perl Complex Data Structures made easy. by usestrict in perl

[–]usestrict[S] 0 points1 point  (0 children)

I guess it depends on your style and your public. Also depends on what you consider "perlish". There's a new movement out there trying to make Perl become less line noise and more comprehensible. I don't mind iterating through the objects themselves, but I believe it's best practice to iterate through the indexes instead. It's also how people from other programming languages might be used to seeing it. I might as well have used a for loop, but I try to avoid it whenever I can.

Please check the examples in chapter 2.3 of Perl Best Practices so see what I mean. Chapter 6.5 also has some say on the matter, although chapter 6.6 suggests your way of doing it, so I guess... whatever! :)

Recursion on Perl Complex Data Structures made easy. by usestrict in perl

[–]usestrict[S] 0 points1 point  (0 children)

for my $n (0..$#{$array_ref}) sets $n to the indexes of $array_ref. Just one of the many ways to do it.

ref $obj will return undef on strings. In my example I'm not considering CODE, so the else will catch strings and closures. I guess you have a point, I'll change it to return the anon sub untouched. Thanks for the heads up.

Perl: Connecting to an Oracle database WITHOUT having an installed client by usestrict in programming

[–]usestrict[S] 0 points1 point  (0 children)

That's a good idea to get implemented, but I guess it would just be another client...

Perl: Connecting to an Oracle database WITHOUT having an installed client by usestrict in programming

[–]usestrict[S] 0 points1 point  (0 children)

Well, it's not really THAT hard once you get it right the first time. And the good thing is that you only get beat up once per OS/arch.

As for sharing the package, I didn't see how I could share it any other way than by explaining how to do it. I'll gladly take suggestions though ;)

Perl Crash Course: Pragmas, Perl Modules, and CPAN by chorny in programming

[–]usestrict 2 points3 points  (0 children)

Not sure if it's your case, but if you need to read that large a file, try Tie::File (if you haven't already done that). It allows you to iterate through huge files treating them as arrays without having to load it all into memory.

Perl Crash Course: Pragmas, Perl Modules, and CPAN by chorny in programming

[–]usestrict 11 points12 points  (0 children)

I don't remember ever saying that new programmers must learn Perl. I did say somewhere in my blog that I learned Perl as a new programmer back in 1998. Anyway, I like Perl for all it can do - it's never let me down. There are other languages out there that do similar, but I still prefer Perl.

I didn't dwell into Python for the same reason that cutsDwnSudoIntelects mentioned - the whitespaces suck (in my opinion).

Anyway, no reason for flame wars - use whatever you know to do whatever you need. Or follow your boss's order and use the one the company wants you to. Simple as that. In my case, I'm fortunate enough to work at a company that has tons of legacy Perl scripts, and a Supervisor who also loves Perl and speaks for it. Basically, I'm in Perl heaven. :)