in reply to Re: Re: insert zero into binary files ?
in thread insert zero into binary files ?

The error message tells you exactly what is wrong. Look up the 'x' operator in the perlop manpage. You have the arguments the wrong way around, it should be $str x $number.

And if you're trying to write to the file you're reading from, that's not how to do it, you'll need to open the file read/write, using '+>' in open. The syntax to print to a filehandle is:  print $file $zero (Yours tries to print the value of the filehandle and $zero to the default filehandle, which is probably STDOUT (the screen).

C.

Replies are listed 'Best First'.
Re: Re: Re: Re: insert zero into binary files ?
by bh_perl (Monk) on Nov 07, 2003 at 08:32 UTC
    Castway, Thanks a lot ....

    you are very very powerfull and your ideas is very very good. I'm really respect on that...

    3dan, thanks ....
    I have solved my problem by referring at your example and castway guide.

    bh.