Thanks. Can you please explain the reg. expression in more detail.
Please --Irfan. Project Lead TSINDIA - Production Line Individual Software Solutions - UMO T-Systems India Private Limited, Pune Telephone: +91-20-30245000/25605000 (Extn: 5271) Mobile: +91 9822 854 227 Fax: ++91-020 25674090 Internet: http://www.t-systems.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yitzle Sent: Wednesday, March 05, 2008 2:12 AM To: Rodrick Brown Cc: Sayed, Irfan; beginners@perl.org Subject: Re: variable help This approach does not consider "0" to be an integer. I'd use a RegEx and test to see if the string is made up entirely of integers. print "The variable containing $p is an interger\n" if ($p =~ /^[0-9]+$/); On Tue, Mar 4, 2008 at 3:19 PM, Rodrick Brown <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perl > > my $p = 10; > > if( int($p) ) { > print "$p is an interger\n"; > } > ~ > > > > > On Tue, Mar 4, 2008 at 3:16 PM, <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > > > > > How to find out the specific variable contains integer value. In my > > script ,variable is storing some value but I want to find out whether > > that value is string or integer. > > > > > > > > Please help > > > > > > > > Regards > > > > Irfan. > > > > > > > > -- > Rodrick R. Brown > http://www.rodrickbrown.com > http://www.linkedin.com/in/rodrickbrown > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/