Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: One to one file output idiom

by LanX (Sage)
on Jan 15, 2020 at 23:50 UTC ( #11111463=note: print w/replies, xml ) Need Help??


in reply to One to one file output idiom

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111463]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2022-01-22 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?