Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!iWarp.intel.com!news From: merlyn@iWarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: two perl questions Message-ID: <1991Jun7.163638.7834@iWarp.intel.com> Date: 7 Jun 91 16:36:38 GMT References: Sender: news@iWarp.intel.com Reply-To: merlyn@iWarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 24 In-Reply-To: jbryans@beach.csulb.edu (Jack Bryans) Nntp-Posting-Host: se.iwarp.intel.com In article , jbryans@beach (Jack Bryans) writes: | A while back there was a thread on forcing expression evaluation to be either | in scalar or array context. I thought, "sure, I'll remember that". Sigh! | What are some ways of forcing expr evaluation in array context? A FAQ add'n, | perhaps? Adding something to the FAQ won't force expr evaluation into an array context. (And don't call me Shirley! :-) But seriously... Scalar can be forced with the scalar() operator, or by adding 0 or concatenating a null string (depending on the type of value expected) or assigning into a scalar. Array can be forced by putting it into a list, or by assigning into an array. print +($a = "Just "),@b = ("another ", "Perl ", scalar("hacker,")) -- /=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'..."====/