> -----Original Message----- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Cc: 'Daniel Falkenberg '; [EMAIL PROTECTED] > Subject: RE: Finding words between words... > > > On Mar 7, Timothy Johnson said: > > >From: Jeff 'japhy' Pinyan > > > >> ($btwn) = $str =~ /In:(.*)Your/; > > > >Out of curiosity, what happens if you leave off the > parentheses on $btwn? > > You try it. ;) I suggest you read "'List' is a Four-Letter > Word", which > you can find at > > http://www.pobox.com/~japhy/articles/pm/2000-02.html >
For those of us who have ridiculous firewall filterings and are unable to read the article right now, I'll give a short answer... If you leave off the parentheses, $btwn is in scalar mode, and returns 1 to denote that the match succeeded (I think). With the parentheses, $btwn is then in list mode, so it is assigned the first value in the assignment (which also happens to be $1). At least that is the way I understand it. Hope this helps... Jason P.S. I only know this because I asked Japhy nearly the exact same question on an answer he once gave me. :) CONFIDENTIALITY NOTICE: ************************************************************************ The information contained in this ELECTRONIC MAIL transmission is confidential. It may also be privileged work product or proprietary information. This information is intended for the exclusive use of the addressee(s). If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution [other than to the addressee(s)], copying or taking of any action because of this information is strictly prohibited. ************************************************************************
