[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Numbering Lines in MacPerl



At 15:35 -0700 98/06/25, Peter Prymmer wrote:
> Chris Nandor wrote:
> > At 09.29 -0400 1997.06.25, Matt Kraft wrote:
> > >How do I number lines in MacPerl?  Whenever I run my script it says:
> > >
> > ># Missing right bracket, at end of line
> > >File 'Untitled'; Line 928
> > >
> > >But I can't find line 928 so I can't fix it.
> >
> > It is not generally recommended to write large scripts in
> > the MacPerl editor.
>
> All true, but it is quite easy to get this job done:
>
> #!perl
> while(<>){print "$. $_"}
> __END__

But then it's easy to count to the line with the error :-)


> Another approach is to roll your own context grep on the fly like so:

I prefer "Jump to:", although a generic grepper could prove useful for many
things.

> >From the MPW command line
>
>  perl -ne 'print "$. $_" if ($. <= 930 && $. >= 926)' myscriptname

Alternatively, under MPW, just select and enter the line with the error
message.  (No menu item needed).
---
Vicki Brown, vlb@cfcl.com        |\      _,,,---,,_
Journeyman Sourceror      ZZZzz /,`.-'`'    -.  ;-;;,_
Scripts & Philtres             |,4-  ) )-,_. ,\ (  `'-'
http://www.cfcl.com/~vlb      '---''(_/--'  `-'\_)
P.O. Box 1269 San Bruno, CA  94066

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch