[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] regex questions



>> $adj =~ s/^ $//;


On Apr 17, 2014, at 3:54 PM, Ben Howard <BHoward@neogen.com> wrote:
> I could be wrong, but since ^ matches the beginning of a line, and $ matches the end, it might be trying to remove empty lines.

It turns ' ' into ''.
 
> “Take $adj, and replace [beginning of line][end of line] with [].”

Not quite -- you needed a space in the middle there. 

> Maybe it’s one of Perl’s magic operators that sort of coerce a behavior by forcing context changes, but that’s how I read it.

No magic.

Well, Perl is *always* magic. But nothing especially so here.  ;)

j