Re: using $. line number special variable (followup)

2004-11-10 Thread Joseph Paish
On Tuesday 09 November 2004 11:33, Paul Johnson wrote: > On Tue, Nov 09, 2004 at 11:40:30AM -0600, Joseph Paish wrote: > > BTW, i think i may have found out what is giving me the strange line > > numbers in the debugger under emacs. it seems that when i enter "p $." > > at the debugger prompt, it

Re: using $. line number special variable (followup)

2004-11-09 Thread Paul Johnson
On Tue, Nov 09, 2004 at 11:40:30AM -0600, Joseph Paish wrote: > BTW, i think i may have found out what is giving me the strange line numbers > in the debugger under emacs. it seems that when i enter "p $." at the > debugger prompt, it displays whatever line number the debugger just printed > o

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
On Tuesday 09 November 2004 10:20, Christopher Maujean wrote: > On Tue, 2004-11-09 at 07:24, Joseph Paish wrote: > > just a short followup to my earlier message about the $. line number > > variable. when i enter a print statement as shown below, it prints the > > correct line number (starting at

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
On Tuesday 09 November 2004 08:41, Bob Showalter wrote: > Joseph Paish wrote: > > just a short followup to my earlier message about the $. line number > > variable. when i enter a print statement as shown below, it prints > > the correct line number (starting at 1), but still never enters the > >

Re: using $. line number special variable (followup)

2004-11-09 Thread Christopher Maujean
On Tue, 2004-11-09 at 07:24, Joseph Paish wrote: > just a short followup to my earlier message about the $. line number > variable. when i enter a print statement as shown below, it prints the > correct line number (starting at 1), but still never enters the if() > structure. > > for the sa

RE: using $. line number special variable (followup)

2004-11-09 Thread Bob Showalter
Joseph Paish wrote: > just a short followup to my earlier message about the $. line number > variable. when i enter a print statement as shown below, it prints > the correct line number (starting at 1), but still never enters the > if() structure. > > for the sake of understanding how to correctl

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
just a short followup to my earlier message about the $. line number variable. when i enter a print statement as shown below, it prints the correct line number (starting at 1), but still never enters the if() structure. for the sake of understanding how to correctly use this variable, i wou

Re: using $. line number special variable

2004-11-08 Thread Randy W. Sims
Joseph Paish wrote: how do you use the "line number" variable inside a while loop like i am trying to do below? i never get to process the first line of the file, and as a result, subsequent calculations are inaccurate. it always jumps to the second "if" statement. Like the others, I don't s

Re: using $. line number special variable

2004-11-08 Thread William C. Bruce
Joe, If you are using fh1 more than 1x in the code, and it's not explicitly closed with each use, you will start at the last line number of the previous file or across files. I had a tendency to reuse file handles, relying on perl's implicit close, and ran into the above. The code snippet loo

Re: using $. line number special variable

2004-11-08 Thread Joseph Paish
On Monday 08 November 2004 10:56, Bob Showalter wrote: > Joseph Paish wrote: > > how do you use the "line number" variable inside a while loop like i > > am trying to do below? > > > > i never get to process the first line of the file, and as a result, > > subsequent calculations are inaccurate. i

RE: using $. line number special variable

2004-11-08 Thread Bob Showalter
Joseph Paish wrote: > how do you use the "line number" variable inside a while loop like i > am trying to do below? > > i never get to process the first line of the file, and as a result, > subsequent calculations are inaccurate. it always jumps to the > second "if" statement. The way you're usi

Re: using $. line number special variable

2004-11-08 Thread Chris Devers
On Mon, 8 Nov 2004, Joseph Paish wrote: > how do you use the "line number" variable inside a while loop like i am > trying to do below? Why not go about the problem like this? #!/usr/bin/perl use strict; use warnings; open (fh1, "/path/to/file") or die ("can't open /path/to/file

using $. line number special variable

2004-11-08 Thread Joseph Paish
how do you use the "line number" variable inside a while loop like i am trying to do below? i never get to process the first line of the file, and as a result, subsequent calculations are inaccurate. it always jumps to the second "if" statement. thanks joe = #!/usr/bin/perl use