Wilson, Douglas on Mon, 2 Jun 2003 13:09:51 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: scalar / list context weirdness



On Monday, June 02, 2003 9:50 AM, Jeff Abrahamson [SMTP:jeff@purple.com]
wrote:
> But isn't

>    $foo =~ s/.html$//;

> scalar context?

Forget what I said about context. From the perldocs:
 s/PATTERN/REPLACEMENT/egimosx                               
         Searches a string for a pattern, and if found,      
         replaces that pattern with the replacement text and 
         returns the number of substitutions made.  Otherwise
         it returns false (specifically, the empty string).

I was thinking about the m// operator where there's a difference between
scalar and list context...

-Doug
-
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**