>>>>> "JG" == Joe Gottman <[EMAIL PROTECTED]> writes:

  JG>    sub use_first() 
  JG>    {
  JG>   for 1..2 {
  JG>           FIRST {say 'entering loop';}
  JG>           say $_; 
  JG>           LAST    {say 'leaving loop';}
  JG>   }
  JG>   }

  JG> The first time use_first is called it will print
  JG>   entering loop
  JG>   1
  JG>   2
  JG>   leaving loop

  JG> but subsequently it will print
  JG>   1
  JG>   2
  JG>   leaving loop

that seems to imply that FIRST is a program level first time action. i
think it does what you want and is executed on the first iteration of a
loop, each time the loop is started up. it is symmetrical to LAST in
that way. it should print the former text each time the sub is called.

but i could be wrong. :)

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to