Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!ruuinf!cs.ruu.nl From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.lang.perl Subject: Re: Perl problem: bogus message Message-ID: <2182@ruuinf.cs.ruu.nl> Date: 18 Dec 89 13:38:47 GMT References: Sender: news@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Distribution: comp.lang.perl Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 33 In-reply-to: bill@ssd.harris.com (Bill Leonard) In article , bill@ssd (Bill Leonard) writes: `Executing the following script on a Harris HCX running CX/UX: ` `#!/usr/bin/perl ` `sub rpt_for_ol { ` # Print the argument string as many times as there are elements in the ` # @x array. ` local($str) = @_ ; ` foreach $temp (@x) { ` print(STDOUT $str) ; ` } `} `@x = (1, 2, 3, 4) ; `$y = " | c s" ; `do &rpt_for_ol($y) ; You probably mean either: do rpt_for_ol($y) ; or &rpt_for_ol($y) ; `print("\n") ; ` What you are doing now is executing the file whose name is returned by rpt_for_ol($y) or something similar. I suppose it returns some bogus stuff (e.g. an empty string) -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-531806 Uucp: uunet!mcsun!hp4nl!ruuinf!piet Telefax: +31-30-513791 Internet: piet@cs.ruu.nl (*`Pete')