in reply to what is the purpose of Tie::File

I haven't had occasion to use it (never written a text-editor) so I never had that need :) but see what the author had to say: Tie::File -> Tie::File, How do I insert a line into a file?

Replies are listed 'Best First'.
Re^2: what is the purpose of Tie::File
by Lotus1 (Vicar) on Nov 11, 2012 at 23:14 UTC

    Thanks for the links. Those make it pretty clear how it is useful. Although Perl isn't a text editor I seem to be too often.

    On one of the slides in the second link I found this interesting regex. s/^/>> /; Another obvious thing I suppose that I didn't know or realize before: that you can substitute something for nothing and therefore insert something at a boundary.

      Yes, or you can substitute something for what may be nothing, as in s/\n*\z/\n/.
      --
      A math joke: r = | |csc(θ)|+|sec(θ)|-||csc(θ)|-|sec(θ)|| |