You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Simon Burns <sb...@chec.scu.edu.au> on 2000/10/24 05:17:06 UTC
Formatting a variable?
Dear Sir/Madam
How do you format a variable to delete the first character of the variable
using mod perl?
I am trying to delete a ($) dollar sign from a price that I have in a
varibale called $price.
I thank you for any help that you can provide.
Simon Burns
Re: Formatting a variable?
Posted by Angus Lees <gu...@switchonline.com.au>.
On Tue, Oct 24, 2000 at 01:17:06PM +1000, Simon Burns wrote:
> How do you format a variable to delete the first character of the variable
> using mod perl?
> I am trying to delete a ($) dollar sign from a price that I have in a
> varibale called $price.
basic perl stuff, see perlre(1p) or a perl book
$price =~ s/^\$//;
`$' is a special regex character, so you have to escape it.
--
- Gus