Re: Perlcritic complains about assignment within conditional

2009-12-17 Thread Steve Bertrand
Peter Scott wrote: > Although it turned out not to be what was going on here, just to address > your subject line' it's not just Perlcritic that will complain about > assignment in a conditional, but also warnings: > > % perl -wle 'print 42 if $x = 0' > Found = in conditional, should be == at -e

Re: being smart about script structure

2009-12-17 Thread Shawn H Corey
Peter Scott wrote: > Neither will you find Perl > programmers enamored of Hungarian notation, for instance. That's because there are few datatypes in Perl but context is everything. It's hard to describe context using Hungarian notation. :) -- Just my 0.0002 million dollars worth, Shaw

Re: being smart about script structure

2009-12-17 Thread Peter Scott
On Wed, 16 Dec 2009 17:47:16 -0600, Bryan R Harris wrote: > Okay, here's one I struggle with often -- is one of these better than > the other? > > ** > A. > if ( isFlat($tire) ) { changeTire($tire); } > > B. > checkFlatAndChangeTireIfNecessa

Re: capture error - the better way?

2009-12-17 Thread Peter Scott
On Wed, 16 Dec 2009 10:09:38 +, Philip Potter wrote: > 2009/12/16 Shlomi Fish : >> On Tuesday 15 Dec 2009 17:14:25 Philip Potter wrote: >>> If evaluating a constant expression results in a runtime exception, >>> that runtime exception must happen at runtime, and not at compile >>> time. In gen

Re: Perlcritic complains about assignment within conditional

2009-12-17 Thread Peter Scott
Although it turned out not to be what was going on here, just to address your subject line' it's not just Perlcritic that will complain about assignment in a conditional, but also warnings: % perl -wle 'print 42 if $x = 0' Found = in conditional, should be == at -e line 1. And of course you sho

Re: Can you please Help perl readdir multiple folders and files with pre same name

2009-12-17 Thread Shlomi Fish
On Thursday 17 Dec 2009 17:07:19 Simphiwe Mkhize wrote: > Please Help > > I have multiple folders want to read trough each folder and search for > certian file. I have code which is working fine but does not do what I > want. I dont want to hard code path as it read different folder within You

Can you please Help perl readdir multiple folders and files with pre same name

2009-12-17 Thread Simphiwe Mkhize
Please Help I have multiple folders want to read trough each folder and search for certian file. I have code which is working fine but does not do what I want. I dont want to hard code path as it read different folder within sub get_phone_log { #---