#!/usr/bin/perl -w # Charlie Strauss 2005 #edit the following two lines to select python or perl $command = 'python'; # change this to "perl -w" $suffix = '.py'; # change this to .pl use POSIX; @S = <>; $S[0] =~ tr/\r/\n/ if (@S==1); #this magically translates mac returns inserted by pbpaste # to unix newlines if need be. print @S; #put it back where you got it $tmp = POSIX::tmpnam().$suffix; die "aborting: temporary file exists! $tmp \n" if -e "$tmp"; open FH , ">$tmp" or die "can't open $tmp\n $@\n"; print FH @S; close FH; @Q = `$command $tmp`; print STDERR @Q;