in reply to numbered sourcecode listing (oneliners)

I generate my column listings with a very simple one:
perl -pe 's/^/\t=$.=\t/'
In emacs, I just hit the tab key for those \t's, or I can type \t instead.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: numbered sourcecode listing (oneliners)
by MeowChow (Vicar) on Jul 21, 2001 at 02:54 UTC
    You can omit the caret in that one too.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      You can omit the caret in that one too.
      Only if I was golfing and not worried about being clear and working in all circumstances. I never trust the empty match, since it depends on the most recent successful match. True, here, it defaults to an empty string, but why count on that when one single character fixes that problem and communicates the proper intent?

      -- Randal L. Schwartz, Perl hacker

        In Perl "// == /$&/". Is it unintentional or useful feature? I can't imagine any situation when this feature is helpful.
        Because you were in the midst of a golfing match.