Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files

by aitap (Deacon)
on Nov 18, 2012 at 13:06 UTC ( #1004407=note: print w/ replies, xml ) Need Help??


in reply to s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files

You could feed this string to perltidy:

$ perltidy my $fs = q!.\funkisym.pm!;open(FUNKISYM, q(>),qq($fs)); my $flashbang += q{#! \usr\bin\perl};my $pra = q!use strict;!; my $pra2 = q!use warn +ings;!;my @fstr = (q(format FUNKISYM = ),q(@).q(<) x 16,q($flashbang +).qq(\n),q(@).q(<) x 11,q($pra),q(@).q(<) x 13,q($pra2),qq(.\n));eval +(join($/,@fstr));select FUNKISYM;write;exec(qq!notepad\.exe $fs!); ^D my $fs = q!.\funkisym.pm!; open( FUNKISYM, q(>), qq($fs) ); my $flashbang = q{#! \usr\bin\perl}; my $pra = q!use strict;!; my $pra2 = q!use warnings;!; my @fstr = ( q(format FUNKISYM = ), q(@) . q(<) x 16, q($flashbang) . qq(\n), q(@) . q(<) x 11, q($pra), q(@) . q(<) x 13, q($pra2), qq(.\n) ); eval( join( $/, @fstr ) ); select FUNKISYM; write; exec(qq!notepad\.exe $fs!);
(in this example ^D is used to end the input data; in Windows you'll need to use ^Z)
Edit: correct input data and usage example
Sorry if my advice was wrong.


Comment on Re: s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-09-01 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls