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: Regular Expressions: Re: [FishMonger] Recognition of numbers: Edit Log

New User

Sep 1, 2015, 9:06 AM

Views: 20830
Re: [FishMonger] Recognition of numbers

Yes, I did test this in a separate script using several input patterns but could never reproduce this behavior.

As it may happen depending on the incoming data that $params_in->{resolve_until_release} will either not exist or be any string or be the empty string or even undef, I use the construct ($var || '') quite often in comparisons and pattern matching; that will eliminate one additional variable or one if clause or one condition and possibly some brackets for the rest of the conditions. I tend to think that this is easier to read, because it becomes clearer what actual problem is dealt with in the complete if-clause. But I agree that this is arguable.

Anyway, thank you very much for your good advice, I will browse through my code and restructure all statements where $1/$2 are used so that they are only evaluated in the block after the condition and not inside the condition.

Best regards,

(This post was edited by GreetzFromWIT on Sep 1, 2015, 9:08 AM)

Edit Log:
Post edited by GreetzFromWIT (New User) on Sep 1, 2015, 9:08 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