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 list
context but the slice is
a single value so the expression is a scalar.
The || operator will only work with scalar values,
not with lists, so this
works because the list has been converted to a
scalar with the list slice.
John
********************************************
the list context represents everything between the / /
and the slice context represents [ 0 ] which is
assigned as a scalar to $ptypeline.
Correct?
[...]
No, $ptypeline is the string that is being searched.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>