SPUG:Rookie Question

Tom Legrady legrady at earthlink.net
Mon Jun 16 20:32:04 CDT 2003


That's not a void context... grep() returns the array which is the
object of map(). The return value of map() is used as the key for an
anonymous hash, which is then subtracted from $uniq. What is means to
subtract a hash from a scalar is a mystery beyond the ken of mere
programmers. It's the result of the subtraction which sees a void
context and is discarded, but that doesn't affect map() or grep().

Tom Legrady

On Mon, 2003-06-16 at 20:43, ced at carios2.ca.boeing.com wrote:
> > I realize this is a rookie question, but I need a quick fix...or a
> > pointer to the location where I can find a quick fix.  I have a line
> > that looks like this:
> 
> > $uniq - { map m|(^\w+)(\s)|,grep /^[A-Z]{4}MTA|^[A-Z]{4}MKT/, at facode };
> > If I wanted to eliminate the grep, which would make Tim Maher (of White
> > Camel fame) happy, how would I do so?
> 
> Maybe  just if used in void context...  like the subtraction 
> you've shown :)





More information about the spug-list mailing list