Since 0 is always false and all other numbers are true, the returned number of elements can indicate success at the same time. My admiration for the the way Larry Wall thinks is growing by the minute.
- Jan Tim Johnson wrote: > >Just a small correction: In scalar context it returns 1 because there >is 1 element in the list. If there were more parentheses it might >return a higher number. > > > >-----Original Message----- >From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] >Sent: Wednesday, January 28, 2004 6:13 PM >To: 'Jan Eden'; 'Perl Lists' >Subject: RE: Two-liner to one-liner > > I think(?) "( $eingabe =~ /(?<=Teilnehmer:\n\n)(.+)/s )[0]" >is forcing the regex into list context. In scalar context it returns 1 >(for success?) and split assumes scalar context of its second argument. > > -- There are 10 kinds of people: those who understand binary, and those who don't -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>