[25809] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8048 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 4 09:05:44 2005

Date: Wed, 4 May 2005 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 4 May 2005     Volume: 10 Number: 8048

Today's topics:
        How do I parse certain "bits" out of bytes? <schneiderNOSPAM@N0SPAM.pobox.com>
    Re: How do I parse certain "bits" out of bytes? <josef.moellers@fujitsu-siemens.com>
    Re: How do I parse certain "bits" out of bytes? (Anno Siegel)
    Re: How do I parse certain "bits" out of bytes? <sisyphus1@nomail.afraid.org>
    Re: How do I parse certain "bits" out of bytes? <schneiderNOSPAM@N0SPAM.pobox.com>
    Re: How do I parse certain "bits" out of bytes? <schneiderNOSPAM@N0SPAM.pobox.com>
    Re: How do I parse certain "bits" out of bytes? <josef.moellers@fujitsu-siemens.com>
    Re: How do I parse certain "bits" out of bytes? <sisyphus1@nomail.afraid.org>
    Re: How do I parse certain "bits" out of bytes? <do-not-use@invalid.net>
    Re: How do I parse certain "bits" out of bytes? <pilkowsk@informatik.uni-marburg.de>
        How to parse .... <gis86508@cissol1.cis.nctu.edu.tw>
    Re: How to parse .... <noreply@gunnar.cc>
    Re: Net::SMTP in a chroot jail - can't initialise the c <pete@smtl.co.uk>
        regular expression <bckumari@yahoo.com>
    Re: regular expression <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: regular expression <bernard.el-haginDODGE_THIS@lido-tech.net>
    Re: regular expression <pilkowsk@informatik.uni-marburg.de>
    Re: regular expression (Anno Siegel)
    Re: regular expression <bckumari@yahoo.com>
    Re: REMOTE_HOST aint working <joe@inwap.com>
    Re: start_table problem (Anno Siegel)
    Re: start_table problem <noreply@gunnar.cc>
    Re: start_table problem (Anno Siegel)
        The Perl Review, Summer 2005 <comdog@panix.com>
    Re: The Perl Review, Summer 2005 <john@castleamber.com>
    Re: The Perl Review, Summer 2005 <nospam@bigpond.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 03 May 2005 23:46:31 -0700
From: Adam Schneider <schneiderNOSPAM@N0SPAM.pobox.com>
Subject: How do I parse certain "bits" out of bytes?
Message-Id: <030520052346318850%schneiderNOSPAM@N0SPAM.pobox.com>


Here's a completely hypothetical example:

I have a binary file containing one byte: hex 65, or "e" in text.  I
can get perl to read it and tell me that this is "01100101" in binary. 
But hidden in here are two pieces of information: the first 5 bytes are
a number ranging from 0 to 32 and the last 3 bytes are another number
between 0 and 8.  I need those two decimal numbers (in this case, 12
and 5) put into two variables.

I have read all the documentation on "pack," "unpack," "vec," bitwise
operators, and everything else, and I still have no idea how to extract
a few bits out of a longer string of bytes.  The help files all seem to
have been written with the assumption that I majored in computer
science and learned how to program years ago in some pre-Perl language
-- which I did not.

Can someone please pass along a simple solution that will make sense to
someone who doesn't know the hardcore geeky stuff?  I know it's out
there, I just can't find it.  (The closest I came was "vec," but it
doesn't let you ask for chunks that aren't powers of 2.)


Thanks in advance,

Adam Schneider
Portland, OR


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

Date: Wed, 04 May 2005 09:33:03 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <d59tml$io3$1@nntp.fujitsu-siemens.com>

Adam Schneider wrote:
> Here's a completely hypothetical example:
>=20
> I have a binary file containing one byte: hex 65, or "e" in text.  I
> can get perl to read it and tell me that this is "01100101" in binary. =

> But hidden in here are two pieces of information: the first 5 bytes are=

> a number ranging from 0 to 32 and the last 3 bytes are another number
> between 0 and 8.  I need those two decimal numbers (in this case, 12
> and 5) put into two variables.
>=20
> I have read all the documentation on "pack," "unpack," "vec," bitwise
> operators, and everything else, and I still have no idea how to extract=

> a few bits out of a longer string of bytes.  The help files all seem to=

> have been written with the assumption that I majored in computer
> science and learned how to program years ago in some pre-Perl language
> -- which I did not.
>=20
> Can someone please pass along a simple solution that will make sense to=

> someone who doesn't know the hardcore geeky stuff?  I know it's out
> there, I just can't find it.  (The closest I came was "vec," but it
> doesn't let you ask for chunks that aren't powers of 2.)

Perl knows shift and logical operators:

$n1 =3D ($n >> 3) & 0x1f;
$n2 =3D $n & 7;

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: 4 May 2005 07:33:04 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <d59trg$sm$2@mamenchi.zrz.TU-Berlin.DE>

Adam Schneider  <schneiderNOSPAM@N0SPAM.pobox.com> wrote in comp.lang.perl.misc:
> 
> Here's a completely hypothetical example:
> 
> I have a binary file containing one byte: hex 65, or "e" in text.  I
> can get perl to read it and tell me that this is "01100101" in binary. 
> But hidden in here are two pieces of information: the first 5 bytes are
> a number ranging from 0 to 32 and the last 3 bytes are another number
> between 0 and 8.  I need those two decimal numbers (in this case, 12
> and 5) put into two variables.

Bytes or bits?  Please keep them apart.

> I have read all the documentation on "pack," "unpack," "vec," bitwise
> operators, and everything else, and I still have no idea how to extract
> a few bits out of a longer string of bytes.  The help files all seem to
> have been written with the assumption that I majored in computer
> science and learned how to program years ago in some pre-Perl language
> -- which I did not.

Whatever...

> Can someone please pass along a simple solution that will make sense to
> someone who doesn't know the hardcore geeky stuff?  I know it's out
> there, I just can't find it.  (The closest I came was "vec," but it
> doesn't let you ask for chunks that aren't powers of 2.)

Use the bitwise operators after turning the character into a number:

    my $char = 'e';
    my $bottom_three = ord( $char) & oct '0b111';
    my $top_five     = ord( $char) >> 3;

Anno



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

Date: Wed, 4 May 2005 17:39:22 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <42787c07$0$10303$afc38c87@news.optusnet.com.au>


"Adam Schneider" <schneiderNOSPAM@N0SPAM.pobox.com> wrote in message
news:030520052346318850%schneiderNOSPAM@N0SPAM.pobox.com...
>
> Here's a completely hypothetical example:
>
> I have a binary file containing one byte: hex 65, or "e" in text.  I
> can get perl to read it and tell me that this is "01100101" in binary.
> But hidden in here are two pieces of information: the first 5 bytes are
> a number ranging from 0 to 32 and the last 3 bytes are another number
> between 0 and 8.  I need those two decimal numbers (in this case, 12
> and 5) put into two variables.
>
> I have read all the documentation on "pack," "unpack," "vec," bitwise
> operators, and everything else, and I still have no idea how to extract
> a few bits out of a longer string of bytes.  The help files all seem to
> have been written with the assumption that I majored in computer
> science and learned how to program years ago in some pre-Perl language
> -- which I did not.
>
> Can someone please pass along a simple solution that will make sense to
> someone who doesn't know the hardcore geeky stuff?  I know it's out
> there, I just can't find it.  (The closest I came was "vec," but it
> doesn't let you ask for chunks that aren't powers of 2.)
>

There's lots of ways. When dealing with bits I like to use the bitwise
operators - here's one simple, none-too-cute way of doing the job using
them:

use warnings;
use strict;

my $n = 0x65;
my $last_three_bits = $n & 7; # 7 = 2**3 - 1
print $last_three_bits, "\n";

#Finished with the last 3 bits, so remove them:
$n >>= 3;

my $first_five_bits = $n;
print $first_five_bits, "\n";

__END__

Cheers,
Rob




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

Date: Wed, 04 May 2005 02:32:27 -0700
From: Adam Schneider <schneiderNOSPAM@N0SPAM.pobox.com>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <040520050232276275%schneiderNOSPAM@N0SPAM.pobox.com>

Josef Moellers wrote:
>
> Perl knows shift and logical operators:
> 
> $n1 = ($n >> 3) & 0x1f;
> $n2 = $n & 7;

But what's actually going on here?  To a layperson, the meanings of the
terms "shift" and "logical operators" are opaque in this context and do
not obviously correlate with the ">>" and "&" symbols in those
statements.  (What do the operators do?  Why have you used 0x1f there?)

If someone can point me to a page somewhere that will explain how to
use these sorts of things, starting from square one, I'd appreciate it. 
As I said, the documentation on these subjects is useless for those of
us who don't know the old-school programming terminology.



Adam Schneider
Portland, OR


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

Date: Wed, 04 May 2005 02:35:12 -0700
From: Adam Schneider <schneiderNOSPAM@N0SPAM.pobox.com>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <040520050235126173%schneiderNOSPAM@N0SPAM.pobox.com>

Anno Siegel wrote:
>
> Adam Schneider wrote in comp.lang.perl.misc:
> > 
> > I have a binary file containing one byte: hex 65, or "e" in text.  I
> > can get perl to read it and tell me that this is "01100101" in binary. 
> > But hidden in here are two pieces of information: the first 5 bytes are
> > a number ranging from 0 to 32 and the last 3 bytes are another number
> > between 0 and 8.  I need those two decimal numbers (in this case, 12
> > and 5) put into two variables.
> 
> Bytes or bits?  Please keep them apart.

Oops.  I meant 5 bits and 3 bits, of course.


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

Date: Wed, 04 May 2005 11:47:02 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <d5a5gq$3k5$1@nntp.fujitsu-siemens.com>

Adam Schneider wrote:
> Josef Moellers wrote:
>=20
>>Perl knows shift and logical operators:
>>
>>$n1 =3D ($n >> 3) & 0x1f;
>>$n2 =3D $n & 7;
>=20
>=20
> But what's actually going on here?  To a layperson, the meanings of the=

> terms "shift" and "logical operators" are opaque in this context and do=

> not obviously correlate with the ">>" and "&" symbols in those
> statements.  (What do the operators do?  Why have you used 0x1f there?)=


Sory, I thought if someone programmed in Perl, (s)he isn't a "layperson".=


> If someone can point me to a page somewhere that will explain how to
> use these sorts of things, starting from square one, I'd appreciate it.=
=20
> As I said, the documentation on these subjects is useless for those of
> us who don't know the old-school programming terminology.

You'll definitely need a good book on the basics of computers and=20
programming.

You posed a question that you needed to dissect a given byte into two=20
bitfields. I gave the answer. If you do not understand the answer, the=20
problem may be beyond your knowledge of computing and how computers=20
work. Sorry if I sound too rude, but you do not seem to be very willing=20
to pick up hints and suggestions (and even a solution) and do some work=20
on your own.

As for the perl-specifics: "perldoc perlop" is a good starter, as would=20
be the camel book.

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Wed, 4 May 2005 20:30:58 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <4278a43f$0$8119$afc38c87@news.optusnet.com.au>


"Adam Schneider" <schneiderNOSPAM@N0SPAM.pobox.com> wrote in message
news:040520050232276275%schneiderNOSPAM@N0SPAM.pobox.com...
> Josef Moellers wrote:
> >
> > Perl knows shift and logical operators:
> >
> > $n1 = ($n >> 3) & 0x1f;
> > $n2 = $n & 7;
>
> But what's actually going on here?

Just play around with some code .... you'll soon work out what's happening.

use warnings;
use strict;

my $z1 = int(rand(256));
my $z2 = int(rand(256));

printf("AND\n%08b\n%08b\n%08b\n\nOR\n%08b\n%08b\n%08b\n\nXOR\n%08b\n%08b\n%0
8b\n\n",
        $z1, $z2, $z1&$z2, $z1, $z2, $z1|$z2, $z1, $z2, $z1^$z2);

for(1..8) {
printf("%08b\n", $z1);
$z1 = $z1 >> 1;
}

print "\n\n";

$z1 = 3;

for(1..7) {
printf("%08b\n", $z1);
$z1 = $z1 << 1;
}

__END__

Cheers,
Rob




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

Date: 04 May 2005 12:56:05 +0200
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <yzdwtqfz2d6.fsf@invalid.net>


Adam Schneider <schneiderNOSPAM@N0SPAM.pobox.com> writes:
> Josef Moellers wrote:
> >
> > Perl knows shift and logical operators:
> > 
> > $n1 = ($n >> 3) & 0x1f;
> > $n2 = $n & 7;
> 
> But what's actually going on here?  To a layperson, the meanings of the
> terms "shift" and "logical operators" are opaque in this context and do
> not obviously correlate with the ">>" and "&" symbols in those
> statements.  (What do the operators do?  Why have you used 0x1f there?)
> 
> If someone can point me to a page somewhere that will explain how to
> use these sorts of things, starting from square one, I'd appreciate it. 
> As I said, the documentation on these subjects is useless for those of
> us who don't know the old-school programming terminology.

What would a new-school programming terminology be?

An imaginary language might write it this way:

n1 = (n RIGHT_SHIFT 3) AND BINARY(11111);
n2 = n AND BINARY(111);

Does that help? Perl does have a way of specifying numbers in binary,
by the way: 0b11111.


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

Date: Wed, 4 May 2005 13:29:35 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: How do I parse certain "bits" out of bytes?
Message-Id: <3drpv7F70g2r7U1@individual.net>

* Adam Schneider schrieb:
> Josef Moellers wrote:
>>
>> Perl knows shift and logical operators:
>> 
>> $n1 = ($n >> 3) & 0x1f;
>> $n2 = $n & 7;
> 
> But what's actually going on here?  To a layperson, the meanings of the
> terms "shift" and "logical operators" are opaque in this context and do
> not obviously correlate with the ">>" and "&" symbols in those
> statements.  (What do the operators do?  Why have you used 0x1f there?)

Let's assume $n contains one byte, e.g. 0x65. Its decimal representation
is 101, and its binary one is 0b01100101. First, have a look at this
shift operator -- just shift all the bits by 3 positions to the right.
Since shifting is null-padded you'll get

    0b01100101 >> 3 = 0b00001100 = 12

Simplified, this just cuts off the last three bits. The trailing "&0x1f"
(or "&0b00011111") part ensures that only the last 5 bits are used. This
could be only a problem if there are more than 8 bits stored in $n.

The second statement uses the bitwise "and" operator. You could write it
as "$n & 0b111" instead -- to better see what it does. Bitwise "&" means
to capture only those bits which are true in both summands. Here, you'll
get the last 3 bits, by cutting off the first 5 bits.

      0b01100101
    & 0b00000111
    ------------
      0b00000101 = 5

> 
> If someone can point me to a page somewhere that will explain how to
> use these sorts of things, starting from square one, I'd appreciate it. 
> As I said, the documentation on these subjects is useless for those of
> us who don't know the old-school programming terminology.

Sure. I could refer to `perldoc perlop` where all these bit operators
are described, but for shifting I just read this:

    Binary ``>>'' returns the value of its left argument shifted right
    by the number of bits specified by the right argument. Arguments
    should be integers. (See also Integer Arithmetic.)
    Note that both ``<<'' and ``>>'' in Perl are implemented directly
    using ``<<'' and ``>>'' in C. 

Well, it is hard to understand if someone knows nearly nothing about
binary digits, but it describes what it does. Certainly, someone who
wants to deal with binary data has to learn something about these low
level basics. Of course, these basics aren't Perl specific ... ;-)

regards,
fabian


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

Date: Wed, 4 May 2005 10:48:01 +0000 (UTC)
From: stratus <gis86508@cissol1.cis.nctu.edu.tw>
Subject: How to parse ....
Message-Id: <d5a991$1sul$1@news.cis.nctu.edu.tw>

	I have a command like the following :
		-begin [xxxxxx] -through [xxxxx \
		xxxxxx\
		xxxxx \
		] -end [xxxxx \
			xxxxx\
			]

	And I want to add some contents before and after the bracket [] if
	has the keyword "begin" "end"

	Like -begin +++++++[xxxxxxx]++++++ -through [xxxxx \
		xxxxxx\
		xxxxx \
		] -end +++++++[xxxxx \
			       xxxxx\
			       ]+++++

	How to do this ?



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

Date: Wed, 04 May 2005 13:04:41 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to parse ....
Message-Id: <3drokgF6t3pbiU1@individual.net>

stratus wrote:
> 	I have a command like the following :
> 		-begin [xxxxxx] -through [xxxxx \
> 		xxxxxx\
> 		xxxxx \
> 		] -end [xxxxx \
> 			xxxxx\
> 			]
> 
> 	And I want to add some contents before and after the bracket [] if
> 	has the keyword "begin" "end"
> 
> 	Like -begin +++++++[xxxxxxx]++++++ -through [xxxxx \
> 		xxxxxx\
> 		xxxxx \
> 		] -end +++++++[xxxxx \
> 			       xxxxx\
> 			       ]+++++
> 
> 	How to do this ?

Use the s/// operator.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 04 May 2005 09:12:59 +0100
From: Pete Phillips <pete@smtl.co.uk>
To:  qglex@yahoo.com
Subject: Re: Net::SMTP in a chroot jail - can't initialise the connection [Problem solved]
Message-Id: <4278840B.5060301@smtl.co.uk>

J. Gleixner wrote:

> The new() failed.
> 
> Always do your own error checking!
> 
> use Net::SMTP;
> use strict;
> use warnings;
> 
> my $smtp = Net::SMTP->new('mailhost')
>               or die "Net::SMTP new() failed: $@";

Having made this addition, the error message in my apache log was:

  Net::SMTP new() failed: Net::SMTP: Bad protocol 'tcp' at 
/perl/www-feedback.cgi line 108.\n

Found a solution at:
	http://www.perlmonks.org/index.pl?node_id=374524

Basically my chroot jail had /etc/protocols missing. Adding that to 
/chroot/etc fixed my problem.

Thanks
Pete


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

Date: Wed, 04 May 2005 07:33:44 -0400
From: "kums" <bckumari@yahoo.com>
Subject: regular expression
Message-Id: <dbd3cc188c6ba28d498f3273a657cfdf@localhost.talkaboutprogramming.com>

i want to insert comma among the digits in the given no.
  For ex i have $num=12345678
 i want to insert comma like 1,23,45,678

that is insert comma from right.
first comma will be inserted after 3 digits and then after each 2 digits.

code should contain maximum of 3 lines.
how to write a regular expression?



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

Date: 04 May 2005 11:46:20 GMT
From: "Mark Clements" <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: regular expression
Message-Id: <4278b60c$0$842$8fcfb975@news.wanadoo.fr>

kums wrote:

> i want to insert comma among the digits in the given no.
>   For ex i have $num=12345678
>  i want to insert comma like 1,23,45,678
> 
> that is insert comma from right.
> first comma will be inserted after 3 digits and then after each 2
> digits.
> 
> code should contain maximum of 3 lines.
> how to write a regular expression?

It's traditional to actually try something before asking for help here.
What have you tried so far? What happened? If this is homework, you'll
get more benefit from the class if you do some work yourself.

Mark


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

Date: Wed, 4 May 2005 13:43:35 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: regular expression
Message-Id: <Xns964C8BA209B18elhber1lidotechnet@62.89.127.66>

"kums" <bckumari@yahoo.com> wrote:

> i want to insert comma among the digits in the given no.
>   For ex i have $num=12345678
>  i want to insert comma like 1,23,45,678
> 
> that is insert comma from right.
> first comma will be inserted after 3 digits and then after each 2
> digits. 
> 
> code should contain maximum of 3 lines.


Why?


> how to write a regular expression?


Use s///.


-- 
Cheers,
Bernard


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

Date: Wed, 4 May 2005 13:51:43 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: regular expression
Message-Id: <3drr8iF6gevrfU1@individual.net>

* kums schrieb:

> i want to insert comma among the digits in the given no.
>   For ex i have $num=12345678
>  i want to insert comma like 1,23,45,678
> 
> that is insert comma from right.
> first comma will be inserted after 3 digits and then after each 2 digits.

That's similar to a FAQ. Please read `perldoc -q commas`.

    Found in C:\Programme\Perl\lib\pod\perlfaq5.pod
        How can I output my numbers with commas added?
        This subroutine will add commas to your number:

            sub commify {
                local $_  = shift;
                1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
                return $_;
            }

Sure, here the commas are inserted after each 3 digits but try to modify
it by yourself.

> 
> code should contain maximum of 3 lines.
> how to write a regular expression?

Why your solution should be in maximal 3 lines? What do you do when you
need 4 lines to solve this problem? Why use an regex and nothing else?
Is this some schoolwork we should do for you?

regards,
fabian


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

Date: 4 May 2005 11:59:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regular expression
Message-Id: <d5adep$aa8$3@mamenchi.zrz.TU-Berlin.DE>

kums <bckumari@yahoo.com> wrote in comp.lang.perl.misc:
> i want to insert comma among the digits in the given no.
>   For ex i have $num=12345678
>  i want to insert comma like 1,23,45,678
> 
> that is insert comma from right.
> first comma will be inserted after 3 digits and then after each 2 digits.
> 
> code should contain maximum of 3 lines.

Oh goody.  Do you want it on a silver platter?

See if perldoc -q "numbers with commas" helps.  If not, show us what
you tried and we may be able to help.

Anno


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

Date: Wed, 04 May 2005 08:23:34 -0400
From: "kums" <bckumari@yahoo.com>
Subject: Re: regular expression
Message-Id: <f0e68bc0da9eb19b3a033f12521b8140@localhost.talkaboutprogramming.com>

Already i have written that program.
look at below. but i want to reduce the line of code
#! /usr/bin/perl

$num = <stdin>;
chomp($num);
$len = length($num);
if($len <=3){
        $final = $num;
}
else{
   if($len %2 == 0){
        if($num =~ /^(\d)((\d{2})*)?(\d{3})$/){
                $two = $2;
                $start = $1;
                $end = $4;
                $mid ="";
                while($two =~ /(\d{2})/g){
                        $mid = $mid.",".$1;
                }
                print "MID : $mid\n";
        }
   }
   else{
        if($num =~ /^(\d{2})((\d{2})*)?(\d{3})$/){
                $two = $2;
                $start = $1;
                $end = $4;
                $mid ="";
                while($two =~ /(\d{2})/g){
                        $mid = $mid.",".$1;
                }
                print "MID : $mid\n";
        }
   }
   $final = $start.$mid.",".$end;
}
print "final : $final\n";



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

Date: Tue, 03 May 2005 20:31:53 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: REMOTE_HOST aint working
Message-Id: <i_OdnbbPF9O23-XfRVn-jw@comcast.com>

Nikos wrote:
> Joe Smith wrote:
>> http://httpd.apache.org/docs/mod/core.html
>>
> Yes its, HostnameLookups on
> 
> but how di you searched this? i serached it too but didnt find it.

It is the very first match for "Host" in that file.
	-Joe


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

Date: 4 May 2005 08:51:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: start_table problem
Message-Id: <d5a2e5$339$1@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Mark Clements wrote:
> > I may have to abandon reading this newsgroup: there is little point
> > in killfiling you because you generate so much traffic
> 
> And *that* is not Nikos' fault, is it?

It is an immediate consequence of his behavior.

Anno


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

Date: Wed, 04 May 2005 12:22:38 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: start_table problem
Message-Id: <3drm5hF5np4hiU1@individual.net>

Anno Siegel wrote:
> Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
>> Mark Clements wrote:
>>> I may have to abandon reading this newsgroup: there is little point
>>> in killfiling you because you generate so much traffic
>>
>> And *that* is not Nikos' fault, is it?
> 
> It is an immediate consequence of his behavior.

True, of course, but...  Don't we who respond have an option? Are we 
just helpless victims of the circumstances?

Don't think so.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 4 May 2005 11:44:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: start_table problem
Message-Id: <d5acjb$aa8$2@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> >> Mark Clements wrote:
> >>> I may have to abandon reading this newsgroup: there is little point
> >>> in killfiling you because you generate so much traffic
> >>
> >> And *that* is not Nikos' fault, is it?
> > 
> > It is an immediate consequence of his behavior.
> 
> True, of course, but...  Don't we who respond have an option? Are we 
> just helpless victims of the circumstances?

Individually we have a choice.  As a collective, there will always be
*someone* who can't let a certain provocation slip by.  Given the number
of provocations, the kind of thread we are seeing is hardly avoidable.

Anno


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

Date: Tue, 03 May 2005 23:55:56 -0500
From: brian d foy <comdog@panix.com>
Subject: The Perl Review, Summer 2005
Message-Id: <030520052355566966%comdog@panix.com>

We've made it through a whole year! The fourth print issue of The Perl
Review is going to the presses soon and will be available during the
first week of June. so you have time to get your name on the
subscriber list.  TPR is the only print magazine devoted to Perl.

   http://www.theperlreview.com/?clpm

Issue 1.3, Summer 2005

   * Programming Glade in Perl - Grant McLean
   
   * Array Anti-Patterns - Alberto Manuel Simões
   
   * Test::Random - David Golden
   
   * Serious Perl - Henning Koch

   * The pVoice Project - Jim Brandt
   
   plus Perl News, Perl Mongers and Perl Foundation reports, book
   reviews, short notes, and more.

You can also read a interview with Mark Jason Dominus, author of Higher
Order Perl, for free on our website:

   http://www.theperlreview.com/Interviews/mjd-hop-20050407.html

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

Issue 1.2, Spring 2005

   * Hashes with History -- Alberto Manuel Simões

   * Test::Number::Delta -- David Golden

   * 9-Block Quilt Patterns in Perl -- Daniel Allen

   * Packet Sniffing with Perl -- Gerry Finkel

   plus Perl News, Perl Mongers and Perl Foundation reports, book
   reviews, short notes, and more.

Issue 1.1, Winter 2004

   * Down Translating XML -- Alberto Manuel Simões

   * Module::Release and Beyond -- brian d foy

   * Functional Perl Programming -- Frank Antonsen

   * Faking Stored Procedures -- Zach Thompson

   plus Perl News, Perl Mongers and Perl Foundation reports, book
   reviews, and short notes.

The first print issue ( 1.0 ) is still available to subscribers online
as a PDF file, and some back issues are available.

   * Test Driven Development -- Denis Kosykh

   * Just do{} it -- brian d foy

   * Extending XML::XPath -- Michel Rodriguez

   * Test::More in 20 Seconds -- brian d foy

   * Magick Tile Puzzles -- Grant McLean

Before that, The Perl Review was a digital only version with
eight issues which are still available for free download as
PDF files.

   http://www.theperlreview.com/Issues/

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

RSS Feeds are available too.

   Subscriber only (current) issues
      http://www.theperlreview.com/RSS/tpr-subscribers.rdf

   Free Issues and articles
      http://www.theperlreview.com/RSS/tpr-free.rdf

   The Perl Review news
      http://www.livejournal.com/users/perl_review/data/rss

   The Perl Review public discussion
      http://www.livejournal.com/community/the_perl_review/data/rss

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

Want to write for TPR? Send us a note, or submit an idea online

   http://www.theperlreview.com/Authors/submit.html

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

Prices: $16 in the US, $30 outside the US.  Web only subscriptions
are $16. If we can get enough subscribers in the European Union, we'll
start printing there too and lower the cost. If you like, you can
start your subscription with the Winter 2004 issue and save money
by not having to buy the back issue later.

TPR accepts MasterCard, Visa, American Express, PayPal, Amazon.com
Honors System, and check or money order in US dollars.  Sorry, but we
can only accept advance payment since we're too small to do handle
individual billing.

Samples to Perl user groups, Perl instructors, and other worthy causes
are available.

-- 
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com


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

Date: 4 May 2005 05:14:12 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: The Perl Review, Summer 2005
Message-Id: <Xns964C24BF3C8castleamber@130.133.1.4>

brian d foy wrote:

> Prices: $16 in the US, $30 outside the US.  Web only subscriptions
> are $16. If we can get enough subscribers in the European Union, we'll
> start printing there too and lower the cost. If you like, you can
> start your subscription with the Winter 2004 issue and save money
> by not having to buy the back issue later.

I just wonder how many people will perceive this as a commercial message...


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


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

Date: Wed, 04 May 2005 19:28:32 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: The Perl Review, Summer 2005
Message-Id: <427894e1_1@x-privat.org>

John Bokma wrote:

> 
> I just wonder how many people will perceive this as a commercial
> message...

Yes, advertising yourself as a programmer for hire is a commercial message. 

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

But then, most spammers dont draw attention to themselves.

gtoomey


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

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 8048
***************************************


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