[19457] in Perl-Users-Digest
Perl-Users Digest, Issue: 1652 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 00:06:49 2001
Date: Wed, 29 Aug 2001 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999144307-v10-i1652@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 29 Aug 2001 Volume: 10 Number: 1652
Today's topics:
Re: Re: how to get character from string one by one? 194.203.212.8 [demerphq@hotmail.com]
Re: Re: how to get character from string one by one? 194.203.212.8 [demerphq@hotmail.com]
A Question about reference lifetimes (Stan Brown)
Calling sub funcs with scalar variables? <ds@ss.com>
Re: Calling sub funcs with scalar variables? (Tad McClellan)
Re: D'oh! It does what I said, not what I want <ren@tivoli.com>
Re: Difference between .pl, .cgi, and .pm File Extensio <rob_13@excite.com>
Re: Difference between .pl, .cgi, and .pm File Extensio <bob@eawf.nospam.com>
Re: Difference between .pl, .cgi, and .pm File Extensio <bob@eawf.nospam.com>
Re: File::Find not recursing on Win32 Perl 5.001 <ddunham@redwood.taos.com>
Re: File::Find not recursing on Win32 Perl 5.001 (Eric Bohlman)
Help!:compile perl in win98? <no@mail.addr>
Re: How does HTML::TokeParser decide where a tag ends? (Eric Bohlman)
Re: how to get character from string one by one? <krahnj@acm.org>
MultiThread with fork? <no@mail.addr>
Re: Pattern matching, grabing everything right of the m <gnarinn@hotmail.com>
Re: Pattern matching, grabing everything right of the m <godzilla@stomp.stomp.tokyo>
Re: Performance : Shell X Perl <andrew.savige@ir.com>
Re: Prlbm installing sybperl on Solaris 2.6. <tony_curtis32@yahoo.com>
Re: Re: how to get character from string one by one? (Tad McClellan)
Re: use() versus import() changing semantics? <tinamue@zedat.fu-berlin.de>
Re: use() versus import() changing semantics? <Tassilo.Parseval@post.rwth-aachen.de>
Re: Using Perl to explore an MSSQL database <bart.lateur@skynet.be>
Re: Valid IP address format (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 29 Aug 2001 23:40:55 GMT
From: 194.203.212.8 [demerphq@hotmail.com]
Subject: Re: Re: how to get character from string one by one?
Message-Id: <b4fj7.1426$3x.5099@news.bc.tac.net>
> Yves Orton wrote:
> >
> > The tests that I ran...
> >
> > chop and vec have been omitted so far.
>
> Just a couple of points.
>
> > my $types={
> > Scalar_only=>{
> > 'substr4' => 'substr ($s, 0, 1, "") while length($s)',
> > 'substr3' => 'substr( $s, $_, 1 ) foreach (0..length($s)-1)',
> > },
> > Regexp=>{
> > 'rex_dot' => '$s =~ /(.)/gs',
> > 'rex_class' => '$s =~ /([\x00-\xFF])/gs',
> ^
> The /s modifier isn't required as you are not using the period (.) in
> the regex.
Hmm. Ok. But do you think it affects efficiency?
>
> > },
> > List_only=>{
> > 'unpack' => 'unpack("C*", $s)',
>
> map { chr } unpack( 'C*', $s )
Yes I suppose. This gets into the the issue of whether it matters
that the result is a list of chars or a list of ordinal values of
chars. Perhaps I should do both?
> unpack( 'a' x length $s, $s )
Ahah! Now thats what I didnt think of....
> use Perl;
> program
> fulfillment
^^^^^^^^^^^^^
Indeed!
Yves
==================================
Poster's IP address: 194.203.212.8
Posted via http://nodevice.com
Linux Programmer's Site
------------------------------
Date: Thu, 30 Aug 2001 01:47:43 GMT
From: 194.203.212.8 [demerphq@hotmail.com]
Subject: Re: Re: how to get character from string one by one?
Message-Id: <3Xgj7.1427$3x.4883@news.bc.tac.net>
> 194.203.212.8, [demerphq@hotmail.com] wrote:
> >
> > > Yves Orton wrote:
> > > unpack( 'a' x length $s, $s )
> >
> > Ahah! Now thats what I didnt think of....
>
> chr( vec( $s, $_, 8 ) ) for 0 .. length($s)-1
Ok, so this weekend ill set up a new benchmark of all the added variants...
Yves
--
There is way more than one way to do it...
Karma Sutra
==================================
Poster's IP address: 194.203.212.8
Posted via http://nodevice.com
Linux Programmer's Site
------------------------------
Date: 29 Aug 2001 20:06:06 -0400
From: stanb@panix.com (Stan Brown)
Subject: A Question about reference lifetimes
Message-Id: <9mk01e$9b7$1@panix3.panix.com>
I'm going to need to spawn a child task with FileHandle->open, and have it
do a lengthy DBI query (thus allowing perlTK to continue updating the
screen).
Beacause of the ammount of data potentialy returned by this select, I need
to use one of the DBI calls that returns a refernce to the returned data.
The child task will exit at the end of the select, but I need to be able to
access the data untill the parent exits.
Will this be OK? I'm concrend about cleanup on the exit of the child
destroying the refeenced data.
If this is a problem, is there some way to work around this?
------------------------------
Date: Thu, 30 Aug 2001 01:53:55 GMT
From: GunneR <ds@ss.com>
Subject: Calling sub funcs with scalar variables?
Message-Id: <dbrtot439gjcodunresasqjeh7ltql1d4j@4ax.com>
Basically I want to call a sub function based on a scalar. In essance
I want the following to execute a sub function:
&"$func"; ## Of course this doesnt work... its just to give you an
idea.
Ive tried &($func); &{$func} and the like but no go. Im sure theres a
simple solution...
TIA!
------------------------------
Date: Wed, 29 Aug 2001 21:41:06 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Calling sub funcs with scalar variables?
Message-Id: <slrn9or6di.5ak.tadmc@tadmc26.august.net>
GunneR <ds@ss.com> wrote:
>Basically I want to call a sub function based on a scalar. In essance
^^^^^^
No you don't.
>I want the following to execute a sub function:
>
>&"$func"; ## Of course this doesnt work... its just to give you an
>idea.
>
>Ive tried &($func); &{$func} and the like but no go. Im sure theres a
^^^^^^^^
That one works fine for me (after turning strict off).
>simple solution...
What you are asking for is called "Symbolic references". They are bad:
http://www.plover.com/~mjd/perl/varvarname.html
http://www.plover.com/~mjd/perl/varvarname2.html
http://www.plover.com/~mjd/perl/varvarname3.html
so I am not going to help you use them. I will instead offer
an alternative where you won't need them, a dispatch table:
my %subs = (
mysub1 => \&mysub1,
mysub2 => \&mysub2,
);
my $func = 'mysub2';
$subs{$func}->(); # call mysub2()
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Aug 2001 18:17:43 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: D'oh! It does what I said, not what I want
Message-Id: <m3wv3mv4ko.fsf@dhcp9-161.support.tivoli.com>
On 24 Aug 2001, cb@onsitetech.com wrote:
> # my $ping1 = (`ping XXX.XXX.XXX.XXX -n 1`) ;
> # my $ping2 = (`ping yahoo.com -n 25`) ;
> # my $ping3 = (`ping 132.163.4.101 -n 25`) ;
> # my $time = (localtime) ;
> # my $numb = 18501 ;
> # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> # You want this section of code inside the loop.
>
>> until ($numb == 1) {
> # like this
> my $ping1 = `ping XXX.XXX.XXX.XXX -n 1` ;
> my $ping2 = `ping yahoo.com -n 25`;
> my $ping3 = `ping 132.163.4.101 -n 25` ;
> my $time = localtime() ;
> my $numb = 18501 ;
> #Also you do not need to interpret those backticks in a list format so
> get rid of the parens.
[snip]
Two comments:
1. "my $numb = 18501" obviously needs to stay outside the loop.
2. The parens around the backticks, while not necessary, certainly do
not provide list context. They have no semantic effect at all in this
case. Same with the localtime call (which doesn't need the parens
after it any more than it needs the parens around it).
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 30 Aug 2001 02:11:48 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: Difference between .pl, .cgi, and .pm File Extensions.
Message-Id: <Xns910CE1C80456Drock13com@64.8.1.227>
Villy Kruse
<news:slrn9opkti.ne2.vek@pharmnl.ohout.pharmapartners.nl>:
> It also depends on the web server if
> it uses the file name suffix to determine the type of
> executable file or if it gets that information from the '#!"
> line in the file.
Or both. Apache can be set to use .cgi to designate CGI programs
and uses the #! to find out what to use to run the program.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Wed, 29 Aug 2001 19:12:10 -0700
From: Bob Holden <bob@eawf.nospam.com>
Subject: Re: Difference between .pl, .cgi, and .pm File Extensions.
Message-Id: <628rot0edl246oqnboqc8ipe1b3k483ghs@4ax.com>
On Tue, 28 Aug 2001 23:35:23 -0700, Bob Holden <bob@eawf.nospam.com>
wrote:
>I'm new to Perl, and trying to figure this all out. What I can't find
>clear references to in all the books I've purchased and info I've
>downloaded is:
>
>What's the difference between a .pl, .cgi, and a .pm file, and why
>would you use one over another?
>
>TIA
Thanks to all for your replies...you clarified it somewhat. However,
now that leads into another question about .pm files. If I look at
the instructions for, say, CGI.pm, it says I need to install it onto
my server.
If that's the case, then there's something different about .pm files,
but what you all have stated, there's really no difference between .pl
and .pm files. I'm confused.
TIA!
------------------------------
Date: Wed, 29 Aug 2001 19:14:05 -0700
From: Bob Holden <bob@eawf.nospam.com>
Subject: Re: Difference between .pl, .cgi, and .pm File Extensions.
Message-Id: <898rot8iekkn17i2l2g7cphhdpgnonneou@4ax.com>
That makes sense.
So I understand about .cgi files now. Now to the difference between
.pl and .pm. See my new post in this thread.
On 29 Aug 2001 11:36:18 GMT, vek@pharmnl.ohout.pharmapartners.nl
(Villy Kruse) wrote:
>On Wed, 29 Aug 2001 10:57:54 +0200,
> Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>
>
>>
>>.cgi however is a generic suffix that wont give away information on the
>>language in which it was written. It could be Perl, but it could also be
>>Python or even C. Possibly assembly, if you like. So if you write
>>cgi-scripts in Perl you are free to either use .pl or .cgi as extension
>>but do tell your webserver about it.
>>
>
>
>However, do check the web server for how to tell it that the file is a cgi
>program and not some file that is sent back as is to the browser. This
>is usualy a configuration issue. It also depends on the web server if
>it uses the file name suffix to determine the type of executable file
>or if it gets that information from the '#!" line in the file.
>
>
>Villy
------------------------------
Date: Wed, 29 Aug 2001 23:37:43 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <b1fj7.4155$Z64.83469@news.pacbell.net>
Phil Hibbs <phil.hibbs@capgemini.co.uk> wrote:
> I tried this from the cookbook:
> @ARGV = qw(.) unless @ARGV;
> use File::Find;
> find sub { print $File::Find::name, -d && '/', "\n" }, @ARGV;
Strange. It seems to work fine for me.. You could try simplifing it on
the hope that there's a typo or something strange in there...
find sub {print $File::Fine::name, "\n";}
What kind of filesystem are you running it in? Any chance it's a
network drive? FAT? NTFS?
> It doesn't recurse into subdirectories. Ideas why not? I can't upgrade
> my perl, as this has to function on other machines with standard
> installs.
What version of perl is it? I tried it on 5.6.1 on 2000 Pro.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< How are you gentlemen!! Take off every '.SIG'!! >
------------------------------
Date: 30 Aug 2001 01:23:51 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <9mk4j7$lti$2@bob.news.rcn.net>
Darren Dunham <ddunham@redwood.taos.com> wrote:
> Strange. It seems to work fine for me.. You could try simplifing it on
^^^^^^^^^^
> the hope that there's a typo or something strange in there...
^^^^
hehe.
------------------------------
Date: Thu, 30 Aug 2001 08:24:45 +0800
From: MMX166+2.1G HD <no@mail.addr>
Subject: Help!:compile perl in win98?
Message-Id: <8qvqot4dlbgocuft96kqctnjh6gvtr24sh@4ax.com>
AP629.TAR.GZ, download form
http://downloads.activestate.com/ActivePerl/src/5.6/AP629_source.tgz
for the Thread module, I was going to compile perl by myself in
win98.the C compiler is VC5, and everything was ok until the nmake
started to link perldll.def. it said many external symbol were
unsolved. though the libs whom defined these symbol were specified
correctly. I couldn't solve it. and there wasn't any mistake I could
find, except the Configure.com, which can't be executed. it said "not
enough memory" though I have 80M. but I think this is not the key.
have anyone compiled perl successfully in win98? could u help me?
------------------------------
Date: 30 Aug 2001 01:39:19 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: How does HTML::TokeParser decide where a tag ends?
Message-Id: <9mk5g7$lti$3@bob.news.rcn.net>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> HTML::TokeParser uses HTML::Parser, which has no guarantees about how
> text is broken up, *unless* you call $p->unbroken_text(1) on the
> parser object $p. See "perldoc HTML::Parser" for details.
I just wanted to point out that this sort of thing is *very* common in
HTML/XML/SGML parsers, mainly because a parser can be a *lot* faster if it
doesn't have to do a lot of buffer management (for example, if a parser
encounters an entity reference, it can just emit whatever it had stored
up previously and then just emit a pointer to the entity's replacement
text, rather than copying the replacement text into an internal buffer).
The general pattern for working with this type of parser is to initialize
your buffers when processing start tags, append to them when processing
characters, and deal with their contents when processing end tags.
------------------------------
Date: Thu, 30 Aug 2001 00:32:41 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how to get character from string one by one?
Message-Id: <3B8D8A1E.696D492@acm.org>
194.203.212.8, [demerphq@hotmail.com] wrote:
>
> > Yves Orton wrote:
> > >
> > > The tests that I ran...
> > >
> > > chop and vec have been omitted so far.
> >
> > Just a couple of points.
> >
> > > my $types={
> > > Scalar_only=>{
> > > 'substr4' => 'substr ($s, 0, 1, "") while length($s)',
> > > 'substr3' => 'substr( $s, $_, 1 ) foreach (0..length($s)-1)',
> > > },
> > > Regexp=>{
> > > 'rex_dot' => '$s =~ /(.)/gs',
> > > 'rex_class' => '$s =~ /([\x00-\xFF])/gs',
> > ^
> > The /s modifier isn't required as you are not using the period (.) in
> > the regex.
>
> Hmm. Ok. But do you think it affects efficiency?
A bit, but not much. :)
use Benchmark qw(cmpthese timethese);
our $text = ' ' x 80;
substr( $text, $_, 1 ) = chr rand( 256 ) for 0 .. 79;
our $len;
my %test = (
with_s => \&with_s,
no_s => \&no_s,
);
sub with_s {
my $x = substr $text, 0, $len;
my @x = $x =~ /([\x00-\xFF])/gs;
}
sub no_s {
my $x = substr $text, 0, $len;
my @x = $x =~ /([\x00-\xFF])/g;
}
for ( $len = 10; $len <= 80; $len += 10 ) {
print "string length: $len\n";
my $result = timethese( -10, \%test, 'none' );
cmpthese( $result );
}
__END__
string length: 10
Rate with_s no_s
with_s 4949/s -- -1%
no_s 5005/s 1% --
string length: 20
Rate with_s no_s
with_s 2690/s -- -0%
no_s 2695/s 0% --
string length: 30
Rate with_s no_s
with_s 1839/s -- -1%
no_s 1857/s 1% --
string length: 40
Rate with_s no_s
with_s 1385/s -- -1%
no_s 1399/s 1% --
string length: 50
Rate with_s no_s
with_s 1113/s -- -0%
no_s 1116/s 0% --
string length: 60
Rate no_s with_s
no_s 936/s -- -0%
with_s 940/s 0% --
string length: 70
Rate with_s no_s
with_s 799/s -- -2%
no_s 815/s 2% --
string length: 80
Rate no_s with_s
no_s 702/s -- -0%
with_s 703/s 0% --
> > > },
> > > List_only=>{
> > > 'unpack' => 'unpack("C*", $s)',
> >
> > map { chr } unpack( 'C*', $s )
>
> Yes I suppose. This gets into the the issue of whether it matters
> that the result is a list of chars or a list of ordinal values of
> chars. Perhaps I should do both?
>
> > unpack( 'a' x length $s, $s )
>
> Ahah! Now thats what I didnt think of....
chr( vec( $s, $_, 8 ) ) for 0 .. length($s)-1
John
--
use Perl;
program
fulfillment
------------------------------
Date: Thu, 30 Aug 2001 08:24:42 +0800
From: MMX166+2.1G HD <no@mail.addr>
Subject: MultiThread with fork?
Message-Id: <r0hpotgh0vaugk9abk37rlsr2h1j3jo5sb@4ax.com>
my perl, v5.6.1 built for MSWin32-x86-multi-thread, does not support
Thread. and someone told me to use fork instead. but I've never used
fork before, how can I use it to do multi-task works? for example, I
want to download a huge file in several "threads". each of them
downloads a part of the file. I tried this code:
>$fid=$$;
>for ($i=0;$i<3 ;$i++) {
> fork;
> if ($$!=$fid) {
> dosome();
> exit;
> }
>}
but, it creates and executes these three processes one by one, that
is, creates one and wait for it returns, and creates the next, just
like
>for ($i=0;$i<3 ;$i++) {
> dosome();
>}
obviously it is not like multi-thread. how can I do without the Thread
module?
------------------------------
Date: Wed, 29 Aug 2001 23:19:38 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Pattern matching, grabing everything right of the match
Message-Id: <999127178.657344937790185.gnarinn@hotmail.com>
In article <acaf067b.0108290820.28c6f231@posting.google.com>,
Steve McDonald <steve_mcdonald@choicehotels.com> wrote:
>
>I have a script that posts data to a website and accepts the returning
>HTLM. I'm using iterations of the following to pull out values from
>the return. I have 19 values to extract. The problem I am having is
>some of the values are of variable length and words. Is there a
>"universal" replacement for "\w+.\w+." that will grab all characters
>to the right of the pattern no matter how long or how many spaces
>there are?
>
>@strlist = split(/\n/, $html); # Splits $html into substrings by line
>foreach $str(@strlist) {
>if($str =~/CurrentTicketStatus=(\w+.\w+.)/ ) {
> $its_status = $1;
> print "ITS STatus = $its_status\n";
> next;
> }
>}
>
i dont know what you are asking. if you want the rest of the line:
if ($str =~/CurrentTicketStatus=(.*)$/ ) {
if you want something else, give us an example of the data,
and tell us what you want to be matched.
gnari
------------------------------
Date: Wed, 29 Aug 2001 17:11:19 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Pattern matching, grabing everything right of the match
Message-Id: <3B8D84A7.C7639EB1@stomp.stomp.tokyo>
Steve McDonald wrote:
> Is there a "universal" replacement for "\w+.\w+." that will grab
> all characters to the right of the pattern no matter how long or
> how many spaces there are?
> @strlist = split(/\n/, $html); # Splits $html into substrings by line
> foreach $str(@strlist) {
> if($str =~/CurrentTicketStatus=(\w+.\w+.)/ ) {
> $its_status = $1;
> print "ITS STatus = $its_status\n";
> next;
> }
> }
A presumption is made one or more characters will always
follow your key term. Whatever is there, or not there,
will be printed.
if (index ($str, "CurrentTicketStatus=") > -1)
{ print substr ($str, index ($str, "CurrentTicketStatus=") + 20); }
or if you like,
if (index ($str, "CurrentTicketStatus=") > -1)
{ print "ITS STatus = ", substr ($str, index ($str, "CurrentTicketStatus=") + 20); }
You don't need $its_status,
print "ITS STatus = $1 \n";
You don't need next; in your loop.
Godzilla!
------------------------------
Date: Thu, 30 Aug 2001 09:36:17 +1000
From: "Knob" <andrew.savige@ir.com>
Subject: Re: Performance : Shell X Perl
Message-Id: <R%ej7.5$7W4.1083@news0.optus.net.au>
"Abigail" <abigail@foad.org> wrote in message
news:slrn9oq4j6.t86.abigail@alexandra.xs4all.nl...
>
> Why don't you just say "Prerequisite: perl 5.X.Y". Just as you might have
> a requirement of a minimum amount of diskspace or physical memory. You
> don't ship disks or RAM with your product either, do you?
>
> Abigail
I could try that, but I would certainly be overruled by Product Management.
Hopefully in a year or two when all our platforms come with Perl 5
pre-installed.
Those that currently dont include AIX prior to AIX433 and HP-UX
(comes with Perl 4 pre-installed!!). If anyone from HP is listening, please
note that upgrading to Perl 5 would be appreciated by the Perl community.
There is a strong business case for "out of the box installs".
After all, most customers don't care if the product is written in Perl or C
or whatever; they just want it to work with minimum effort on their part.
Asking a non-technical person to download and install Perl does not
look good, especially in a pre-sales situation, where you are trying to
emphasize how easy it is to install and use your product.
We face a similar dilemma in the Windows market. Do you create a MSI
file and ask the customer to first download Windows Installer before
installing
your product, or do you go for "out of the box" installs via InstallShield?
Andrew.
------------------------------
Date: 29 Aug 2001 20:18:24 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Prlbm installing sybperl on Solaris 2.6.
Message-Id: <87d75ebb1b.fsf@limey.hpcc.uh.edu>
>> On Wed, 29 Aug 2001 15:25:53 -0400,
>> "John Do" <hdx64@hotmail.com> said:
> Hi , When I tried to install sybperl 2.13 on Sol2.6 with
> Sybase library 10.xx.
> Doing "make" i got: cc -c -I/usr/vendor/sybase/include
> -I/usr/local/include -O
> /usr/ucb/cc: language optional software package not
> installed
Get ye to comp.unix.solaris but first look at
http://www.science.uva.nl/pub/solaris/solaris2.html#q5.36
and
http://www.science.uva.nl/pub/solaris/solaris2.html#q6
Nothing to do with perl, you just don't have a C compiler
installed on your machine.
Please read the FAQ before doin anything in c.u.s, this
crops up *all* the time and annoys people greatly.
follow-up set.
hth
t
PS It's "problem" not "prlbm".
--
Yes way! Mmmmkay?
------------------------------
Date: Wed, 29 Aug 2001 21:48:41 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Re: how to get character from string one by one?
Message-Id: <slrn9or6rp.5ak.tadmc@tadmc26.august.net>
194.203.212.8 [demerphq@hotmail.com] <194.203.212.8[demerphq@hotmail.com]> wrote:
>> Yves Orton wrote:
>> > 'rex_class' => '$s =~ /([\x00-\xFF])/gs',
>> ^
>> The /s modifier isn't required as you are not using the period (.) in
>> the regex.
>
>Hmm. Ok. But do you think it affects efficiency?
Without a doubt it has a negative effect on efficiency.
When I see code with "non-default" things, such as options,
I have to pause in scanning the code to make sure I get what
non-standard thing is happening...
... only to discover that NO non-standard thing is happening.
I was tricked into wasting time considering what the 's' was
there for. I do my best to not trick myself when writing code.
I drop little bread crumbs behind me to help find my way when
I have to eat my own dog food and change a program I haven't
seen for months. I call it a Good Kind of "selfish".
But maybe you were speaking of optimizing something other than
maintenance labor?
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Aug 2001 22:29:32 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: use() versus import() changing semantics?
Message-Id: <9mjqcc$2mupf$1@fu-berlin.de>
Soren A. <soren@doesntwantspam.nowhere.non> wrote:
> As you know (because we've been corresponding on this) I am aware of what you've tried up to now. I wondered how common it is to
> use prototyping in a subroutine definition in a module like this "URI::Find." I have looked at the code of a lot of modules and I cannot
> recall having seen it before. Now, Schwern (the module's author) is the Perl Kwality Kontrol pumpking, so I dare not suggest that he
> doesn't know what he's doing (or more to the point, *why*), but I wondered if anyone on this ng can shed some light on why anyone
> would complicate things this way to begin with ;-)? I'm not sure it seems worth it, going by (what little) I know.
this is from the docs:
| NOTE: The prototype on find_uris() is already getting annoying to me.
| I might remove it in a future version.
so... maybe tassilo should check the version before calling
the method. or just require a version > 0.11 for his program/module.
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
--- Warning: content of homepage hopelessly out-dated ---
------------------------------
Date: Thu, 30 Aug 2001 00:55:50 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: use() versus import() changing semantics?
Message-Id: <3B8D72F6.5080008@post.rwth-aachen.de>
Tina Mueller wrote:
> this is from the docs:
> | NOTE: The prototype on find_uris() is already getting annoying to me.
> | I might remove it in a future version.
>
> so... maybe tassilo should check the version before calling
> the method. or just require a version > 0.11 for his program/module.
Hmmh....I am sure all would break if I required a version > 0.11 since
there is none. ;-)
I am, however, considering using the object-oriented approach to the
matter since it no longer has this prototype weirdness.
But as for yet, I'll keep the old one for compatibility (0.11 requires
Perl 5.005, while my module is supposed to work with 5.004) especially
since it works now with the BEGIN-block.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: Wed, 29 Aug 2001 22:59:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Using Perl to explore an MSSQL database
Message-Id: <1msqot0k2p0jutrkb61efe5vo9mdvv07bk@4ax.com>
Logix wrote:
>I want to explore an MSSQL database using perl. I can connect to the
>database and execute a query but I've got a problem writing the results out.
>I would like to display the names of the columns of the table but I can't
>find to correct way to do this. Is there anyone who can help me?
Assuming you're using DBI (plus DBD::ODBC, for example), check out the
"NAME" attribute of a statement handle, and its siblings "NAME_lc" and
"NAME_uc" (lower case and upper case respectively). "perldoc DBI" can
give you the docs.
--
Bart.
------------------------------
Date: Wed, 29 Aug 2001 21:50:46 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Valid IP address format
Message-Id: <slrn9or6vm.5ak.tadmc@tadmc26.august.net>
E.Chang <echang@netstorm.net> wrote:
>groups.google.com is an archive of Usenet groups that can be both
>browsed and searched. Look there first for answers to your questions.
^^^^^
Heavens no!
Look there _second_ (after Perl's standard docs).
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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.
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 1652
***************************************