#!/usr/bin/perl # ... use Some::Third::Party::Module qw( doSomething ); # ... open my $h,'>:raw','output.bin'; my $oldSelected=select $h; print "\x00\x42\xAF\x99"; doSomething(); print "\x33\xFF\x81\x73"; select $oldSelected; close $h;