Hi Again, You're right, if we were dealing with a text file, you wouldn't have to use binmode. However, my original script **was** for uploading binarys, and you mentioned mp3, so it made sense to leave it in.
Hope I've been of some help Rob "Li Ngok Lam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > > #/!perl -w > > use strict; > > use IO::File; > > > > my $offset = 3; > > my $file_binary = "fg"; > > sysopen(OUTFILE, "out.txt", O_WRONLY) or print "Couldn't open file for > > read/write ($!)\n"; > > binmode OUTFILE; > > sysseek OUTFILE, $offset, 0; > > syswrite OUTFILE, $file_binary, length($file_binary); > > close OUTFILE; > > > > > > out.txt goes from "1234567" to "123fg67" > > Thank you veeery much ! It does what I want too, but I wonder why we have to > make it a binmode > while we are dealing with a text file ? Is that we must treat the FH is a > binary source for > whatever +< or sysread/write ? > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]