Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: perl 4.0beta bug in sysread/syswrite? Message-ID: <1991Apr6.223818.18708@iwarp.intel.com> Date: 6 Apr 91 22:38:18 GMT References: <536@appserv.Eng.Sun.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 14 In-Reply-To: lm@slovax.Eng.Sun.COM (Larry McVoy) In article <536@appserv.Eng.Sun.COM>, lm@slovax (Larry McVoy) writes: | syswrite(F, $foo, length($foo), $i * length($foo)) || die "write"; The fourth parameter to syswrite is the offset into $foo, not the offset into the filehandle. You are effectively (on the second and subsequent writes) trying to transfer data from beyond $foo to F. Good thing Perl doesn't let you do that! for (0..24) {syswrite(STDOUT,"Just another Perl hacker,", 1, $_);} -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/