use ucfirst instead of uc

-----Original Message-----
From: David Gilden [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 2001 12:28 PM
To: [EMAIL PROTECTED]
Subject: upper-casing the first char & hashs of hashs


Hello,


The following uppercase'S the whole string, when all I want is the first
letter.


&uppercase($bears->{"rec$n"}{name}), uc($bears->{"rec$n"}{type})  # works
but caps the whole string
} 

u\$bears->{"rec$n"}{type} # does not work...


sub uppercase{
($s) = @_;
\u$s = scalar $s;  ## does not work
return $s;
}


another version:

sub uppercase{
($s) = @_;

return uc($s);  # works but caps the whole string
}


lastly, in this hash of hashs..

$bears = {

    rec1 => {
                type =>  'sweater',
                name =>  'sweaterie',
                color => 'golden brown',
                food =>  'mixed beries',            
            },
        

one of many... more recs heres


}


is $ (scalar) $bears, correct? should not be %bears 


How would I get the lenght of $bears if I wanted to a:

for (0 ..  # true lenght of $bears )

and as it is, I can not do the following, that you would use will normal
hashs

foreach my $key (sort keys %bears ) {


Thanks & good day,

Dave G.
-------

*====================================================*
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/                   *  
*   Resources, Recordings, Instruments & More!       *
*====================================================*

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to