Posted to tcl by lmcvoy at Mon Oct 22 15:27:13 GMT 2007view raw
- # perl
- $re = '^\$/';
- while (<>) {
- print if /$re/o;
- }
- # tcl
- set re {^\$/}
- fconfigure stdout -encoding binary -translation binary
- foreach file $argv {
- set f [open $file r]
- fconfigure $f -encoding binary -translation binary
- while {[gets $f buf] >= 0} {
- if {[regexp -- $re $buf]} {puts $buf}
- }
- close $f
- }