[24088] in Perl-Users-Digest
Perl-Users Digest, Issue: 6282 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 20 09:05:37 2004
Date: Sat, 20 Mar 2004 06:05:07 -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 Sat, 20 Mar 2004 Volume: 10 Number: 6282
Today's topics:
Re: Any Help would be great <Use-Author-Address-Header@[127.1]>
Re: Any Help would be great <tore@aursand.no>
Re: Any Help would be great (Peter J. Acklam)
Re: Any Help would be great <jwillmore@remove.adelphia.net>
Re: AppConfig <wherrera@lynxview.com>
Re: chm decompiler <meneerjansen@europe.be>
Re: dollar sign and spaces from a string <janet@b3p0.com>
Re: dollar sign and spaces from a string <invalid-email@rochester.rr.com>
Re: dollar sign and spaces from a string (Anno Siegel)
Re: dollar sign and spaces from a string <mr@sandman.net>
Re: dollar sign and spaces from a string (Anno Siegel)
Re: FIFO problem - yet another .sig rot script... <bik.mido@tiscalinet.it>
help me with if-else if-else <dannywork5@hotmail.com>
Re: help me with if-else if-else <noreply@gunnar.cc>
Re: help me with if-else if-else <jurgenex@hotmail.com>
Re: HOW TO PARSE A VAST FILE! (kydongau)
Re: installing CPAN module <jwillmore@remove.adelphia.net>
Re: installing CPAN module <roel-perl@st2x.net>
Re: need help with if then statement <tore@aursand.no>
Re: Problem installing Net::DNS <roel-perl@st2x.net>
Re: problem with pack and output to binary files (Mark Flynn)
Re: problem with pack and output to binary files <bik.mido@tiscalinet.it>
regex (pcre) variable number of (captures)* - how? <x@x.x>
Re: regex (pcre) variable number of (captures)* - how? (Anno Siegel)
Re: regex (pcre) variable number of (captures)* - how? <x@x.x>
Re: Test <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 20 Mar 2004 00:43:55 +0000 (UTC)
From: Anonymous Sender <Use-Author-Address-Header@[127.1]>
Subject: Re: Any Help would be great
Message-Id: <b8bf7c9c8efea63ab836f3bb344e7893@remailer.metacolo.com>
NOTE: This message was sent thru a mail2news gateway.
No effort was made to verify the identity of the sender.
--------------------------------------------------------
--(snip)--
>
> They want the numbers to be divided by 3600(to make per second), by
> 1024(for KB/s), and then again by 1024 to have the result shown as
> MB/s.
>
--(snip)--
Er . . . not to pick nits, but:
One kilobyte is 1024 bytes; 2^10, no problem.
But one megabyte is 1000 kilobytes; 10^3 (NOT 1024 kb).
------------------------------
Date: Sat, 20 Mar 2004 12:53:48 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: Any Help would be great
Message-Id: <pan.2004.03.20.11.47.24.800465@aursand.no>
On Sat, 20 Mar 2004 00:43:55 +0000, Anonymous Sender wrote:
>> They want the numbers to be divided by 3600(to make per second), by
>> 1024(for KB/s), and then again by 1024 to have the result shown as
>> MB/s.
> Er . . . not to pick nits, but:
> One kilobyte is 1024 bytes; 2^10, no problem.
> But one megabyte is 1000 kilobytes; 10^3 (NOT 1024 kb).
Not to nitpick, but: When dealing with computers, 1 megabyte _is_ 1.024
kilobytes. The reason is that computers are dealing with binary numbers.
For more information, please visit Wikipedia:
<http://en.wikipedia.org/wiki/Megabyte>
--
Tore Aursand <tore@aursand.no>
"Why shouldn't truth be stranger than fiction? Fiction, after all, has
to make sense." -- Mark Twain
------------------------------
Date: 20 Mar 2004 13:15:03 +0100
From: pjacklam@online.no (Peter J. Acklam)
Subject: Re: Any Help would be great
Message-Id: <1xnnsojc.fsf@online.no>
Tore Aursand <tore@aursand.no> wrote:
> Not to nitpick, but: When dealing with computers, 1 megabyte
> _is_ 1.024 kilobytes. The reason is that computers are dealing
> with binary numbers.
Uh...no, even with computers it depends. For instance, when
talking about the size of a hard disk, 1 MB is often 10^6 bytes
and 1 GB is 10^9 bytes.
> For more information, please visit Wikipedia:
>
> <http://en.wikipedia.org/wiki/Megabyte>
Wikipedia says "This definition is often used in computer
science". The word "often" does not mean "always".
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: Sat, 20 Mar 2004 08:51:26 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Any Help would be great
Message-Id: <pan.2004.03.20.13.51.24.154838@remove.adelphia.net>
On Sat, 20 Mar 2004 13:15:03 +0100, Peter J. Acklam wrote:
> Tore Aursand <tore@aursand.no> wrote:
>
>> Not to nitpick, but: When dealing with computers, 1 megabyte
>> _is_ 1.024 kilobytes. The reason is that computers are dealing
>> with binary numbers.
>
> Uh...no, even with computers it depends. For instance, when
> talking about the size of a hard disk, 1 MB is often 10^6 bytes
> and 1 GB is 10^9 bytes.
>
>> For more information, please visit Wikipedia:
>>
>> <http://en.wikipedia.org/wiki/Megabyte>
>
> Wikipedia says "This definition is often used in computer
> science". The word "often" does not mean "always".
>
> Peter
Tore didn't go far enough :-)
Try the following URL's to support the simple concept that ...
1024kb is, in fact, 1Mb
http://www.glossary-tech.com/byte.htm
http://www.quantel.com/domisphere/infopool.nsf/html/2D6E7D1492C9CEE180256C86004089B6
http://www.cs.huji.ac.il/course/2003/intro2cs/misc/Megabytes.htm
http://www.t1shopper.com/tools/calculate/
http://www.help2go.com/article12.html
http://www.shelbycs.org/technology/howbigisagigabyte.html
http://encyclopedia.thefreedictionary.com/Megabyte
http://www.chelationtherapyonline.com/statistics/
http://mail.alakhawayn.ma/~R.Burgess/1203/mod1_files/readings/bits.html
Maybe this is overkill, but it seems apparent that you want to make a
statement without knowing all the facts. I suggest you *read* the URL's,
report back what proves your point ... or just accept the fact you're
wrong and move on :-)
According to one of the links above, the IEEE adopted the standard 2^20 =
1MiB (aka mebibyte - not a typo), - however, it has not be widely
accepted. This was done to remove this type of discussion completely.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
If a listener nods his head when you're explaining your program,
wake him up.
------------------------------
Date: Sat, 20 Mar 2004 00:14:01 -0700
From: Bill <wherrera@lynxview.com>
Subject: Re: AppConfig
Message-Id: <0NOdnT5WPZVlc8bdRVn-hQ@adelphia.com>
Mark J Fenbers wrote:
> I'm trying to use AppConfig::File for the first time. I am having
> trouble and don't understand its complaint.
...
> and the error I get (from last code line before 'exit') is
>
> basedir: no such variable at /home/oper/.my.cfg line 1
> destdir: no such variable at /home/oper/.my.cfg line 2
...
> What is this trying to tell me?
Maybe to use Config::Auto instead, since it's easier?
#!/usr/bin/perl -w
use strict;
use Config::Auto;
my $config = Config::Auto::parse("/home/oper/.my.cfg");
while (my($k, $v) = each %{$config}) { print "$k : $v \n"; }
exit;
hth ;)
------------------------------
Date: Sat, 20 Mar 2004 00:26:59 +0100
From: "meneerjansen" <meneerjansen@europe.be>
Subject: Re: chm decompiler
Message-Id: <c3fviv$dfq$1@reader13.wxs.nl>
"meneerjansen" <meneerjansen@europe.be> schreef in bericht
news:c3d1jd$m5m$1@reader13.wxs.nl...
> Greetings,
> I'm looking for a Perl script (or a platform-independent exe outputting
to...
Thanks for your tips gnu valued customer and Uten Navn.
Janssen
------------------------------
Date: Fri, 19 Mar 2004 18:22:16 -0500
From: Janet <janet@b3p0.com>
Subject: Re: dollar sign and spaces from a string
Message-Id: <BC80EAD8.8AB0%janet@b3p0.com>
On 3/19/04 8:07 AM, in article
OgC6c.27994$E8.6370776@news4.srv.hcvlny.cv.net, "Bill" <bill@hotmail.com>
wrote:
> Hi
>
> How can I remove the dollar sign and spaces from a string and keep the +?
>
> This dont work
>
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
>
> $weight = "8.5 + $10.00";
It's here, the quotation marks need to be single (') or perl will
interpolate $10 as a variable name, . as concatentation (probably) and so
on. Just out of curiosity, is it telling you that $weight is 8.5?
> $weight =~ s/ \$//g;
>
> print "$weight";
>
>
janet
--
Only she who attempts the absurd can achieve the impossible.
Robin Morgan
------------------------------
Date: Sat, 20 Mar 2004 01:50:20 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: dollar sign and spaces from a string
Message-Id: <405BA35A.60600@rochester.rr.com>
Bill wrote:
> Hi
>
> How can I remove the dollar sign and spaces from a string and keep the +?
>
> This dont work
>
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
>
> $weight = "8.5 + $10.00";
Others have pointed out that $weight does not contain a $ at this point
because the variable $10 is interpolated.
> $weight =~ s/ \$//g;
The regexp in the substitute operator arguments will match a space
character followed by a $. Thus, it will not meet your stated
requirements of removing the $ and spaces from $weight. You could try:
$weight =~ s/[ $]//g;
or, as has also been pointed out:
$weight =~ y/ $//d;
>
> print "$weight";
The preceding statement contains a "useless use of double quotes". See:
perldoc -q quoting
for reasons not to do that.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: 20 Mar 2004 12:23:44 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dollar sign and spaces from a string
Message-Id: <c3hd4g$c9k$1@mamenchi.zrz.TU-Berlin.DE>
Sandman <mr@sandman.net> wrote in comp.lang.perl.misc:
> In article <c3f8kk$4uo$2@mamenchi.zrz.TU-Berlin.DE>,
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
> > > Newbies just can't win - ...
> >
> > Right. You're new, you make mistakes, you're criticized. You leave
> > or you learn. Anything wrong with that?
>
> Well, of course. Problem is that too many would rather make fun of and insult
> the newbies than directing them to the appropriate documentation - even though
> the latter is so much easier! I suppose the former is more fun, but a lot of
> newbies are scared off due to the elitist attitude.
Care to show any evidence for that claim? I'm sure you are in contact
with a representative sample of "newbies" who inform you of their motives.
Anno
------------------------------
Date: Sat, 20 Mar 2004 13:43:53 +0100
From: Sandman <mr@sandman.net>
Subject: Re: dollar sign and spaces from a string
Message-Id: <mr-6B25DF.13435320032004@news.fu-berlin.de>
In article <c3hd4g$c9k$1@mamenchi.zrz.TU-Berlin.DE>,
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>>>> Newbies just can't win - ...
>>>
>>> Right. You're new, you make mistakes, you're criticized. You leave
>>> or you learn. Anything wrong with that?
>>
>> Well, of course. Problem is that too many would rather make fun of
>> and insult the newbies than directing them to the appropriate
>> documentation - even though the latter is so much easier! I suppose
>> the former is more fun, but a lot of newbies are scared off due to
>> the elitist attitude.
>
> Care to show any evidence for that claim?
Naturally! I wouldn't make a claim if I couldnt' back it up. This is from just
two weeks ago, from a guy that wanted help with a transition from JavaScript to
Perl (CGI) for a select-box value handler - it was obvious he didn't know very
much about perl OR the "posting guidelines". Needlesstosay, he recieved a lot
of attitude.
http://groups.google.com/groups?selm=f18c773b.0403031758.4a80bb8c%40posting.goog
le.com
"thanks for your help Sandman, nuts to the rest of you."
"Bugger it ... Javascript programmers are friendlier I'll just go and
see them and do it their way. Obviously 5/6 perl programmers are rude."
Obvviously, that would count as someone being scared off the newsgroup,
wouldn't you say? That pooster hasn't posted since then.
The fun thing is that all the people that gave him attitude probably think it
was a sucess and "good riddance". I think that's sad.
> I'm sure you are in contact with a representative sample of "newbies"
> who inform you of their motives.
No, not really. I wouldn't even call myself a regular (much less an "oldie",
thank god) in this group even though I read and posted to it for several years.
I merely make observations when people are treated bad.
My latest thread about this was moved to mail with some other poster here who
genuinely wanted to persuade me that treating people like shit was an ok thing
to do - as opposed to helping them.
Naturally, I couldn't disagree more. :P
--
Sandman[.net]
------------------------------
Date: 20 Mar 2004 12:56:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dollar sign and spaces from a string
Message-Id: <c3hf1t$d7h$1@mamenchi.zrz.TU-Berlin.DE>
Sandman <mr@sandman.net> wrote in comp.lang.perl.misc:
> In article <c3hd4g$c9k$1@mamenchi.zrz.TU-Berlin.DE>,
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
> >>>> Newbies just can't win - ...
> >>>
> >>> Right. You're new, you make mistakes, you're criticized. You leave
> >>> or you learn. Anything wrong with that?
> >>
> >> Well, of course. Problem is that too many would rather make fun of
> >> and insult the newbies than directing them to the appropriate
> >> documentation - even though the latter is so much easier! I suppose
> >> the former is more fun, but a lot of newbies are scared off due to
> >> the elitist attitude.
> >
> > Care to show any evidence for that claim?
>
> Naturally! I wouldn't make a claim if I couldnt' back it up. This is from just
> two weeks ago, from a guy that wanted help with a transition from JavaScript to
[snip]
Keep your line length reasonable.
I asked for evidence, you give me an anecdote (no news there, I read this
newsgroup too).
How many newbies are scared off by the elitist attitude of this NG, and
how do you know?
Anno
------------------------------
Date: Sat, 20 Mar 2004 10:25:51 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FIFO problem - yet another .sig rot script...
Message-Id: <890o50tcdplphupbuaeb0iis90vabd90hl@4ax.com>
On Thu, 18 Mar 2004 23:17:29 +0100, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
Well, before anybody points it out,
> {
> my $sig =
^^^^^^^
> open my $fh, '>', $fifo or
that is a typo left there by mistake: doesn't do any harm and nothing
useful either!
BTW: any ideas on my actual problem?!? I googled around for 'pine
signature fifo' and it seems to return a bunch of relevant hits, but
at home I both have a limited bandwidth and I still pay a hourly rate
for my Internet connection, so I'll defer a more extensive search to
next week...
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Sat, 20 Mar 2004 02:17:05 GMT
From: "Danny" <dannywork5@hotmail.com>
Subject: help me with if-else if-else
Message-Id: <BQN6c.39280$E8.8575507@news4.srv.hcvlny.cv.net>
What is wrong with this?
It is html then cgi then html. I snipped out only a portion of the htmml.
I could get just a regular
if then else to work, but not the else if statement below. I tried leaving
out the last semicolon, etc etc. just could not get it to go.
any ideas?
'
</TR>
<TR>
<TD WIDTH="100%" HEIGHT="23" COLSPAN="2">
<TABLE WIDTH="750" BORDER="0" CELLPADDING="0" CELLSPACING="0"
bgcolor="#9959CC">
<TR>
'
;
if ($category eq "name")
{print $name;}
else if ($category eq "occupation")
{print $jobtitle;}
else
{print $nodata;}
;
'
</TR>
</TABLE>
<div align="center"></div></TD>
</TR>
<TR>
'
------------------------------
Date: Sat, 20 Mar 2004 03:32:54 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: help me with if-else if-else
Message-Id: <c3gb4e$26ks8g$1@ID-184292.news.uni-berlin.de>
Danny wrote:
> What is wrong with this?
<snip>
Didn't you ask a similar question a few hours ago? Weren't you advised
to study
perldoc perlintro
http://learn.perl.org/
among other things. Please understand that you cannot invent your own
syntax and expect perl to interpret it, neither can you post such
self-invented code here and expect others to hand-hold you because you
are too lazy to first learn the Perl basics.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 20 Mar 2004 02:56:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: help me with if-else if-else
Message-Id: <IpO6c.1567$QS2.471@nwrddc03.gnilink.net>
Danny wrote:
> What is wrong with this?
> It is html then cgi then html. [...]
> '
> </TR>
> <TR>
> <TD WIDTH="100%" HEIGHT="23" COLSPAN="2">
>
> <TABLE WIDTH="750" BORDER="0" CELLPADDING="0" CELLSPACING="0"
> bgcolor="#9959CC">
> <TR>
>
> '
> ;
>
>
> if ($category eq "name")
> {print $name;}
> else if ($category eq "occupation")
> {print $jobtitle;}
> else
> {print $nodata;}
> ;
>
>
> '
>
> </TR>
> </TABLE>
>
> <div align="center"></div></TD>
> </TR>
> <TR>
> '
Hmmm, which programming language again is this supposed to be?
jue
------------------------------
Date: 19 Mar 2004 15:09:37 -0800
From: kydongau@yahoo.com.au (kydongau)
Subject: Re: HOW TO PARSE A VAST FILE!
Message-Id: <738c2d89.0403191509.2cac340d@posting.google.com>
"news.hinet.net" <luke@program.com.tw> wrote in message news:<c3blmp$4lv@netnews.hinet.net>...
> No ! This logfile is single one in every hour and i will parse data from
> top to bottom everytime
>
> I must load history from mysql to hash today and pasre this file avoid
> duplicate data!
>
> Query data from mysql and put into hash is fast,but i must load file
> and use do loop to find duplicate data. if yes then reject or insert into
> database.
>
Without the details of your database but anyway the following is just
a thought:
Use some kind of unique indexes to prevent data duplication in the
first place.
I have never heard of anyone unloading/loading data from database to
remove duplication in an ongoing basic.
------------------------------
Date: Sat, 20 Mar 2004 00:13:54 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: installing CPAN module
Message-Id: <pan.2004.03.20.05.13.47.704923@remove.adelphia.net>
On Fri, 19 Mar 2004 21:14:49 +0000, foobardude wrote:
[ ... ]
> Any help greatly appreciated,
>
>
> ---------------------------------------------------------------------------
> Did not find GP/PARI build directory around.
> Do you want to me to fetch GP/PARI automatically?
> (If you do not, you will need to fetch it manually, and/or direct me to
> the directory with GP/PARI source via the command-line option
> paridir=/dir)
> Make sure you have a large scrollback buffer to see the messages.
> Fetch? (y/n, press Enter) Can't open PREFIX=~/perl5lib/: No such file or
> directory at utils/Math/PariBuild.pm line 148.
> Can't open LIB=~/perl5lib/lib: No such file or directory at
> utils/Math/PariBuild.pm line 148.
> Can't open INSTALLMAN1DIR=~/perl5lib/man1: No such file or directory at
> utils/Math/PariBuild.pm line 148.
> Can't open INSTALLMAN3DIR=~/perl5lib/man3: No such file or directory at
> utils/Math/PariBuild.pm line 148.
> Well, as you wish...
> Rerun Makefile.PL when you fetched GP/PARI manually.
> Could not find GP/PARI build directory, please run Makefile.PL
> with paridir=/directory option.
> Running make test
> Make had some problems, maybe interrupted? Won't test
> Running make install
> Make had some problems, maybe interrupted? Won't install
> ---------------------------------------------------------------------------
A couple of things.
Did you set a prefix for CPAN to use to install modules? If so, use a
full path, not a '~' in the path. I'm not saying this is the problem, but
from the output there *appears* to be a problem with where CPAN is looking
for stuff.
Have you tried to install without the CPAN shell? This *may* work for
you. OTOH, the install may crap again, but it's worth a shot. One way
to do this is (from the CPAN shell) type 'look Math::Pari' (which gets
you out of the CPAN shell and into where the module tarball was
extracted), then 'perl Makefile.PL', 'make', 'make test', and finally
'make install'. Make sure you read the messages during each step to see if
all went well.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
She's genuinely bogus.
------------------------------
Date: 20 Mar 2004 07:31:08 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: installing CPAN module
Message-Id: <slrnc5nspg.3gi.roel-perl@195-86-124-242.dsl.easynet.nl>
On Fri, 19 Mar 2004 21:14:49 +0000, foobardude wrote:
> Any help greatly appreciated,
> ---------------------------------------------------------------------------
> Did not find GP/PARI build directory around.
> Do you want to me to fetch GP/PARI automatically?
> (If you do not, you will need to fetch it manually, and/or direct me to
> the directory with GP/PARI source via the command-line option
> paridir=/dir)
I tried this myself as root (installs OK) and as normal user (same result as
you describe). It occurs to me that you don't have PARI/GP intsalled, and
that package won't "make install" as a non-root user. (It's a C library.)
I suggest you make sure you have PARI/GP http://pari.math.u-bordeaux.fr/
installed, and then try again.
------------------------------
Date: Sat, 20 Mar 2004 12:40:35 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: need help with if then statement
Message-Id: <pan.2004.03.19.17.57.19.578408@aursand.no>
On Fri, 19 Mar 2004 17:31:32 +0000, Danny wrote:
> I am trying to generate dynamic pages using cgi. How can I store the
> html code portions into a string
> [...]
I always recommend people _not_ to use CGI.pm (or any other module) to
generate HTML. Keep the HTML stuff away from the Perl code!
You should take a look at some of the template modules available, for
example HTML::Template. You'll find them all at CPAN.
--
Tore Aursand <tore@aursand.no>
"To cease smoking is the easiset thing I ever did. I ought to know,
I've done it a thousand times." -- Mark Twain
------------------------------
Date: 20 Mar 2004 07:40:56 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: Problem installing Net::DNS
Message-Id: <slrnc5ntbs.3kv.roel-perl@195-86-124-242.dsl.easynet.nl>
On Fri, 19 Mar 2004 at 22:28 GMT, John Oliver <joliver@john-oliver.net> wrote:
> On 19 Mar 2004 18:38:11 GMT, Roel van der Steen wrote:
>> On Fri, 19 Mar 2004 at 18:11 GMT, John Oliver <joliver@john-oliver.net> wrote:
>><lots of dumped screen data snipped>
>>>
>>> There is a resolv.conf file, and it does work. This host is not behind
>>> a firewall. I've asked the admin at that location to double-check the
>>> router for ACLs, but I really doubt that's the case.
>>>
>>
>> Just installed Net::DNS on my system without problems. Maybe you can
>> add the line
>>
>> $res->debug(1);
> I uncommented $res->debug(1); but still had the same problem. Was there
> somewhere else in that file that I should add that line?
>
No, that was a correction interpretation of a somewhat unclear clue. :)
But my intention was that it would help you to trace what is going on,
not that it would solve the problem. I expect you get lots of debugging
output. What does it say?
------------------------------
Date: 19 Mar 2004 15:07:37 -0800
From: triflynn@earthlink.net (Mark Flynn)
Subject: Re: problem with pack and output to binary files
Message-Id: <1840605b.0403191507.3afe502c@posting.google.com>
My sinceere apologies to the group. I posted a version of the code
which does not work! I thought it had run, but in fact it had not.
I have since answered my own question. I need to use binmode. If I do,
it works. If I do not, then print decides (on DOS) that a 0D must be
inserted before every 0A.
Once again, sorry for the posting of non-working code.
BTW, the working version of the code is here.
#!Perl -w
use strict;
#Example of bug in print to binary file
my $begin = 0x100;
my $end = 0x130;
my $i;
my $file = ">bug_test.dat";
open FILE, $file;
binmode FILE, ":raw" ;
for ($i = $begin; $i <= $end; $i++) {
print FILE pack("n", $i);
}
------------------------------
Date: Sat, 20 Mar 2004 10:25:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: problem with pack and output to binary files
Message-Id: <960o509ot6ecfg291mq0qfforv3an1kvrf@4ax.com>
On 19 Mar 2004 08:31:03 -0800, triflynn@earthlink.net (Mark Flynn)
wrote:
>I'm hoping someone can reply letting me know what I fool I am for
>missing such an obvious error. This one is driving me nuts.
>
>I'm using pack with the n format string to write big-endian 4 byte
>binary data to a file. Sounds pretty simple. Here's the code.
>
>#!Perl
>use strict;
[snip]
#!/usr/bin/perl
use strict;
use warnings;
open my $fh, '>:raw', 'bug_test.dat' or die $!;
print $fh pack 'n', $_ for 0x100 .. 0x130;
__END__
or
print $fh map { pack 'n', $_ } 0x100 .. 0x130;
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Sat, 20 Mar 2004 11:51:13 +0000
From: ben <x@x.x>
Subject: regex (pcre) variable number of (captures)* - how?
Message-Id: <200320041151138348%x@x.x>
regarding regular expressions (pcre):
i keep wanting to do this but can't see how to do it: if, within the
regex pattern, you repeat a capture, as in rounded brackets followed by
a star, the capture results don't increase with the number of loops
that the repeating star.
the number or capture result spaces are fixed to the number of pairs of
brackets, even if those brackets are set to repleat/loop.
how can you capture a variable number of results?
simple example:
input text:
a b c d e
an attempt pattern that doesn't work:
((\\w)\\s*)*
results:
2004-03-20 11:42:40.226 regexTest[29750] <AGRegexMatch: 0x5e240> {
0 {0, 9} a b c d e
1 {8, 1} e
2 {8, 1} e
}
(ok, i'm not doing this in perl but in the "cocoa" framework on apple
os x using a pcre regex wrapper called AGRegex, but this groop seemed
pretty appropriate)
so the result show the problem -- only one fixed result which obviously
keeps getting written over which is why it ends up with only the last
result. what i want is the multiple matches to build up/ aggregate
somehow to end up with:
a
b
c
d
e
how can this be done? any help much appreciated.
thanks, ben.
------------------------------
Date: 20 Mar 2004 13:08:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regex (pcre) variable number of (captures)* - how?
Message-Id: <c3hfp9$d7h$2@mamenchi.zrz.TU-Berlin.DE>
ben <x@x.x> wrote in comp.lang.perl.misc:
> regarding regular expressions (pcre):
>
> i keep wanting to do this but can't see how to do it: if, within the
> regex pattern, you repeat a capture, as in rounded brackets followed by
> a star, the capture results don't increase with the number of loops
> that the repeating star.
>
> the number or capture result spaces are fixed to the number of pairs of
> brackets, even if those brackets are set to repleat/loop.
>
> how can you capture a variable number of results?
You can't, not with a single regex. The number of captures is the
number of opening parentheses in the regex. Every pair feeds one
of the $<n> variables. There's no way around it.
[...]
> (ok, i'm not doing this in perl but in the "cocoa" framework on apple
> os x using a pcre regex wrapper called AGRegex, but this groop seemed
> pretty appropriate)
There are, of course, Perl solutions to extract any list of matches,
but they would involve more than just a regex.
Anno
------------------------------
Date: Sat, 20 Mar 2004 13:24:55 +0000
From: ben <x@x.x>
Subject: Re: regex (pcre) variable number of (captures)* - how?
Message-Id: <200320041324555683%x@x.x>
In article <c3hfp9$d7h$2@mamenchi.zrz.TU-Berlin.DE>, Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de> wrote:
> ben <x@x.x> wrote in comp.lang.perl.misc:
> > regarding regular expressions (pcre):
> >
> > i keep wanting to do this but can't see how to do it: if, within the
> > regex pattern, you repeat a capture, as in rounded brackets followed by
> > a star, the capture results don't increase with the number of loops
> > that the repeating star.
> >
> > the number or capture result spaces are fixed to the number of pairs of
> > brackets, even if those brackets are set to repleat/loop.
> >
> > how can you capture a variable number of results?
>
> You can't, not with a single regex. The number of captures is the
> number of opening parentheses in the regex. Every pair feeds one
> of the $<n> variables. There's no way around it.
>
> [...]
>
> > (ok, i'm not doing this in perl but in the "cocoa" framework on apple
> > os x using a pcre regex wrapper called AGRegex, but this groop seemed
> > pretty appropriate)
>
> There are, of course, Perl solutions to extract any list of matches,
> but they would involve more than just a regex.
i see -- so i have to use the language/environment outside of regex.
how to do that with the thing i want this for is making my mind boggle
-- can't get my head round it right now, but at least i know what i
want to do in the way i wanted to do it isn't possible so i won't keep
looking for something that doesn't exist. thanks very much for the
reply.
ben.
------------------------------
Date: Sat, 20 Mar 2004 03:00:06 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Test
Message-Id: <WsO6c.1611$QS2.1144@nwrddc03.gnilink.net>
Grant wrote:
> Last message didn't seem to work.
Neither did this one.
Your Newsreader/server is misconfigured. It posted the article to CLPM
instead of to a test NG.
Please fix that.
jue
------------------------------
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 6282
***************************************