I was playing around (and abusing) the debugger as shell. ;)

That's what I got so far, not perfect though

C:\tmp\files>set TERM=dumb C:\tmp\files>perl -dE0 Loading DB routines from perl5db.pl version 1.49_05 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 0 DB<1> sub out { if ($.==1) { open(ARGVOUT,">","$ARGV".shift); select + (ARGVOUT) } ; $. = "0 EOF at $." if eof } DB<2> x @ARGV=<?> 0 'a' 1 'b' 2 'c' DB<3> x <> 0 '1:bla bla ' 1 '2:bla bla ' 2 '3:bla bla ' 3 '1:bla bla ' 4 '2:bla bla ' 5 '3:bla bla ' 6 '1:bla bla ' 7 '2:bla bla ' 8 '3:bla bla ' DB<4> x @ARGV=<?> 0 'a' 1 'b' 2 'c' DB<5> print s/bla/drivel/r while (<>) 1:drivel bla 2:drivel bla 3:drivel bla 1:drivel bla 2:drivel bla 3:drivel bla 1:drivel bla 2:drivel bla 3:drivel bla DB<6> x @ARGV=<?> 0 'a' 1 'b' 2 'c' DB<7> out(".ext"), print s/bla/drivel/r while (<>) DB<8> x @ARGV=<?.ext> 0 'a.ext' 1 'b.ext' 2 'c.ext' DB<9> x <> 0 '1:drivel bla ' 1 '2:drivel bla ' 2 '3:drivel bla ' 3 '1:drivel bla ' 4 '2:drivel bla ' 5 '3:drivel bla ' 6 '1:drivel bla ' 7 '2:drivel bla ' 8 '3:drivel bla ' DB<10>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice


In reply to Re: One to one file output idiom by LanX
in thread One to one file output idiom by Eily

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.