Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!decwrl!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Possible bug with shifting an array Message-ID: <1990Aug16.214009.20991@iwarp.intel.com> Date: 16 Aug 90 21:40:09 GMT References: <12150004@hpcc01.HP.COM> <12150006@hpcc01.HP.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 23 In-Reply-To: okamoto@hpcc01.HP.COM (Jeff Okamoto) In article <12150006@hpcc01.HP.COM>, okamoto@hpcc01 (Jeff Okamoto) writes: | After further experimentation, it looks as though I may be using index | incorrectly. This is what I am using now: | | $i = index($q_dest, '\000'); | | Perl -w doesn't complain, but $i always returns -1. What am I doing | wrong here? Maybe it will be apparent after running the following fragment: $q_dest = "abc\000def"; print index($q_dest,'\000'),"\n"; print index($q_dest,"\000"),"\n"; Backslashes are not interpreted insided single-quoted strings. $_="3xJ2yu0qs7!t a2Un9Po5Vt3#he9Pr5M 3EP8(e5Mr6Xl2Q ha7&ck0#er,";s/\d.//g;print -- /=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: "Welcome to Portland, Oregon, home of the California Raisins!"=/