Replace first 2 bytes on binary files?

2008-10-05 Thread Louise Hoffman
Dear programmers I am new to Perl, and was wondering, if someone could help me? I would like to replace the first 2 bytes from ## to BM in all the files in a directory. The files are binary. Can that be done easily in Perl? Hope to hear from you =) Lots of love, Louise -- To unsubscribe,

Re: Replace first 2 bytes on binary files?

2008-10-05 Thread Mr. Shawn H. Corey
On Sun, 2008-10-05 at 04:44 -0700, Louise Hoffman wrote: Dear programmers I am new to Perl, and was wondering, if someone could help me? I would like to replace the first 2 bytes from ## to BM in all the files in a directory. The files are binary. Can that be done easily in Perl? Yes.

Re: Replace first 2 bytes on binary files?

2008-10-05 Thread Dr.Ruud
Mr. Shawn H. Corey schreef: Louise Hoffman: I would like to replace the first 2 bytes from ## to BM in all the files in a directory. The files are binary. Use glob to get the list of files. Use open with read-write to read the first line and replace the bytes. I wouldn't read a line,

Re: Replace first 2 bytes on binary files?

2008-10-05 Thread John W. Krahn
Dr.Ruud wrote: Mr. Shawn H. Corey schreef: Louise Hoffman: I would like to replace the first 2 bytes from ## to BM in all the files in a directory. The files are binary. Use glob to get the list of files. Use open with read-write to read the first line and replace the bytes. I wouldn't

Re: Replace first 2 bytes on binary files?

2008-10-05 Thread Dr.Ruud
John W. Krahn schreef: Dr.Ruud: Mr. Shawn H. Corey: Louise Hoffman: I would like to replace the first 2 bytes from ## to BM in all the files in a directory. The files are binary. Use glob to get the list of files. Use open with read-write to read the first line and replace the bytes.