Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

sh's scratchpad

by sh (Beadle)
on Jun 14, 2004 at 10:24 UTC ( #366477=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl -s print "usage: highlights where a regexp matches in the input text perl -s $0 [-c] [-g] [-i] [-s] [-m] [-o] 'regexp' [file.. ] " and exit(1) unless (@ARGV); $re = shift @ARGV; $x .= "c" if $c; $x .= "g" if $g; $x .= "i" if $i; $x .= "s" if $s; $x .= "m" if $m; $x .= "o" if $o; print "\/$re\/$x\n"; while (<>) { eval("s/$re/\e[7m\$&\e[m/$x;"); print; } #!/usr/bin/perl -s print "usage: highlights where s/// applied to the input text perl -s $0 [-e] [-g] [-i] [-s] [-m] [-o] 'regexp' 'replacement' [file. +. ] " and exit(1) unless ($#ARGV > 0); $re = shift @ARGV; $sub = shift @ARGV; $x .= "e" if $e; $x .= "g" if $g; $x .= "i" if $i; $x .= "s" if $s; $x .= "m" if $m; $x .= "o" if $m; print "\/$re\/$sub\/$x\n"; while (<>) { eval("s/$re/\e[7m\$sub\e[m/$x;"); print; }
Log In?

What's my password?
Create A New User
[LanX]: I'm not calling for shooting Trump with a golf ball ;-)
[LanX]: this bullshit theater is distracting us from real issues
[choroba]: he will resign
LanX "I put lipstick on a pig,"
[erix]: it does seem to get out of hand -- but then again, it looks like that for months already :)
[LanX]: the bets are rather who will leave office first Trump or May

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2017-08-18 13:04 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (301 votes). Check out past polls.