<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'to enter a phone no' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'to enter a phone no' posted on the 'Perl 6' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sun, 26 May 2013 01:06:52 -0700</pubDate>
    <lastBuildDate>Sun, 26 May 2013 01:06:52 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>to enter a phone no</title>
      <link>http://www.programmersheaven.com/mb/Perl6/359869/359869/to-enter-a-phone-no/</link>
      <description>hi  &lt;br /&gt;
   i want to get a errror message if  i enter a string value instead of integer in  a text field&lt;br /&gt;
         can anybody plz help me&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Perl6/359869/359869/to-enter-a-phone-no/</guid>
      <pubDate>Sat, 26 May 2007 03:02:52 -0700</pubDate>
      <category>Perl 6</category>
    </item>
    <item>
      <title>Re: to enter a phone no</title>
      <link>http://www.programmersheaven.com/mb/Perl6/359869/362691/re-to-enter-a-phone-no/#362691</link>
      <description>: hi  &lt;br /&gt;
:    i want to get a errror message if  i enter a string value instead &lt;br /&gt;
: of integer in  a text field&lt;br /&gt;
:          can anybody plz help me&lt;br /&gt;
: &lt;br /&gt;
Here's a couple different approaches:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&lt;span style="color: Blue;"&gt;sub check_area_code {
    my $file = "/path/error.log"
    my $LOGOUT = FileHandle-&amp;gt;new("&amp;gt;&amp;gt; ${file}") or die ("Can not write to ${file}: $!");
    my $len = do { length $area_code };

    if ( $len == 3 &amp;amp;&amp;amp; ( $area_code =~ /[0-9][0-9][0-9]/ ) &amp;amp;&amp;amp; (! ($area_code =~ /911/ )) ) {
         # do something...
    } else {
         print $LOGOUT "error invalid area code in phone number!\n";
    }
    $LOGOUT-&amp;gt;close();
}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
OR Have you tried setting up a condition like such and send in one char at a time:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&lt;span style="color: Blue;"&gt;if (! ($passed_var =~ /\d/) ) {

    print "passed_var is not a number!\n";
    # you could either print this to an error log file or to STDERR.
    # not sure what you wanted from here on. ?
    # or maybe set a variable to 0 and use it like a flag of some sorts.

} else {

    print "All is ok, we have a number.\n";
}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Hope that helps. &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt;&lt;br /&gt;
Regards,&lt;br /&gt;
JoeMc&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Perl6/359869/362691/re-to-enter-a-phone-no/#362691</guid>
      <pubDate>Tue, 03 Jul 2007 12:30:37 -0700</pubDate>
      <category>Perl 6</category>
    </item>
  </channel>
</rss>