Re: [SLUG] Perl Question

From: mark@bish.net
Date: Tue Mar 22 2005 - 15:39:21 EST


Ignore the typo:
(read(BRIEF

it should say:
(read(DEST

On Tue, 22 Mar 2005 mark@bish.net wrote:

>
> Why doesn't this work?
>
> open(SRC, "<$file1") or die "Can't open for reading: $!\n";
> open(DEST, ">$file2") or die "Can't open for reading: $!\n";
>
> binmode(SRC);
> binmode(DEST);
>
> while(read(BRIEF, $buff, 2)){
> $buff = hex ($buff) ^ 0xAA;
> print DEST $buff;
> }
>
> close(DEST);
> close(SRC);
>
>
>
> I get a text file filled with 170, which is 0xAA.
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:19:01 EDT