[ale] OT: interpolation and anchors in perl regex

Jerald Sheets questy at gmail.com
Sun Oct 19 10:05:23 EDT 2008


One could argue that you should *always* develop with warnings and  
strict on.  You can set those up this way:

use warnings;
use strict;


or by using the preprocessor directive:

#!/usr/bin/perl -w -e

use strict;



I'm sure there's more ways to do that (since there's always more than  
one way to do it), but I find it the most helpful to develop w/  
warnings and strict on, and then to pull warnings when deploying to  
users (i.e., "when it's done")


--j



On Oct 19, 2008, at 4:38 AM, Brian Pitts wrote:

> Ed Cashin wrote:
>> On Sat, Oct 18, 2008 at 6:52 PM, Brian Pitts <brian at polibyte.com>  
>> wrote:
>>> Can someone explain why the last one doesn't match?
>> ...
>>> $ perl -e '$foo = "hello"; $bar = "hello_world"; print "yes\n" if  
>>> $bar
>>> =~ /^$foo_world$/;'
>>
>> There's no $foo_world variable.  If you do "perl -W -e ...",
>> perl will tell you that.
>>
>
> Ah ha. I forget that I have to ask perl to warn me about things like
> that. Thanks!
>
> -Brian
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20081019/a6ef47da/attachment.html 


More information about the Ale mailing list