[ale] Perl monks ?

James P. Kinney III jkinney at localnetsolutions.com
Wed May 1 15:08:22 EDT 2002


On Wed, 2002-05-01 at 14:11, Mazukna, Thomas wrote:
> 1. Is the following snippet a valid piece of Perl code? 
> s/[Tt]he\s/a/gis; 

Only if it has a $variable ~= in front (unless in commandline mode).
Then it will substitute "a" for "The " or "the "

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

No. Default open mode is read only.

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

No. array1 is now a copy of array2. Assignment is from right to left.

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

Yes.
> 
> ---
> 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.
> 
-- 
James P. Kinney III   \Changing the mobile computing world/
President and CEO      \          one Linux user         /
Local Net Solutions,LLC \           at a time.          /
770-493-8244             \.___________________________./

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 



---
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