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>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|