This is a snippet from an cgi based file uploader I wrote once. I think this
is what you're after

#/!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"


"Li Ngok Lam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >
> > You want seek(), and possibly tell().
> >
> > perldoc -f seek
> >
>
> Thanks for reply, but seems I have to clarify my question.
> 'seek' and 'tell' only helping me to target my position within
> a file handle.
>
> Say, if I have a 1MB file, and I just want to over write
> bytes from 0 to 1000 byte then my job is done, file is supposed
> to be saved. I  want to avoid to rewrite the rest 900KBs again.
>
> Would you imagine what I am asking ?
>
> Welcome for any further suggestions.
>
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to