On Tue, 2009-01-27 at 12:27 -0500, Malyj, Mark wrote:
> Your code
> 
> my ( $whoami ) = grep { m{ \b ServiceScript \. pl \b }msx } values %
> INC;
> print "$whoami\n";
> 
> works great!! If you have time, could you explain to a Windows guy
> like
> me what the grep is doing?

See `perldoc -f grep` for details.

grep assigns each element of the list `values %INC` to $_ and then
applies the code in the block to it.  It keeps any element that is TRUE,
as Perl defines TRUE.

Also see `perldoc -f map`.


-- 
Just my 0.00000002 million dollars worth,
  Shawn

"It would appear that we have reached the limits of what it is
 possible to achieve with computer technology, although one should
 be careful with such statements, as they tend to sound pretty silly
 in 5 years."
   --John von Neumann, circa 1960


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to