From: Jay Soffian Date: Sun, 05 Apr 2009 03:31:42 GMT Subject: Re: [PATCH] send-email: fix nasty bug in ask() function Message-ID: <76718490904042031o5009a684xcf10aaff163e657@mail.gmail.com> In-Reply-To: <1238901801-47109-1-git-send-email-jaysoffian@gmail.com> > I'm also super confused why the issue is occuring. You can see from the > patch below that by default the ask() function attempted to match the > user's input against the empty regex //, which should match anything: > > $ perl -e 'use strict; my $resp="something"; my $re=""; print "true\n" if $resp =~ /$re/' > true > $ perl -e 'use strict; my $resp=""; my $re=""; print "true\n" if $resp =~ /$re/' > true > > Any yet while my demonstration above works as I expect, for some reason > what is basically the same code (AFAICT) in send-email does not match. I > thought I knew my perl fairly well, but maybe some perl guru can see > what's going wrong. Ah, found it in perlreref: If 'pattern' is an empty string, the last successfully matched regex is used. Grumble. j.