Weird printing . . .

2003-10-22 Thread Jason
I have a file formatted like this: #error0 # This indicates that there was no # error whatsoever. #error0 #error1 # You have specified no arguments, # so the program ran the 'PrintHelp' # subroutine and then died. #error1 #error2 # If you do not specify a type, then # there is no way

Re: Weird printing . . .

2003-10-22 Thread Steve Grazzini
On Wed, Oct 22, 2003 at 12:59:33PM -0500, Jason wrote: > I have a file formatted like this: [ snip ] > #error12 > # Couldn't set the transfer mode to binary. > #error12 > > I want to write code that searches for an error number, and then > prints everything in between the two error number lab

Re: Weird printing . . .

2003-10-22 Thread Steve Grazzini
On Wed, Oct 22, 2003 at 02:26:50PM -0400, Steve Grazzini wrote: > #!/usr/bin/perl > # > # [ untested ] > # And it shows... :/ > die "Usage: $0 ERROR\n" unless @ARGV; > > my $num = shift; > my $rx = qr/^#error$num$/; > > while (<>) { > my $range = /$rx/ .. /$rx/; You'd a