Re: $_

From: Eric Walker (ewalker_at_micron.com)
Date: 12/30/03


To: James Edward Gray II <james@grayproductions.net>
Date: 30 Dec 2003 09:48:02 -0700

Once I get into the while loop the previous line I had is lost. As this
while is underneath another while that I am using in another routine.

thanks
On Tue, 2003-12-30 at 09:42, James Edward Gray II wrote:
    On Dec 30, 2003, at 10:36 AM, Eric Walker wrote:
    
> I am going through a file and when I enter a certain routine, I am
> entering a while loop with the <IN> construct. Is there a way to back
> the counter up or back up one line before I go into the while loop?
>
> a
> b
> c
> d
>
> Instead of seeing b when I enter the while loop, adjust some option and
> see the a.
    
    How about adding:
    
    my $last;
    while (<IN>) {
            # use $last here, but watch for undef on the first iteration, for
    example:
            do_something( $last ) if defined $last;
    
            $last = $_;
    }
    
    Hope that helps.
    
    James
    
    
    



Relevant Pages

  • Re: Using ZLib
    ... >> If only it were so easy - I tried using a repeat..until loop, ... >when Count>bytes left, inflate() sets FZRec.avail_out to 0, otherwise ... the main exit condition, and suggest that you check your Delphi CD. ... routine to ensure that they are asking for /exactly/ the decompressed ...
    (comp.lang.pascal.delphi.misc)
  • Re: Math libarary
    ... thought would have been a bette routine than Math.Exp and I was wrong;/ ... Both of these depend on S only but have to take into account the boundaries. ... Right now I have two functions that essentially loop over S seperately. ... The following is the code I use to compute the laplacian of a scalar field. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Whats wrong with this code?? A97 XP SP2
    ... You should be issuing a Debug.Print on *all* of your sql statements so you can easily see where the errors are. ... > routine should use Like (for wildcards) ... > Just working on the first part of the If - Loop for now. ...
    (microsoft.public.access.modulesdaovba)
  • Clarion4 routine not working as planned
    ... want to add a routine for the gross average and handicap. ... Rounds FIle has roundskey, that consist of Player Member Number, ... Here is my ebedded code in the process window code (a little ... LOOP until Access:Players.Next ...
    (comp.lang.clarion)
  • Looking for a better way
    ... Earlier I was helping a user that wanted a VBA find routine that would ... the user wanted a pop-up to querry if the routine should loop to ... Dim oRng1 As Range ... Set oRng = oRng1 ...
    (microsoft.public.word.vba.general)