Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!decwrl!orc!bu.edu!nntp-read!composer From: composer@bucsf.bu.edu (Jeff Kellem) Newsgroups: comp.lang.perl Subject: Re: "MOST COMMON NOVICE BUG" contest Message-ID: Date: 16 Mar 90 15:48:01 GMT References: <15230@bfmny0.UU.NET> <15232@bfmny0.UU.NET> <1118@etnibsd.UUCP> <1990Mar16.010322.18464@tc.fluke.COM> Sender: news@bu.edu.bu.edu Reply-To: composer@cs.bu.edu Organization: Boston Univ., Computer Science Lines: 45 In-reply-to: inc@tc.fluke.COM's message of 16 Mar 90 01:03:22 GMT In article <1990Mar16.010322.18464@tc.fluke.COM> inc@tc.fluke.COM (Gary Benson) writes: > Date: 16 Mar 90 01:03:22 GMT > > 1. It seems that perl scripts are compiled just prior to execution. > Would there be any benefit to a perl compiler that, like C, would > JUST do the compilation and create a file (a.out might be a cool name > or maybe p.out). This way, I could store the executable somewhere and > not have to recompile each and every time. Why is perl NOT like that > right now? I realize that compilation doesn't take long for my little > 100-liners, but for a SUPER MACHO HACKER program, it might be > significant... Actually, there is a way and it is documented in the manual. Look under the '-u' option to "cause perl to dump core after compiling your script." You will need the "undump" program on your machine to turn this core dump into an executable file. This program is NOT supplied with perl, as it is somewhat machine dependent. ;-) > 2. I am studying C right now, too, and have just learned about > multi-dimensional arrays. Are these possible in perl? Do you set them > up similarly to the way C does it? If they are possible, does anyone > have a (well-commented) example showing how to set up and access, > e.g., a 3-D array? If they are not possible, why not? Is similar > functionality provided some other way? I think they'd be really > useful, espcially in database applications. The best way to emulate multidimensional arrays is via associative arrays. So, you could do something like: $foo{$a,$b} to emulate 2-dimensional arrays. Look at the documentation under '$;'. Sorry I don't have an example on hand to give you. If you still have questions on this, just ask. As for your other questions, I'll check back later today. I have some important work to complete right now. Good luck!! -jeff Jeff Kellem INTERNET: composer@cs.bu.edu (or composer@bu.edu) UUCP: ...!harvard!bu-cs!composer