in reply to Parse float from string

You know, this really seems like it ought to be a really basic function in Perl. Perl is uber-powerful with text manipulation, why not add just a simple "make number" function? JavaScript does this. The "parseInt" and "parseFloat" functions are extremely useful. Maybe this belongs in meditations, but Perl's ability to think of scalars as either numbers of strings can be both useful and annoying at the same time. Maybe this is something to add into Perl 6?

Update: OK, I'm an idiot. Nevermind.

gryphon
code('Perl') || die;

Replies are listed 'Best First'.
Re: Re: Parse float from string
by rasta (Hermit) on Nov 06, 2002 at 08:37 UTC
    The function you are talking about already exists, it is strtod() from POSIX module.