Link to home
Start Free TrialLog in
Avatar of kitwei
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.
ASKER CERTIFIED SOLUTION
Avatar of maneshr
maneshr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
#You mean
chomp($temp);
#or
chop($temp);
Avatar of kitwei
kitwei

ASKER

chomp and chop don't need to be assigned to $temp again, else I get nothing, but they all work.
thanks