[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Perl and MacPerl Newbie



Is it appropriate for  beginners to ask question to this list? I know a little bit of regex via Nisus Writer and Frontier, I'm currently reading "Mastering Regular Expression" from E.F. Friedl and want to learn both Perl and MacPerl.

Anyway, if its ok here is my question. If its not, don't flame me please, and sorry for wasting your time. I will not do it again.

p. 35 of Mastering Regular Expression, Friedl give for example this script that is working in MacPerl (cool):

print "Enter a temp in Celsius:\n;
$Celsius=<STDIN>;
chop ($Celsius);

if ($Celsius =~m/^[0-9]+$/) {
	$far=($Celsius * 9 /5) +32;
	print "$Celsius C = $far F\n";
} else {
	print "Expecting a number, so don't understand \"$Celsius\".\n;
}

Then he say to "put this program into the file c2f" and run it like this:

% perl -w c2f

My question is: in what kind of MarPerl file shoud I save this code, and how can I invoque the file/program from MacPerl.

I look around the documentation (Silicot Primer, MacPerl FAQ) but I'm totally at lost.

Cheers

-Emmanuel

----------------------------------------------------------------
Emmanuel M. Dˇcarie - Histoire de l'art - Universitˇ de Montrˇal 
edecarie@aei.ca - http://mistral.ere.umontreal.ca/~decariee
     
  

 



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch