Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: shortest self-reproducing Perl program Message-ID: <7493@jpl-devvax.JPL.NASA.GOV> Date: 21 Mar 90 00:49:28 GMT References: <1990Mar20.203516.8429@iwarp.intel.com> <1990Mar20.215103.23101@agate.berkeley.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 30 In article <1990Mar20.215103.23101@agate.berkeley.edu> raymond@math.berkeley.edu (Raymond Chen) writes: : >Any one liners? : : [[ don't put a newline at the end ]] : : $s='$s=%c%s%c;printf$s,39,$s,39;';printf$s,39,$s,39; : : Unfortunately, it doesn't work even though it should; the output is : : $s='$s=%c%sc;printf$s,39,$s,39;';printf$s,39,$s,39; : ^ huh? : : This happens with : : $Header: perly.c,v 3.0.1.4 90/02/28 18:06:41 lwall Locked $ : Patch level: 12 : : on a VAX8700 running ULTRIX. : : Was this fixed in one of the more recent patches? Depends on how recent you think patch 16 is. :-) do_sprintf() was assuming that you wouldn't sprintf a string using itself as the format, so it temporarily installed nulls in the string to handle each % interpolation. Obviously a bad assumption... Life's a beach. And then you dry. Larry