Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!usc!apple!veritas!amdcad!sono!porky!mayer From: mayer@sono.uucp (Ronald &) Newsgroups: comp.lang.perl Subject: strange (IMHO) eval behavior Message-ID: Date: 30 May 91 22:08:35 GMT Sender: mayer@sono.uucp (Ronald Mayer) Distribution: comp Organization: Acuson; Mountain View, California Lines: 23 Could someone please explain what's going on in these examples? % perl -e '@a = eval ("*\n"); print "@a\n";' [A bunch of random control characters which don't mean anything to me.] % perl -e '@a = eval ("*\n"); print "@a";' *main' In neither case is $@ set to anything. Even if the second case is supposed to mean something, I'm at a total loss to explain the first one. [BTW: sparc 1,SunOS 4.1, perl 4.0 patch 3] My guess: It's probably somehow related to this section of the manual, but I can't figure out how or why: > Since a *name value contains unprintable binary data, if it > is used as an argument in a print, or as a %s argument in a > printf or sprintf, it then has the value '*name', just so it > prints out pretty. Thanks, Ron Mayer sun!sono!mayer mayer@sono.uucp