Re: Smart assignment

2006-10-03 Thread Mumia W.
On 10/03/2006 11:37 AM, Derek B. Smith wrote: returns "true" or "false" (1 or '') and in list context it returns the contents of any capturing parentheses in the pattern. The expression: ( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i )[ 0 ] is a list slice so the regular expression is in

Re: Smart assignment

2006-10-03 Thread Igor Sutton
Umm... So would this do what I want also? ($ptype)=($projection =~ /movable.+(sine|geo|radial|ortho)/i) or $ptype="(missing)"; I think the correct is: $ptype = ($projection =~ /movable.+(sine|geo|radial|ortho)/i) || "(missing)"; '||' will be tight with ( $projection =~ ... )

Re: Smart assignment

2006-10-03 Thread Bryan R Harris
> Bryan R Harris wrote: >> returns "true" or "false" (1 or '') and in list context it returns the contents of any capturing parentheses in the pattern. The expression: ( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i )[ 0 ] is a list slice so the

Re: Smart assignment

2006-10-03 Thread John W. Krahn
Bryan R Harris wrote: > >>>returns "true" or "false" (1 or '') and in list context it returns the >>>contents of any capturing parentheses in the pattern. >>> >>>The expression: >>> >>>( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i >>>)[ 0 ] >>> >>>is a list slice so the regular expression is

Re: Smart assignment

2006-10-03 Thread Bryan R Harris
>> returns "true" or "false" (1 or '') and in list context it returns the >> contents of any capturing parentheses in the pattern. >> >> The expression: >> >> ( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i >> )[ 0 ] >> >> is a list slice so the regular expression is in list context but th

Re: Smart assignment

2006-10-03 Thread Derek B. Smith
> returns "true" or "false" (1 or '') and in list > context it returns the > contents of any capturing parentheses in the > pattern. > > The expression: > > ( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i > )[ 0 ] > > is a list slice so the regular expression is in list > context but the sl

Re: Smart assignment

2006-10-03 Thread Bryan R Harris
> Jen Spinney wrote: >> On 10/2/06, Mumia W. <[EMAIL PROTECTED]> wrote: >>> >>> Yes, and here is another way: >>> >>> $ptype = (($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i)[0]) || >>> '(missing)'; >> >> How does that way work? I was curious, so I tested it myself and it >> clearly did

Re: Smart assignment

2006-10-02 Thread John W. Krahn
Jen Spinney wrote: > On 10/2/06, Mumia W. <[EMAIL PROTECTED]> wrote: >> >> Yes, and here is another way: >> >> $ptype = (($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i)[0]) || >> '(missing)'; > > How does that way work? I was curious, so I tested it myself and it > clearly did work, but I hav

Re: Smart assignment

2006-10-02 Thread Jen Spinney
On 10/2/06, Mumia W. <[EMAIL PROTECTED]> wrote: On 10/02/2006 01:54 PM, Rob Dixon wrote: > Bryan R Harris wrote: >> >> ** >> $ptypeline = "#movableortProjortho0.0000.000"; >> >> ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho

Re: Smart assignment

2006-10-02 Thread Mumia W.
On 10/02/2006 01:54 PM, Rob Dixon wrote: Bryan R Harris wrote: ** $ptypeline = "#movableortProjortho0.0000.000"; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || "(missing)"; print $ptype, "\n"; ***

Re: Smart assignment

2006-10-02 Thread Rob Dixon
Bryan R Harris wrote: ** $ptypeline = "#movableortProjortho0.0000.000"; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || "(missing)"; print $ptype, "\n"; ** The above code prints