#!/usr/bin/perl while ($file=<~/*.raw>) { $out = < $file 1 44100 2 little short 4 EOM $header = ""; $total = length($out)+length($header); $count = (-$total)%4; open(FILE,">$file.header"); print FILE $out; print FILE " "x$count; print FILE $header; close(FILE); $run = "cat $file.header $file | nc localhost $ENV{PPORT}0 &"; print $run,"\n"; system($run); }