[ale] Perl monks ?

Fletch fletch at phydeaux.org
Wed May 1 15:11:24 EDT 2002



> 1. Is the following snippet a valid piece of Perl code? 
> s/[Tt]he\s/a/gis; 

$ perl -wce 's/[Tt]he\s/a/gis;'
-e syntax OK


        When in doubt, ask perl.

> 2. Will the following code open a file named "thefile" for output? 
> open OUT, "thefile"; 

        perldoc -f open, perldoc perlopentut


> 3. For the following snippet of code, is array2 created as a reference to
> array1? 
> @array1 = @array2; 

        perldoc perldata, perldoc perlreftut, perldoc perlref


> 4. Does the following snippet of code define a valid hash? 
> %myhash = ("1", "Steve", 
> "2", "Bob", 
> "A", "Frank");  

$ perl -wc <<EOT
%myhash = ("1", "Steve",
"2", "Bob",
"A", "Frank");
EOT
Name "main::myhash" used only once: possible typo at - line 1.


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 933-0600 x211(w)  |  scary questions." -- Jules                =(___)=
770 294-0820 (m)      |                                               U

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list