Re: Match pattern and print next line

2002-11-25 Thread david
Joshua Kaufman wrote: Bob - Thanks, I'll investigate that. I'm also hoping that the list will tell me how to do it by incrementing the proper special variable. I could swear that I've done that before, and have found it useful in other contexts. -- Josh The $. variable won't do

Re: Match pattern and print next line

2002-11-24 Thread badchoice
an alternative: $print, /- Student Id|$/ for LOG; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Hi All; I'm trying to match a pattern in a text file and then print out the next line in that file. I could swear that I've done this before by incrementing $. to move to the next line. However, the code below is printing out the matched line rather than the next line. #!/usr/bin/perl open

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
You could always say LOG again inside your if to print the next line. Realize that you will not then be able to check that line for the string, but if that is ok which it sounds like it is then it should work. See below. Joshua Kaufman wrote: Hi All; I'm trying to match a pattern in a text

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Thanks for the reply. That would work in this context, but I'm looking for the more general answer, mostly just to convince myself that I'm not crazy and have done it this way before. --Josh On 11/23/02 8:44 AM, Wiggins d'Anconia [EMAIL PROTECTED] wrote: You could always say LOG again inside

Re: Match pattern and print next line

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 02:05:58PM -0600, Joshua Kaufman wrote: Thanks for the reply. That would work in this context, but I'm looking for the more general answer, mostly just to convince myself that I'm not crazy and have done it this way before. I'm sorry to report that you may be crazy

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
How unfortunate for me ;-) -- josh On 11/23/02 2:17 PM, Paul Johnson [EMAIL PROTECTED] wrote: On Sat, Nov 23, 2002 at 02:05:58PM -0600, Joshua Kaufman wrote: Thanks for the reply. That would work in this context, but I'm looking for the more general answer, mostly just to convince myself

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
Yeh I would tend to agree, based on the fact that you can have multiple handles open at the same time. So there would have to be like a hash or something if it were a special variable which you would have to update for each handle, on top of that you can make a handle a lexical variable which

Re: Match pattern and print next line

2002-11-23 Thread John W. Krahn
Joshua Kaufman wrote: Hi All; Hello, I'm trying to match a pattern in a text file and then print out the next line in that file. I could swear that I've done this before by incrementing $. to move to the next line. However, the code below is printing out the matched line rather than the