Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Randal L. Schwartz
> "Paul" == Paul Johnson <[EMAIL PROTECTED]> writes: Paul> On Wed, Mar 02, 2005 at 05:22:14AM -0800, Randal L. Schwartz wrote: >> From emacs: >> step 1 - highlight Perl code as region >> step 2 - ^U ESC ! expand | perl -pi 's/^/\t=$.=\t/' CR >> >> It's programmed into my fingers. :) Paul> Th

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Paul Johnson
On Wed, Mar 02, 2005 at 05:22:14AM -0800, Randal L. Schwartz wrote: > From emacs: > step 1 - highlight Perl code as region > step 2 - ^U ESC ! expand | perl -pi 's/^/\t=$.=\t/' CR > > It's programmed into my fingers. :) Then you hit undo and try again without the typo? -- Paul Johnson - [EMAIL

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Gavin Henry
>> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > >>> perl -pe 's/^/=$.= /' test.pl > > Gavin> That looks familiar > > Yup. > > From emacs: > step 1 - highlight Perl code as region > step 2 - ^U ESC ! expand | perl -pi 's/^/\t=$.=\t/' CR > > It's programmed into my fingers. :) I knew yo

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Michael Demelbauer
Thus spaketh To beginners@perl.org: > Thus spaketh Randal L. Schwartz: > > > "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > > > > >> perl -pe 's/^/=$.= /' test.pl > > > > Gavin> That looks familiar > [ ... ] Sorry. > Yes. But I found a way to confuse myself. > > Why does > > perl -p

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Michael Demelbauer
Thus spaketh Randal L. Schwartz: > > "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > > >> perl -pe 's/^/=$.= /' test.pl > > Gavin> That looks familiar [ ... ] Yes. But I found a way to confuse myself. Why does perl -e '$_.="$. "' some_file start the enumaration at line 2, while perl

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Randal L. Schwartz
> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: >> perl -pe 's/^/=$.= /' test.pl Gavin> That looks familiar Yup. >From emacs: step 1 - highlight Perl code as region step 2 - ^U ESC ! expand | perl -pi 's/^/\t=$.=\t/' CR It's programmed into my fingers. :) -- Randal L. Schwartz - Sto

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
-- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! > On Tue, Mar 01, 2005 at 08:51:58AM -0500, Wiggins d'Anconia wrote: > >>and I figure you can remove the assignment in the >> below, but I am not sure how >> >> perl -p -e '$_ = "=$.

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Paul Johnson
On Tue, Mar 01, 2005 at 08:51:58AM -0500, Wiggins d'Anconia wrote: >and I figure you can remove the assignment in the > below, but I am not sure how > > perl -p -e '$_ = "=$.= $_"' test.pl Here's one way. perl -pe 's/^/=$.= /' test.pl -- Paul Johnson - [EMAIL PR

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Wiggins d'Anconia
Please bottom post... Manav Mathur wrote: This?? perl -i.bak -ne 'print "=$.= $_"' /path/to/code_file Manav I am no golfer, but you don't need the -i and .bak if you are not editing the file, and I suspect this will make things slower because Perl has to keep track of whether you are editing. Yo

RE: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Manav Mathur
This?? perl -i.bak -ne 'print "=$.= $_"' /path/to/code_file Manav -Original Message- From: Gavin Henry [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 5:44 PM To: beginners@perl.org Subject: Re: code on stonehenge.com for adding line numbers to code &g

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
> is this what you are looking for? > $count=1; > while() { > print OUTFILE "=$count++= $_"; > } It was more like perl -pi -e blah > > On Tue, 1 Mar 2005 11:23:44 - (GMT), Gavin Henry <[EMAIL PROTECTED]> > wrote: >> Dear all, >> >> I remember reading how Randal puts the =1= =2= in front of

code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
Dear all, I remember reading how Randal puts the =1= =2= in front of each line of code on his site, but I can't find it again. Anyone remember? Thanks. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit