At 01:34 PM 6/11/02 -0700, I wrote:
>At 04:26 PM 6/11/02 -0400, Alaric Joseph Hammell wrote:
>
>>How would I get rid of one trailing white space character in
>>$HASH{$key} and reassign the result
>
>If you're certain that the last character is a space:
>
>         chop $HASH{$key};
>
>If it might not be a space, and you only want to get rid of the last 
>character if it is a space:
>
>         $HASH{$key} =~ s/ $//;

Oops, I missed the "white" part of "white space".  Then the question is 
whether you intend "white space" to include newline.  Assuming you don't 
(which is Perl's definition of "white space"), then:

         $HASH{$key} =~ s/\s$//;

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/


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

Reply via email to