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

Re: [MacPerl] Word Count Programme..



Sometime around 5/22/98 7:38 PM, Amitava Basu wrote something about:

[snip]
>chomp($TheLine);
>$LineCount = $LineCount + 1;
>$LineLength = Length($TheLine);
>$CharCount = $CharCount + $LineLen;
[snip]

     If this is a verbatim copy of the script.... the problem is that 
$LineLength becomes $LineLen throughout the rest of the script... so

A) the -w switch triggers the warning about # Name "main::LineLength" 
used only once: possible typo. (which is exactly what appears to be the 
problem... this is not really a MacPerl specific question though.. get a 
good editor like Alpha that supports word completion to keep your 
variables in order, and always use -w where possible, it's your friend  
;-) and

B) $LineLen is an empty variable (which would seem to be more a bug than 
a feature here, and

C) unless you have a sub called Length somewhere that we don't see in 
your snippet, try length instead (case is important)...

     If I recall correctly from some previous post you can't get the 
Camel book there... remember -- Shuck is your friend, and MacPerl ships 
with a lot of good documentation...

     And speaking of Shuck... are there any user-serviceable parts in 
there where I can convince it to output in other than Times or the 
default font?  Maybe I've been too busy (or lazy) to look at in in 
ResEdit, and maybe I'll look later, but if anyone knows offhand I'd like 
to hear about it... I use ProFont and/or MPW font in all my 
text/programming apps, and would like to see my pods in one of those 
fonts also...


thanx,

D. Beverly

--
Credendo vides -- "by believing, one sees..."


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