[25528] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7772 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 11 18:05:39 2005

Date: Fri, 11 Feb 2005 15:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 11 Feb 2005     Volume: 10 Number: 7772

Today's topics:
        [perl-python] 20050211 generating expression by nested  <xah@xahlee.org>
        Adding Form elements dbmeyers23@yahoo.com
    Re: Adding Form elements <postmaster@castleamber.com>
    Re: Adding Form elements <nospam@bigpond.com>
    Re: Adding Form elements dbmeyers23@yahoo.com
    Re: Adding Form elements dbmeyers23@yahoo.com
    Re: Adding Form elements <jurgenex@hotmail.com>
        Adding From elements.... dbmeyers23@yahoo.com
        How to close a listening socket asynchronously <prilmeie@informatik.tu-muenchen.de>
    Re: How to close a listening socket asynchronously <1usa@llenroc.ude.invalid>
    Re: new to group, need a temperature perl script. <l.heisler@utoronto.ca>
    Re: new to group, need a temperature perl script. <matternc@comcast.net>
    Re: Perl - permute? <ajs@ajs.com>
        Sorting a Multi-dimenional Array <jason_mandal@yahoo.com>
    Re: Sorting a Multi-dimenional Array <toreau@gmail.com>
    Re: Sorting a Multi-dimenional Array <jason_mandal@yahoo.com>
    Re: Sorting a Multi-dimenional Array <jurgenex@hotmail.com>
    Re: Sorting a Multi-dimenional Array ioneabu@yahoo.com
    Re: Sorting a Multi-dimenional Array <spamtrap@dot-app.org>
    Re: Sorting a Multi-dimenional Array <jason_mandal@yahoo.com>
    Re: string and pattern problem <tajana@removeingko.com>
    Re: string and pattern problem <tajana@removeingko.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 11 Feb 2005 15:02:52 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: [perl-python] 20050211 generating expression by nested loops
Message-Id: <1108162972.047914.20780@l41g2000cwc.googlegroups.com>

# -*- coding: utf-8 -*-
# Python

# David Eppstein of the Geometry Junkyard fame gave this elegant
# version for returing all possible pairs from a range of n numbers.

def combo2(n):
    return dict([('%d,%d'%(i+1,j+1),(i+1,j+1)) for j in range(n) for i
in range(j)])
print combo2(5)

# this construct uses a irregular syntax to generate a expression
# built by nested loops.  Semantically, this expression generation is
# akin to applying a function to a tree. Morons in the computing
# industry and academia like to call this "list comprehension".

# In Python, this syntax irregularity works like this, for example:

# double each number from 1 to 5
myExpression = [ i*2 for i in range(1,6)]
print myExpression

# built a list of couples of the form (n*2,n*3)
myExpression = [ (i*2,i*3) for i in range(1,6)]
print myExpression

# in general the this expression generating syntax has the form
# [<expression> <iteration>]

# the iteration part can be nested.
myExpression = [ (i,j) for i in range(1,6) for j in range(1,4)]
print myExpression

# remember, this jargonized "list comprehension" is nothing more
than
# a irregular syntax for building a expression from nested loops.  Its
# purpose is primarily of syntactical convenience. Advanced languages
# such as functional languages often have this power without the
# syntax irregularity.

# For Python's official tutorial on this topic, see
# http://python.org/doc/tut/node7.html


#---------

# Perl does not contain facilities to generate expressions based on
# trees. Of course, one can just do with for loops. One can however
# write a function that are syntactically more succinct in generating
# expression thru trees than the so-called "list comprehension"),
See
# http://xahlee.org/PerlMathematica_dir/perlMathematica.html
# look for the function named Table.

his is Perl-Python a-day. To subscribe, see
http://xahlee.org/perl-python/python.html

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html



------------------------------

Date: 11 Feb 2005 13:10:42 -0800
From: dbmeyers23@yahoo.com
Subject: Adding Form elements
Message-Id: <1108156242.891845.307640@f14g2000cwb.googlegroups.com>

All,

I have a form with about 150 fields that I would like to have added
together automatically and the value placed into a new variable.
Below, you will  see my @list.  Below that, I'm going through @list and
only printing those values which have data (thanks to google.groups).

What I would like to do now, and I'm struggling a bit to do is add
these quantities together....so anywhere I see "addquantity", I would
like to keep adding the values until done..then place them in a new
variable.  Any hints??

 my @list = (

             [addzip2   => 'Additional Zip 2' ],
                 [addquantity2   => 'Additional Quantity 2' ],
                 [addzip3   => 'Additional Zip 3' ],
                 [addquantity3   => 'Additional Quantity 3' ],
                 [addzip4   => 'Additional Zip 4' ],
                 [addquantity4   => 'Additional Quantity 4' ],
                 [addzip5   => 'Additional Zip 5' ],
                 [addquantity5   => 'Additional Quantity 5' ],
                 [addzip6   => 'Additional Zip 6' ],
                 [addquantity6   => 'Additional Quantity 6' ],
);

for (@labels) {

        if ( $query->param( $$_[0] ) ) {

            print "$$_[1]: ", $query->param( $$_[0] ), "<br>";
            print INT_EMAIL "$$_[1]: ", $query->param( $$_[0] ), "\n";

                   }
    }



------------------------------

Date: 11 Feb 2005 21:53:17 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Adding Form elements
Message-Id: <Xns95FAA19EEAFD4castleamber@130.133.1.4>

 wrote:

> like to keep adding the values until done..then place them in a new
> variable.  Any hints??

+ ?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


------------------------------

Date: Sat, 12 Feb 2005 08:08:41 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Adding Form elements
Message-Id: <374on9F58cl3jU1@individual.net>

dbmeyers23@yahoo.com wrote:

> Any hints??

My hint is re-read your question. If you want to add then the + operator is
useful.

gtoomey


------------------------------

Date: 11 Feb 2005 14:12:42 -0800
From: dbmeyers23@yahoo.com
Subject: Re: Adding Form elements
Message-Id: <1108159962.111102.197370@f14g2000cwb.googlegroups.com>

Thanks for your feedback.



------------------------------

Date: 11 Feb 2005 14:15:24 -0800
From: dbmeyers23@yahoo.com
Subject: Re: Adding Form elements
Message-Id: <1108160124.653252.36880@f14g2000cwb.googlegroups.com>

I'm fully aware of the "+" operator....but I'm struggling with the
syntax of adding the params that only have data in them.  I'll tinker
some more.



------------------------------

Date: Fri, 11 Feb 2005 22:28:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Adding Form elements
Message-Id: <qkaPd.20648$wc.19833@trnddc07>

dbmeyers23@yahoo.com wrote:
> All,
>
> I have a form with about 150 fields that I would like to have added
> together automatically and the value placed into a new variable.
> Below, you will  see my @list.  Below that, I'm going through @list
> and only printing those values which have data (thanks to
> google.groups).
>
> What I would like to do now, and I'm struggling a bit to do is add
> these quantities together....so anywhere I see "addquantity", I would
> like to keep adding the values until done..then place them in a new
> variable.  Any hints??
>
> my @list = (
>
>             [addzip2   => 'Additional Zip 2' ],
>                 [addquantity2   => 'Additional Quantity 2' ],

Sorry, I think you lost me. Is this an array of references to one-element 
arrays of references to one-element hashes?

[...]

> for (@labels) {

Where does @labels come from? You don't define it anywhere.

>        if ( $query->param( $$_[0] ) ) {
>            print "$$_[1]: ", $query->param( $$_[0] ), "<br>";
>            print INT_EMAIL "$$_[1]: ", $query->param( $$_[0] ), "\n";


This $$_[1] looks suspiciously like a symbolic reference. Is that what you 
meant to be?

Sorry, I don't see any reference to addquantity in your code. Neither from 
you description nor from your code I can guess what you are trying to do.

jue 




------------------------------

Date: 11 Feb 2005 13:00:22 -0800
From: dbmeyers23@yahoo.com
Subject: Adding From elements....
Message-Id: <1108155622.428154.308160@c13g2000cwb.googlegroups.com>

All,

I have a form with about 150 fields that I would like to have added
together automatically and the value placed into a new variable.
Below, you will  see my @list.  Below that, I'm going through @list and
only printing those values which have data (thanks to google.groups).

What I would like to do now, and I'm struggling a bit to do is add
these quantities together....so anywhere I see "addquantity", I would
like to keep adding the values until done..then place them in a new
variable.  Any hints??




 my @list = (

             [addzip2   => 'Additional Zip 2' ],
                 [addquantity2   => 'Additional Quantity 2' ],
                 [addzip3   => 'Additional Zip 3' ],
                 [addquantity3   => 'Additional Quantity 3' ],
                 [addzip4   => 'Additional Zip 4' ],
                 [addquantity4   => 'Additional Quantity 4' ],
                 [addzip5   => 'Additional Zip 5' ],
                 [addquantity5   => 'Additional Quantity 5' ],
                 [addzip6   => 'Additional Zip 6' ],
                 [addquantity6   => 'Additional Quantity 6' ],
);


for (@labels) {

        if ( $query->param( $$_[0] ) ) {

            print "$$_[1]: ", $query->param( $$_[0] ), "<br>";
            print INT_EMAIL "$$_[1]: ", $query->param( $$_[0] ), "\n";

                   }
    }



------------------------------

Date: Fri, 11 Feb 2005 22:21:40 +0100
From: Franz Prilmeier <prilmeie@informatik.tu-muenchen.de>
Subject: How to close a listening socket asynchronously
Message-Id: <Pine.GSO.4.60.0502112210470.20810@sunhalle89>

Hi,

I want to write a simple SMTP server (As a side note with 
Net::SMTP::Server) for evaluating incoming mails. One of my objectives is 
having a proper server shutdown. I will try to argue on a code example:

-- Begin Perl Code --
#! /usr/bin/perl -w

use strict;

use IO::Socket;

my $pid;
my $socket = new IO::Socket::INET->new(LocalPort => 10025,
                                 Type      => SOCK_STREAM,
                                 Reuse     => 1,
                                 Listen    => 10 )
         or die "Couldn't be a tcp server on port 10025 : $@\n";
$| = 1;

FORK:
{
     $pid = fork;
     die "can't fork" unless defined $pid;

     if ( $pid )
     {
         print "Child\n";
         &run_server ( $socket );
         print "Child shutdown finished\n";
     }
     else
     {
         print "Parent\n";
         sleep 1;
         print "Parent shutdown\n";
         &stop_server ( $socket );
         print "Parent shutdown finished\n";
         exit
     }
}

sub run_server
{
     my $server = shift;
     my $client;

     while ( $client = $server-> accept () )
     {
         print "Incomming connection";
     }

     close ( $server );
}

sub stop_server
{
     my $server = shift;

     print "Entered Stop Server";
     close ( $server );
}
-- End of perl code --

A friend of mine already told me, that $server in the child might not the 
same object as $server in the parent thread. So this code example is 
plain wrong, but I hope it helps to get you my intention:

I want to be able to close a socket while it is listening (waiting for 
incoming connection via the accept call). In a different thread. And 
definitely not by killing the whole program. I want to be able to do this 
inside the same program. I haven't been able to find any proper solutions 
(except connecting to the socket in the stop method - which is not what I 
want to do either).

To be short: Is there a clean way to close a socket while it is listening 
for incoming connections?

Thanks in advance,
Franz
-- 
Kind regards, Franz Prilmeier
WWW: http://home.in.tum.de/~prilmeie/ E-Mail: prilmeie@acm.org
GPG Public Key available at:
http://home.in.tum.de/~prilmeie/gpg/prilmeie@acm.org.asc


------------------------------

Date: Fri, 11 Feb 2005 21:28:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to close a listening socket asynchronously
Message-Id: <Xns95FAA7AA43047asu1cornelledu@127.0.0.1>

Franz Prilmeier <prilmeie@informatik.tu-muenchen.de> wrote in
news:Pine.GSO.4.60.0502112210470.20810@sunhalle89: 

> To be short: Is there a clean way to close a socket while it is
> listening for incoming connections?


Does

perldoc -f shutdown

help?

Sinan


------------------------------

Date: Fri, 11 Feb 2005 17:33:49 GMT
From: "LEH" <l.heisler@utoronto.ca>
Subject: Re: new to group, need a temperature perl script.
Message-Id: <IBrCor.A4z@campus-news-reading.utoronto.ca>

> scupper79 wrote:
> > I access this through Outlook Express,
>
> So? Your choice of newsreader is your personal affair, it has no bearing
on
> where to find the Posting Guidelines.
>
> > where are the guidelines?
>
> I wonder how you missed them while reading the NG. They are posted here
> twice weekly.
>

I also use Outlook Express, and although I have often seen mention of the
guidelines being posted twice weekly, I have not seen them posted either(I
have looked them up though).  I do see the FAQs that are posted though.
Perhaps it is just a problem with OE and time to switch..but wondering if
other OE users are seeing them.
Larry




------------------------------

Date: Fri, 11 Feb 2005 14:52:20 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: new to group, need a temperature perl script.
Message-Id: <QredndHkQe1okZDfRVn-qg@comcast.com>

LEH wrote:

>> scupper79 wrote:
>> > I access this through Outlook Express,
>>
>> So? Your choice of newsreader is your personal affair, it has no bearing
> on
>> where to find the Posting Guidelines.
>>
>> > where are the guidelines?
>>
>> I wonder how you missed them while reading the NG. They are posted here
>> twice weekly.
>>
> 
> I also use Outlook Express, and although I have often seen mention of the
> guidelines being posted twice weekly, I have not seen them posted either(I
> have looked them up though).  I do see the FAQs that are posted though.
> Perhaps it is just a problem with OE and time to switch..but wondering if
> other OE users are seeing them.
> Larry

It is almost certainly not a problem with OE.  It is likely a problem 
with whoever runs your news server.  From some reason, Tad McClellan's
posting guidelines, which are indeed posted twice a week, get filtered
by some servers, which is really unfortunate.  Possibly their repetitive
nature leads some news admins to classify them as spam.  In any case,
Google Groups will find them for you.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


------------------------------

Date: Fri, 11 Feb 2005 16:32:07 -0500
From: Aaron Sherman <ajs@ajs.com>
Subject: Re: Perl - permute?
Message-Id: <420D2457.60004@ajs.com>

John Bokma wrote:
> phaylon wrote:

>>Ok, if you like: It depends on how one defines 'Internet'.

> Usenet can be (and is) transported over non-Internet. It has nothing to 
> do how you define Internet.

Wrong place to be having this discussion, guys, but you're both a bit 
off. To get specific:

Internet - The collection of "nodes" that comprise a global computer 
network which is based on IP (Internet Protocol).

Usenet - A message routing system first implemented via UUCP, and later 
widely used over the Internet.

And FWIW, since I'm sure we'll go there at some point:

World Wide Web - An addressing scheme where resources that can be 
accessed via a diverse set of protocols can be named using a single 
scheme called a URI (Universal Resource Indicator). URLs (Universal 
Resource Location, the most commonly used form of URI) combined with 
HTML (HyperText Markup Language) are the basis for a global hypertext 
system which makes use primarily of the HTTP protocol for file retrieval 
and query formulation.

That's all from my head, so feel free to quibble about details. Still, 
Intetnet != World Wide Web just as USENET != Internet. USENET predated 
the Internet and the Internet predated the World Wide Web.

Oh, and you can post under any name you like. Anyone who tells you 
otherwise is being a snot.


------------------------------

Date: 11 Feb 2005 13:55:22 -0800
From: "jason_mandal@yahoo.com" <jason_mandal@yahoo.com>
Subject: Sorting a Multi-dimenional Array
Message-Id: <1108158922.670689.23200@o13g2000cwo.googlegroups.com>

Hi,
   My data consists of something like this

 Column1  Column 2  Column 3  Column 4
 Name1     123e-10   34e-5    -1.0567e-8
 Name2     23e-10   4e-5    1.0567e-8
 Name3     13e-10   3e-5    -1.0567e-9
 Name4     12e-10   33e-5    .0011
Name5     123e-10   34e-5    -1.0567e-8


I need to sort this data with descending order on column 4.NOTE the
values are exponential and include both positive and negative
exponentials!!!
Also I do not want to lose any rows with same value in column 4.

Thanks in advance for your time

Jason



------------------------------

Date: Fri, 11 Feb 2005 23:00:35 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <8W9Pd.8567$IW4.199375@news2.e.nsc.no>

jason_mandal@yahoo.com wrote:
>    My data consists of something like this

"Something"?

>  Column1  Column 2  Column 3  Column 4
>  Name1     123e-10   34e-5    -1.0567e-8
>  Name2     23e-10   4e-5    1.0567e-8
>  Name3     13e-10   3e-5    -1.0567e-9
>  Name4     12e-10   33e-5    .0011
> Name5     123e-10   34e-5    -1.0567e-8
> 
> I need to sort this data with descending order on column 4.NOTE the
> values are exponential and include both positive and negative
> exponentials!!!
> Also I do not want to lose any rows with same value in column 4.

What have you tried so far? Have you read 'perldoc -q sort'?


-- 
Tore Aursand <tore@aursand.no>
"War is too serious a matter to entrust to military men." (Georges
  Clemenceau)


------------------------------

Date: 11 Feb 2005 14:19:04 -0800
From: "jason_mandal@yahoo.com" <jason_mandal@yahoo.com>
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <1108160344.410936.234850@z14g2000cwz.googlegroups.com>

With something I meant nothing. The data I am trying to sort has been
listed. I tried to seek help from perldoc, and I am able to sort for
integers, but when the numbers are exponential I have no clear idea of
how to use the sort function.
Use of <=> and cmp does not help as they do not understand exponential
values. Correct me if I am wrong

Thanks Tore



------------------------------

Date: Fri, 11 Feb 2005 22:42:09 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <5xaPd.20813$wc.8335@trnddc07>

jason_mandal@yahoo.com wrote:

Sorry, but I must have a bad day. I can't even remotely guess what you are 
talking about.

> With something I meant nothing.

What do you mean with this sentence? You don't reference the word 
'something' anywhere else in your post. Why are you saying you mean 
'nothing' when saying 'something'? BTW: wouldn't it be easier to just say 
'nothing' in the first place?

>  The data I am trying to sort has been
> listed.

Where? I can't seem to see it in this post.

>  I tried to seek help from perldoc,

Good.

> and I am able to sort for integers,

Seems you had some success

> but when the numbers are exponential I have no clear idea of
> how to use the sort function.
> Use of <=> and cmp does not help as they do not understand exponential
> values. Correct me if I am wrong

Please define "exponential number". Are you referring to scientific 
notations? That is only a notation and perl (i.e. the interpreter) doesn't 
care how you write a number. Internally it is always just a value.
Could you please provide a minimal sample program that demonstrates why you 
believe that cmp or <=> don't "understand" some numbers?

BTW: what do you mean by "understand"?

jue 




------------------------------

Date: 11 Feb 2005 14:49:02 -0800
From: ioneabu@yahoo.com
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <1108162142.065408.319830@l41g2000cwc.googlegroups.com>

jason_mandal@yahoo.com wrote:
> Hi,
>    My data consists of something like this
>
>  Column1  Column 2  Column 3  Column 4
>  Name1     123e-10   34e-5    -1.0567e-8
>  Name2     23e-10   4e-5    1.0567e-8
>  Name3     13e-10   3e-5    -1.0567e-9
>  Name4     12e-10   33e-5    .0011
> Name5     123e-10   34e-5    -1.0567e-8
>
>
> I need to sort this data with descending order on column 4.NOTE the
> values are exponential and include both positive and negative
> exponentials!!!
> Also I do not want to lose any rows with same value in column 4.
>
> Thanks in advance for your time
>
> Jason

I don't know if my logic and output are correct, but I think you need
something along these lines:

#!/usr/bin/perl

use strict;
use warnings;

open my $file, '<', 'test.dat' or die "error: $!\n";
my @data = <$file>;
close $file;
my @data2;
 use Math::BigFloat;
for (@data)
{
	if (/\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\.*/)
		{
			my $x = Math::BigFloat->new($4);
			push @data2, [$1,$2,$3,$x]
		}
}
sort {$a->[3]->bcmp($b->[3])} @data2 if @data2;
print "$_->[0]\t$_->[1]\t$_->[2]\t",$_->[3]->bsstr(),"\n" for @data2;


good luck!

wana



------------------------------

Date: Fri, 11 Feb 2005 17:57:58 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <pJWdndd1eMzlpZDfRVn-jQ@adelphia.com>

jason_mandal@yahoo.com wrote:

> With something I meant nothing. The data I am trying to sort has been
> listed. I tried to seek help from perldoc, and I am able to sort for
> integers, but when the numbers are exponential I have no clear idea of
> how to use the sort function.
> Use of <=> and cmp does not help as they do not understand exponential
> values. Correct me if I am wrong

Sorry - you are wrong. For example, this script:

    #!/usr/bin/perl

    use Data::Dumper;
    use warnings;
    use strict;

    my @numbers = (
            [ 'Name1', 123e-10, 34e-5, -1.0567e-8 ],
            [ 'Name2', 23e-10, 4e-5, 1.0567e-8 ],
            [ 'Name3', 13e-10, 3e-5, -1.0567-9 ],
            [ 'Name4', 12e-10, 33e-5, .0011 ],
            [ 'Name5', 123e-10, 34e-5, -1.0567e-8 ],
    );

    my @sorted = sort { $b->[3] <=> $a->[3] } @numbers;

    print Dumper(\@sorted);

Produces this output:

    $VAR1 = [
          [
            'Name4',
            '1.2e-09',
            '0.00033',
            '0.0011'
          ],
          [
            'Name2',
            '2.3e-09',
            '4e-05',
            '1.0567e-08'
          ],
          [
            'Name1',
            '1.23e-08',
            '0.00034',
            '-1.0567e-08'
          ],
          [
            'Name5',
            '1.23e-08',
            '0.00034',
            '-1.0567e-08'
          ],
          [
            'Name3',
            '1.3e-09',
            '3e-05',
            '-10.0567'
          ]
        ];

Notice that the above script's use of sort() is no different that it would
be if the key column were simple integers.

I suspect that you might be reading these numbers as strings from a text
file; when I quoted the test data in my script, Perl complained "Argument
### isn't numeric in numeric comparison", but sorted the list correctly
anyway. You can silence this warning by disabling it temporarily:

    ...
    no warnings 'numeric';
    my @sorted = sort { $b->[3] <=> $a->[3] } @numbers;
    use warnings;
    ...

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: 11 Feb 2005 14:58:46 -0800
From: "jason_mandal@yahoo.com" <jason_mandal@yahoo.com>
Subject: Re: Sorting a Multi-dimenional Array
Message-Id: <1108162726.076476.239670@g14g2000cwa.googlegroups.com>

I think I am being too careless in my words. Anyways yes exponential
meant scientific notation. In my code I was using cmp instead of <=>. I
have corrected it , and it works just fine.
Thanks JUE and TORE



------------------------------

Date: Fri, 11 Feb 2005 20:39:03 -0800
From: "Tajana" <tajana@removeingko.com>
Subject: Re: string and pattern problem
Message-Id: <420d08f2$1@news.s5.net>


> @@  Form for telephone number is XXX/XXXX-XXX or XXX/XXX-XXX or
XX/XXXX-XXX, so
> @@  I have problem with different number format.X is for numeric
> @@  3/4-3 or   3/3-3 or 2/4-3 number character
>
>     m![0-9]{2}(?:[0-9]/[0-9]?|/[0-9])[0-9]{3}-[0-9]{3}!g;

Thanks!
That is nice. Work, but I still don understand how that work.
I have some more possible format for phone number.
So new definition for phone number is something made by: [0-9], "/" and "-".
I don now length of phone number. (it possible that have more that one "/"
or "-")
Eg:
0047/367/5645-555
47/366/5555-5555-15
are also a phone number.

And please can you write some words about solutions, new and old also.

Thanks!




------------------------------

Date: Fri, 11 Feb 2005 21:22:52 -0800
From: "Tajana" <tajana@removeingko.com>
Subject: Re: string and pattern problem
Message-Id: <420d133a$1@news.s5.net>

> @@  Form for telephone number is XXX/XXXX-XXX or XXX/XXX-XXX or
XX/XXXX-XXX, so
> @@  I have problem with different number format.X is for numeric
> @@  3/4-3 or   3/3-3 or 2/4-3 number character
>
>     m![0-9]{2}(?:[0-9]/[0-9]?|/[0-9])[0-9]{3}-[0-9]{3}!g;

Thanks!
That is nice. Work, but I still don understand how that work.
I have some more possible format for phone number.
So new definition for phone number is something made by: [0-9], "/" and "-".
I don now length of phone number. (it possible that have more that one "/"
or "-")
Eg:
0047/367/5645-555
47/366/5555-5555-15
are also a phone number.

And please can you write some words about solutions, new and old also.

Thanks!




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7772
***************************************


home help back first fref pref prev next nref lref last post