kitwei
asked on
scalar question
Hi there, I'm new to Perl.
How do I remove the last character of a scalar?
For example, I have
$temp = "1234\n";
I want to get rid of the '\n', is there a function, or a regular operation to do that?
Thanks much.
How do I remove the last character of a scalar?
For example, I have
$temp = "1234\n";
I want to get rid of the '\n', is there a function, or a regular operation to do that?
Thanks much.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
chomp and chop don't need to be assigned to $temp again, else I get nothing, but they all work.
thanks
thanks
chomp($temp);
#or
chop($temp);