Re: to () or not to (), that is the question.

2005-07-21 Thread Bryan R Harris
Great response, by the way, Jeff -- I wish I'd read this 3 years ago... - Bryan > On Jul 21, Brent Clark said: > >> I have the following code: >> >> ($fileName) = ($_ =~ /regexcode/o); >> >> Which gives me the correct data. > >> But if I make it like so (note the () missing around the var

Re: to () or not to (), that is the question.

2005-07-21 Thread Brent Clark
Jeff 'japhy' Pinyan wrote: The difference is the context. A pattern match returns different values depending on whether it was called in scalar context or list context. In scalar context, a pattern match returns whether or not it was able to match. In list context, the pattern match returns

RE: to () or not to (), that is the question.

2005-07-21 Thread Bob Showalter
Brent Clark wrote: > Hi list > > Would someone be so kind as to share some light on this for me. > > I have the following code: > > ($fileName) = ($_ =~ /regexcode/o); > > Which gives me the correct data. > > But if I make it like so (note the () missing around the variable): > > $fileName =

Re: to () or not to (), that is the question.

2005-07-21 Thread Jeff 'japhy' Pinyan
On Jul 21, Brent Clark said: I have the following code: ($fileName) = ($_ =~ /regexcode/o); Which gives me the correct data. But if I make it like so (note the () missing around the variable): $fileName = ($_ =~ /regexcode/o); Whats the difference. The difference is the context. A patt

Re: to () or not to (), that is the question.

2005-07-21 Thread Brent Clark
Sorry I for got to add. In the second statement I only get a "1" Thanks Brent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

to () or not to (), that is the question.

2005-07-21 Thread Brent Clark
Hi list Would someone be so kind as to share some light on this for me. I have the following code: ($fileName) = ($_ =~ /regexcode/o); Which gives me the correct data. But if I make it like so (note the () missing around the variable): $fileName = ($_ =~ /regexcode/o); Whats the difference.