Is it only one Trailing white space or any trailing white space??
If any trailing white space , then you can do
$HASH{$key} =~ s/\s+$//;
If One ...
$HASH{$key} =~ s/\s+$//;
And then you can compare
if ($HASH{$key} eq $myVariable) {
}
-Original Message-
From: Alaric Joseph
oopsfor one you do
$HASH{$key} =~ s/\s$//;
-Original Message-
From: Shishir K. Singh
Sent: Tuesday, June 11, 2002 4:31 PM
To: Alaric Joseph Hammell; [EMAIL PROTECTED]
Subject: RE: chop off 1 white space?
Is it only one Trailing white space or any trailing white space
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
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
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
11, 2002 4:54 PM
To: [EMAIL PROTECTED]
Subject: Re: chop off 1 white space?
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
But, could someone explain the meaning of the $ in the above expression,
s/\s$// .
The $ looks for end of line/end of string. This is expression is saying
take the whitespace character followed by end of line and replace it with
nothing. If there is no whitespace character at the end of the
To all who answered my question, thank you very much. It was quite a
help. The idea was to remove the trailing white space character
permanently. I think I have enough to go on from here. Thank you again.
Al
Mark Anderson wrote:
But, could someone explain the meaning of the $ in the above