Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: A function to determine if a string is numeric

by toolic (Bishop)
on Feb 24, 2012 at 00:46 UTC ( #955847=note: print w/replies, xml ) Need Help??

in reply to A function to determine if a string is numeric


This is also a FAQ: perldoc -q number

use warnings; use strict; use Scalar::Util qw(looks_like_number); my $s = shift; if (looks_like_number($s)) { print "$s is a number\n"; } else { print "$s isn't a number\n"; }

Replies are listed 'Best First'.
Re^2: A function to determine if a string is numeric
by juliosergio (Sexton) on Feb 24, 2012 at 00:56 UTC

    Hey! Thanks!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955847]
[james28909]: id just rename the subrouties perl what kind of data they are getting. something easy to remember too. like if get_data were returning movies titles, rename get_data to movies or movie_titles or get_movie_titles.
[james28909]: s/perl/per/
[james28909]: but i dont really know what your end goal is. if it works dont fix it lol
[Lady_Aleena]: james28909, I use get_data in a subroutine called movies.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2017-05-24 04:30 GMT
Find Nodes?
    Voting Booth?