[22697] in Perl-Users-Digest
Perl-Users Digest, Issue: 4918 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 30 18:05:53 2003
Date: Wed, 30 Apr 2003 15:05:07 -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, 30 Apr 2003 Volume: 10 Number: 4918
Today's topics:
Re: $::var notation <fxn@hashref.com>
Re: $::var notation <uri@stemsystems.com>
Re: AUTOLOAD runs repetitively on destruction <jaspax@u.washington.edu>
Re: AUTOLOAD runs repetitively on destruction <tassilo.parseval@rwth-aachen.de>
built in function 'map' examples? <robert.j.sipe@boeing.com>
Re: built in function 'map' examples? <mpapec@yahoo.com>
Re: Comparing strings with small differences <mlm@nospam.com>
Re: complex text/file search. help please!!! <mbudash@sonic.net>
CPAN Solaris problem <goedicke@goedsole.com>
Re: CPAN Solaris problem <tony_curtis32@yahoo.com>
Re: Data::Dumper::SortKeys (not working for 2nd level <TruthXayer@yahoo.com>
Equivalent for ksh select? <gregg.dameron@lmco.com>
Re: errors passing values to sub from other sub with "u <REMOVEsdnCAPS@comcast.net>
how to define exceptions for Lingua::EN::NameParse <bing-du@tamu.edu>
Re: Netscape Enterprise 3.5 and flock <noneya@biz.com>
Re: Parsing multiple files and mixing the data <r1534c@motorola.com>
Re: Perl - DBI - How to store connection info in a sepa ctcgag@hotmail.com
quotemeta matching problem (Lars)
Re: Race problem in 5.6.1 - Not Von Neumann anymore? (John Long)
Re: waste of time <uri@stemsystems.com>
Re: waste of time <annoyed@you.now>
What is the best software to run for an aspiring Perl p (dalgould)
Re: What is the best software to run for an aspiring Pe <goedicke@goedsole.com>
Re: What is the best software to run for an aspiring Pe <noreply@gunnar.cc>
Re: What is the best software to run for an aspiring Pe <News@LearnQuick.Com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 Apr 2003 18:09:47 +0000 (UTC)
From: Xavier Noria <fxn@hashref.com>
Subject: Re: $::var notation
Message-Id: <b8p3hb$v62$1@news.ya.com>
In article <b8oup3$c7bba$1@ID-121117.news.dfncis.de>, Ben wrote:
: The script has "local ($::var) = 0;" at the top and some functions
: defined within that use it. It would probably be required in another
: script (though grepping for it was unhelpful). There doesn't seem to be
: a need for $:: in this instance though unless I am missing something.
Maybe it was a defensive localisation in case the file was do()ed somehow.
Is $::var the real name? If not, does the actual name suggests that? Is that
variable used by the code or routines called from within the file?
-- fxn
------------------------------
Date: Wed, 30 Apr 2003 18:35:09 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: $::var notation
Message-Id: <x7el3jx28z.fsf@mail.sysarch.com>
>>>>> "JS" == Janek Schleicher <bigj@kamelfreund.de> writes:
JS> Ben wrote at Wed, 30 Apr 2003 10:19:59 -0500:
>> I encountered this in a perl script and am wondering if someone can tell
>> me what it does and where to find out more about it.
JS> $::var notation
JS> stands for the variable called 'var' from the current package.
no, it is in main::
a prefix of :: is just a shortcut for main::
see perldoc -f package for the details
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 30 Apr 2003 12:56:58 -0700
From: JS Bangs <jaspax@u.washington.edu>
Subject: Re: AUTOLOAD runs repetitively on destruction
Message-Id: <Pine.A41.4.53.0304301209430.73680@dante29.u.washington.edu>
Benjamin Goldberg sikyal:
> > > Is there a way to turn the above into proper methods that you can
> > > compile on the fly? Right now, AUTOLOAD is triggered for each call to
> > > the same feature. Something like
> > >
> > > if ($self->feature($feature)) {
> > > *$AUTOLOAD = eval qq!
> > > sub $feature {
> > > my (\$self, \$idx) = \@_;
> > > ...
> > > }
> > > !;
> > > goto &$AUTOLOAD;
> > > }
>
> That doesn't look quite right. It should either be:
>
> *$AUTOLOAD = sub { .... };
> Or
> *$AUTOLOAD = eval qq!sub { .... }!;
I don't think either of these is correct for what I wish to do. In either
case, you're defining a symbol table entry *$AUTOLOAD which is a reference
to an anonymous sub. What I *want* to do, however, is create a true
subroutine which can be called as a method after it is defined. Coderefs
explicitly do not allow you to do this.
> Or:
> eval qq!sub $AUTOLOAD { ... };
This one, however, does seem to be correct. If it's meant to be synonymous
with the first two, I've severely misunderstood something. I'm not at a
machine that has perl, or else I would test these three to see which one
behaves properly.
I'm not trying to be a pain, but I only hazily understand the use of
typeglobs, and I'm hoping to expand my knowledge.
> But not:
> *$AUTOLOAD = eval qq!sub $AUTOLOAD { .... }!;
I agree that this is redundant. But it does work as expected.
> > The old code, which looked broken, didn't have this problem. And I'm
> > stumped--the best I can think of is to define a local DESTROY, but
> > that's an inelegant way to hack out of this.
>
> Actually, creating a "sub DESTROY {}" is probably the most optimal fix,
> since you *know* that it's going to eventually get called, and you don't
> need it to do anything.
Earlier I had just put "return if $AUTOLOAD =~ /DESTROY$/" near the top of
the sub. Neither way seems particularly nice, though adding a "sub DESTROY
{}" will probably run faster.
Jesse S. Bangs jaspax@u.washington.edu
http://students.washington.edu/jaspax/
http://students.washington.edu/jaspax/blog
Jesus asked them, "Who do you say that I am?"
And they answered, "You are the eschatological manifestation of the ground
of our being, the kerygma in which we find the ultimate meaning of our
interpersonal relationship."
And Jesus said, "What?"
------------------------------
Date: 30 Apr 2003 21:04:46 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: AUTOLOAD runs repetitively on destruction
Message-Id: <b8pdpe$g4q$1@nets3.rz.RWTH-Aachen.DE>
Also sprach JS Bangs:
> Benjamin Goldberg sikyal:
>
>> > > Is there a way to turn the above into proper methods that you can
>> > > compile on the fly? Right now, AUTOLOAD is triggered for each call to
>> > > the same feature. Something like
>> > >
>> > > if ($self->feature($feature)) {
>> > > *$AUTOLOAD = eval qq!
>> > > sub $feature {
>> > > my (\$self, \$idx) = \@_;
>> > > ...
>> > > }
>> > > !;
>> > > goto &$AUTOLOAD;
>> > > }
>>
>> That doesn't look quite right. It should either be:
>>
>> *$AUTOLOAD = sub { .... };
>> Or
>> *$AUTOLOAD = eval qq!sub { .... }!;
>
> I don't think either of these is correct for what I wish to do. In either
> case, you're defining a symbol table entry *$AUTOLOAD which is a reference
> to an anonymous sub. What I *want* to do, however, is create a true
> subroutine which can be called as a method after it is defined. Coderefs
> explicitly do not allow you to do this.
They do allow this. Consider this example that shows how you could in
theory define a subroutine in yet another way:
*main::func = sub { print "@_" };
func(1, 2, 3);
__END__
1 2 3
This is what the provided snippets in AUTOLOAD do.
>> Or:
>> eval qq!sub $AUTOLOAD { ... };
>
> This one, however, does seem to be correct. If it's meant to be synonymous
> with the first two, I've severely misunderstood something. I'm not at a
> machine that has perl, or else I would test these three to see which one
> behaves properly.
All of them should. As always, Perl offers several ways of doing the
same thing. The standard
sub func { ... }
is nothing else than a shortcut for directly assigning a code-ref to the
code-slot of a typeglob.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Wed, 30 Apr 2003 18:03:26 GMT
From: "Robert" <robert.j.sipe@boeing.com>
Subject: built in function 'map' examples?
Message-Id: <HE64to.2qG@news.boeing.com>
The built in 'map' function is really a powerful tool and have used it a
fair amount. However, the syntax of its use is still confusing for the more
elaborate uses. I have read the perldoc page and studied the Effective Perl
Programming book but would like to find more examples to draw upon.
Pointers to good books, webpages, user examples, FAQs... would be
appreciated.
Thanx in advance.
------------------------------
Date: Wed, 30 Apr 2003 22:38:26 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: built in function 'map' examples?
Message-Id: <rcc0bvs4mm73p5ptld17nbs5atvpnn1go1@4ax.com>
X-Ftn-To: Robert
"Robert" <robert.j.sipe@boeing.com> wrote:
>The built in 'map' function is really a powerful tool and have used it a
>fair amount. However, the syntax of its use is still confusing for the more
>elaborate uses. I have read the perldoc page and studied the Effective Perl
>Programming book but would like to find more examples to draw upon.
>Pointers to good books, webpages, user examples, FAQs... would be
>appreciated.
http://www.perl.com/doc/FMTEYEWTK/sort.html
I've learned a lot about map from Schwartizan transform; it's very powerfull
in chained list context. One thing I dislike about it is that nearest map in
chain is aliasing $_ to array values.
--
Matija
------------------------------
Date: Wed, 30 Apr 2003 16:16:50 -0500
From: mlm <mlm@nospam.com>
Subject: Re: Comparing strings with small differences
Message-Id: <aG2dnbqkd6XfoC2jXTWcpQ@giganews.com>
OK I give up. How does this work. It looks like magic to me. I see
that ^ does a bitwise XOR OK. But what is \000 matching? A binary
number? I can't figure out how the difference is extracted. I was not
aware you could treat $+ and $- as arrays.
Thanks
Mark
mlm <mlm@nospam.com> wrote in news:yVCdnbUOMcxlszKjXTWcog@giganews.com:
> Hey that is a great help Winfried. I am working out how it works now
> ...
>
> Thanks
> mark
>
>
> Winfried Koenig <w.koenig@acm.org> wrote in news:3EAD9204.9010508
> @acm.org:
>
>> #!/usr/local/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> my @a = (
>> "Polka dot (18), sheet 07.",
>> "Polka dot (19), sheet 07.",
>> "Polka dot (20), sheet 07.",
>> );
>>
>> foreach my $i (1 .. $#a) {
>> my $diff = $a[$i -1 ] ^ $a[$i];
>> if ($diff =~ m/[^\000]+/) {
>> printf "%d,%d\n", $-[0], $+[0] - $-[0];
>> }
>> }
>>
>> __END__
>>
>
>
------------------------------
Date: Wed, 30 Apr 2003 18:09:12 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: complex text/file search. help please!!!
Message-Id: <mbudash-7FE40E.11091130042003@typhoon.sonic.net>
In article <b8p2im$4hb$1@news.gte.com>,
wrm@rrscfi1.irngtx.tel.gte.com (William R. Mattil) wrote:
> In article <mbudash-0F7AFB.09002630042003@typhoon.sonic.net>,
> Michael Budash <mbudash@sonic.net> wrote:
> > open (D, "data") or die ("Can't open data: $!");
> > local $/ = "\f";
> > while (<D>) {
> > if (/^7002/m) {
> > my @lines = split /\n/;
> > print shift @lines, "\n";
> > foreach (@lines) {
> > print "$_\n" if /^7002/;
> > }
> > }
> > }
>
> Michael,
>
> I found this very interesting and informative but a question. The
> Original poster wanted something like:
>
> #Example of the data I need to pull
>
> #from record 1
> 145 Main St 001-34562032-100 831
> 7002 SPARK PLUG 45345
> 7002 SPARK PLUG 234234
>
> #from record 3
> 145 Main St 001-6734232-100 831
> 7002 SPARK PLUG 4342534523
>
> And from the data he presented:
>
> 145 Main St 001-34562032-100 831
> 7002 SPARK PLUG 45345
> 7002 SPARK PLUG 234234
> 7002 SPARK PLUG 4342534523
>
> The customer number from record three got lost in the shuffle. Am
> I understanding this correctly ?
>
> Best Regards
>
> Bill
i don't see the problem...?
--
Michael Budash
------------------------------
Date: Wed, 30 Apr 2003 19:38:31 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: CPAN Solaris problem
Message-Id: <m365ovvkr8.fsf@mail.goedsole.com>
Dear Y'all -
I'm having a problem using CPAN as follows:
Testing if you have a C compiler
cc -c test.c
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `test.o'
The thing I don't get is that I never had /usr/ucb/cc rather I have
/usr/local/bin/gcc and did when I originally built perl. gcc is in
$PATH. Can anyone give me a tip on how to get CPAN to use gcc instead
of the non-existant cc?
Yours - Billy
============================================================
William Goedicke goedicke@goedsole.com
http://www.goedsole.com:8080
============================================================
Lest we forget:
The best documentation is a collection of succinctly explained simple
examples of every aspect of a system.
- William Goedicke
------------------------------
Date: Wed, 30 Apr 2003 15:52:26 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: CPAN Solaris problem
Message-Id: <87issvu2r9.fsf@limey.hpcc.uh.edu>
>> On Wed, 30 Apr 2003 19:38:31 GMT,
>> William Goedicke <goedicke@goedsole.com> said:
> Dear Y'all - I'm having a problem using CPAN as follows:
> Testing if you have a C compiler cc -c test.c
> /usr/ucb/cc: language optional software package not
> installed *** Error code 1 make: Fatal error: Command
> failed for target `test.o'
> The thing I don't get is that I never had /usr/ucb/cc
> rather I have /usr/local/bin/gcc and did when I
> originally built perl. gcc is in $PATH. Can anyone
> give me a tip on how to get CPAN to use gcc instead of
> the non-existant cc?
This means the perl installation you're extending with
CPAN modules was originally built with "cc" (presumably
some version of Workshop/Forte/Studio in this instance).
See
http://www.science.uva.nl/pub/solaris/solaris2.html#q3.75
for what to do about this (I suggest building your own
fresh install with the compiler you have to hand).
See also
http://www.science.uva.nl/pub/solaris/solaris2.html#q5.37
hth
t
------------------------------
Date: Wed, 30 Apr 2003 12:16:27 -0700
From: TruthXayer <TruthXayer@yahoo.com>
To: Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
Subject: Re: Data::Dumper::SortKeys (not working for 2nd level sort)
Message-Id: <3EB0210B.1FBA820F@yahoo.com>
Anno Siegel wrote:
> =
> TruthXayer <TruthXayer@yahoo.com> wrote in comp.lang.perl.misc:
> > This worked for the simple testcase(sor by value,key) on
> > first level hash. But on expansion it fails to sort by
> > second level
> > value.
> =
> So what do you see? For me (perl 5.8.0, DD 2.12) the code below
> dumps the hash in descending order of the ratio values: B, A, C.
Thanks Anno. It worked on perl580.
It did not do anything and printed the hash as is on 5.005
and 5.60
Summary of my perl5 (5.0 patchlevel 5 subversion 2)
Summary of my perl5 (revision 5.0 version 6 subversion 0)
configuration: =
Leads me to believe Data::Dumper was changed during these
versions..
thanks,
-TruTH
=
> Anno
> =
> >
> >
> > #!/perl -w
> > use strict;
> > use Data::Dumper;
> >
> > $Data::Dumper::Sortkeys =3D \&my_filter2;
> >
> > my %hash =3D (
> > "A" =3D> {
> > ratio =3D> 34
> > },
> > "B" =3D> {
> > ratio =3D> 75
> > },
> > "C" =3D> {
> > ratio =3D> 21
> > },
> > );
> >
> > print Dumper ( \%hash );
> >
> > sub my_filter2 {
> > my ($hash) =3D shift;
> > # return an array ref containing the hash keys
> > to dump
> > # in the order that you want them to be dumped
> >
> > return [ sort { $hash->{$b}->{ratio} <=3D>
> > $hash->{$a}->{ratio} } (keys %$hash) ];
> > }
-- =
thanks
-Tr=DCtH
__
Art is long, life short; judgement difficult, opportunity
transient."
-Goethe
------------------------------
Date: Wed, 30 Apr 2003 15:49:43 -0600
From: "Gregg Dameron" <gregg.dameron@lmco.com>
Subject: Equivalent for ksh select?
Message-Id: <b8pgdl$f711@cui1.lmms.lmco.com>
I have a ksh script I'm porting to Perl. The script runs in an xterm, is
interactive and text menu-driven (e.g., enter a numbered option, hit RETURN,
that sort of thing).
Some menus are quite large -- a couple hundred options. To make these menus
compact, and to save scrolling the xterm back to see all the options, I use
ksh's "select" command, which auto-numbers all the options and displays them
in multiple columns, optimizing the arrangement based the dimensions of the
terminal window.
Here's an example. If all the options I want in the menu are in a ksh list
of words, I can display a numbered, multi-column menu of them by saying:
PS3=""
select item in <list> do continue ; done < /dev/null
So if <list> is "Option_A Option_B Option_C ... Option_Z", here's what's
displayed in a 75x15 xterm:
1) Option_A 10) Option_J 19) Option_S
2) Option_B 11) Option_K 20) Option_T
3) Option_C 12) Option_L 21) Option_U
4) Option_D 13) Option_M 22) Option_V
5) Option_E 14) Option_N 23) Option_W
6) Option_F 15) Option_O 24) Option_X
7) Option_G 16) Option_P 25) Option_Y
8) Option_H 17) Option_Q 26) Option_Z
9) Option_I 18) Option_R
My question: Is there a Perl module or built-in equivalent for numbered,
multi-column, space-optimizing output?
Gregg Dameron
------------------------------
Date: Wed, 30 Apr 2003 16:50:06 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: errors passing values to sub from other sub with "use strict"
Message-Id: <Xns936DB5468FB02sdn.comcast@216.166.71.239>
"Tony" <anthony@movielink.net.au> wrote in
news:pan.2003.04.30.00.10.07.752027@movielink.net.au:
> Hi again,
>
> I have a further correction:
PLEASE copy/paste your program; do NOT retype it.
--
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
------------------------------
Date: Wed, 30 Apr 2003 16:55:16 -0500
From: Bing Du Test <bing-du@tamu.edu>
Subject: how to define exceptions for Lingua::EN::NameParse
Message-Id: <3EB04644.48D37AE9@tamu.edu>
Method case_surname is used. The document of Lingua::EN::NameParse
indicates surname_prefs.txt file can be used to define exceptions. But
in our situation, we want, for example ABC to be capitalized as Abc if
it appears in a person's name, keep ABC capitalized if it's in a
departname name or a title (e.g. ABC Manager).
Is it possible? How?
Thanks in advance for any ideas,
Bing
------------------------------
Date: Wed, 30 Apr 2003 14:14:56 -0400
From: "h8dnwld" <noneya@biz.com>
Subject: Re: Netscape Enterprise 3.5 and flock
Message-Id: <pan.2003.04.30.18.14.51.480916@biz.com>
On Mon, 28 Apr 2003 10:57:37 +0100, Andrew McGregor wrote:
> h8dnwld wrote:
>> I have a client that has a unpatched netscape enterprise 3.5 intranet web
>> server on novell 4.11. Upgrading or moving them to something better is
>> not a option. Can anyone tell me what the equivalent to Fcntl ':flock';
> I may have a old version of Netware, it specificly states you cannot use
the Fcntl to gain a exclusive lock, thanks for the http site.
>
> what have you tried?
>
> # All Perl modules shipped with the standard distribution are included
> in the NetWare. Some of the standard modules that get shipped with
> NetWare are Fcntl, IO and SDBM_FILE.
>
> http://developer.novell.com/ndk/doc/perl5/index.html?page=/ndk/doc/perl5/prl57enu/data/h4cr34aj.html
>
>
>> so I can gain a exclusive lock on a file that 15-20 users are trying to
>> update? I have no documentation with the server nor have I had any luck
>
> www.novell.com -> support -> documentation -> by product -> a-z ->
> developer -> Perl
>
>> on the Netscape enterprise web site. Any direction would be appreciated.
>>
>> m
------------------------------
Date: Wed, 30 Apr 2003 19:09:46 +0100
From: "Martin McKenny" <r1534c@motorola.com>
Subject: Re: Parsing multiple files and mixing the data
Message-Id: <b8p342$eja$1@newshost.mot.com>
"Martin McKenny" <r1534c@motorola.com> wrote in message
news:b8p0p3$bnb$1@newshost.mot.com...
> Hi All,
>
> I want to read in the lines of multiple files in parallel in order to
merge
> the elements of each file.
>
> So if we have three files with listed data as follows:
>
> File1 contains data: a1 a2 a3
> File2 contains data: b1 b2 b3
> File3 contains data: c1 c2 c3
>
> I want to merge these to get a file containing
>
> Output file : a1 b1 c1 a2 b2 c2 a3 b3 c3
>
> I need to do this as effieciently as possible as the files in question
> contain hundreds of thousands of data elements.
>
> Any help appreciated
> MMK
>
>
Sorry - I never included my first attempt which can only handle two files. I
know this is inefficient but my perl knowledge is not up to scratch
yet.....
See below
#!/usr/bin/perl
my $MEAN_FILE1;
open $MEAN_FILE1, $ARGV[0] or die "Can't open $ARGV[0] because $!\n";
$count1 = 0;
$count2 = 1;
while (<$MEAN_FILE1>) {
split;
$count2 = 0;
print "$_[0]\n" ;# Print the results
my $MEAN_FILE2;
open $MEAN_FILE2, $ARGV[1] or die "Can't open $ARGV[0] because $!\n";
while (<$MEAN_FILE2>) {
split;
if ($count2 == $count1) {
print "$_[0]\n" ;# Print the results
}
$count2++;
}
$count1++;
}
------------------------------
Date: 30 Apr 2003 21:30:50 GMT
From: ctcgag@hotmail.com
Subject: Re: Perl - DBI - How to store connection info in a separate file
Message-Id: <20030430173050.057$qV@newsreader.com>
deepak10000@hotmail.com (deepak p) wrote:
> Hello,
>
> I was wondering if anyone knows the syntax to include DBI connection
> info in a separate file and make a call to it from a perl dbi script.
>
> In the past, I have connection info hard coded in my dbi scripts and
> they ran file. However, its preferable that this info. is kept in an
> include file..that gets called instead of having this static info -
> hard coded in my dbi scripts.
>
> I have tried to commenting out the database connection info from my
> dbi scripts and copied the lines over to a file called
> "connection.info" also residing in the same directory and then tried
> inserting stmts like
>
> include "connection.info"
What I've done is make a module in my perl5lib path:
package My_Stuff;
sub Oracle {
DBI->connect("DBI:Oracle:blah","foo","bar", { RaiseError => 1 });
};
Then in my programs I just do:
my $dbh=My_Stuff::Oracle();
I've been happy with this. I'm thinking of adding a
require DBI;
to the connection subroutine, so I don't have to explicitly
use DBI in my programs, it will automatically load it if and only
if I actually ask for a connection. But I wasn't sure if I would also
need to run import (it seems like you don't need it for purely modules used
in a purely OO way), so I haven't tried it yet.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: 30 Apr 2003 14:36:45 -0700
From: rispalt@yahoo.se (Lars)
Subject: quotemeta matching problem
Message-Id: <7787ec4b.0304301336.81d854c@posting.google.com>
quote meta drives me crazy :)...
When I use the Q matching option it works but not when I use the quotemeta
function. Should it not give the same result?
Does not work:
$err = quotemeta $buffer{$key}{TRACE};
$lin = quotemeta $line;
chomp $lin;
if ( $lin =~ m£\${err}£ ) {
}
Does work:
$err = $buffer{$key}{TRACE};
$lin = $line;
chomp $lin;
if ( $lin =~ m£\Q${err}£ ) {
The string looks like:
../../C++/TargetRTS/DrhRfn_insOseProxyC_Actor.cpp:37 1 ERROR:index not found
Any ideas?
------------------------------
Date: 30 Apr 2003 13:30:46 -0700
From: goog1@pruam.com (John Long)
Subject: Re: Race problem in 5.6.1 - Not Von Neumann anymore?
Message-Id: <24ea2723.0304301230.2a6b079c@posting.google.com>
Bart Lateur <bart.lateur@pandora.be> wrote in message news:<c37vavgttabf8j895npp9acjlin3g6rogt@4ax.com>...
> John Long wrote:
>
> >If I have a form and post a single field (name) to this cgi,
> >it should wait at the -e and if the file does not exist then
> >go on and create it. What is happening 30-80% of the time is
> >that it says file exists and exits, I look and the file does
> >now exist where it did not before.
>
> It sounds a bit like a double submit, meanign the script runs twice in
> quick succession. It can happen in CGI scripts.
I figured it out, Thank you Bart for the clue. I was detoured
into the thought that it had to do with the new threads thing
in perl. I put in a js debounce and it still did it then I
went to look at the html source of the form and saw
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript'
src='http://127.0.0.1:1907/js.cgi?pa&r=32662'></script>
I disable ZA and it works just fine. I had to disable all
privacy stuff in ZA to get it to work with za on.
za ver 3.5.169 for anyone else out there with a possible
same problem. This new embedded stuff can affect all of us
with all the popup blocker code etc that earthlink and
others push on everyone.
I can not figure out any way to program for this possible
problem from personal firewalls and such. It would be bad
in my main app or any shopping/ banking app...
Looking in the logs, there were 2 accesses each time it messed up.
my.dom.com - - [30/Apr/2003:11:44:09 -0700] "POST /cgi/tst.cgi
HTTP/1.1" 200 663 "http://www.otherdom.com" "Mozilla/4.0 (compatible;
MS...
my.dom.com - - [30/Apr/2003:11:44:09 -0700] "POST /cgi/tst.cgi
HTTP/1.1" 200 203 "http://www.otherdom.com" "Mozilla/4.0 (compatible;
MS...
Thank you Benjamin Goldberg for responding, it seemed impossible
to be another process, I am the only clicker :)
And thank you Tramm Hudson, it was not that I was not getting an
error however you are very correct about || vs or.
That was some old code I pasted in for a quick test and missed
the || being wrong. Your explanation of that is the most concise
and clear I have seen. The standard talk of "binds tighter ..."
never was perfectly clear to me.
Just for others here is the debounce js code:
<SCRIPT language="JavaScript">
<!--
var clicks = 0
function CkClick() {
clicks++
return (clicks==1)
}
// -->
</SCRIPT>
<form action="app.cgi" method="post" onSubmit="return CkClick(this)">
share the knowledge
John
------------------------------
Date: Wed, 30 Apr 2003 18:39:37 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: waste of time
Message-Id: <x7ade7x21i.fsf@mail.sysarch.com>
>>>>> "s" == smugbuster <smugbuster@hotmail.com> writes:
anonymous posters are the most honest ones i know.
s> your little newsgroup or whatever you call it is a waste of time for
s> anybody trying to learn anything new.
i think you doth protest a little too much.
s> legitimate questions are disparaged, ridiculed, and made fun of.
s> what's wrong with you people? you were all newbies once!
i was never a newbie. i was born speaking perl.
s> my guess is that half of you don't know what you're talking about
s> anyway.
and you must be part of that half.
s> don't you have anything better to do than to get online and "flame"
s> people that may not have as much knowledge of the subject as you.
s> pathetic.
nah, we just flame jerks like you.
s> i suggest you get a life. you're all a little too smug for your own
s> good.
oh, how that hurts!! i will never be smug again. your wit and wisdom are
so powerful that my smugness shields are powerless! scottie, my smug
shields need more POWER!!
s> oh, also, i guess i'm not cool because i don't have a witty quip at
s> the end of my message, or use case sensitive words or end plural words
s> with a string of "z's."
nah, youz n0t K00i cuZ you 1ZZ dumb.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 30 Apr 2003 14:16:15 -0500
From: Ivan Marsh <annoyed@you.now>
Subject: Re: waste of time
Message-Id: <b8p7eh$p7k$1@grandcanyon.binc.net>
smugbuster wrote:
> your little newsgroup or whatever you call it is a waste of time for
> anybody trying to learn anything new.
>
> legitimate questions are disparaged, ridiculed, and made fun of.
> what's wrong with you people? you were all newbies once!
>
> my guess is that half of you don't know what you're talking about
> anyway.
>
> don't you have anything better to do than to get online and "flame"
> people that may not have as much knowledge of the subject as you.
> pathetic.
>
> i suggest you get a life. you're all a little too smug for your own
> good.
>
> oh, also, i guess i'm not cool because i don't have a witty quip at
> the end of my message, or use case sensitive words or end plural words
> with a string of "z's."
>
> jack
Thanks for insulting everyone here for the problems you've been having with
a few people.
Know how I make sure I'm not wasting my time?
I put you in my killfile.
HANL
--
i.m.
All views, opinions and alleged facts expressed by this tactless moron are
protected by the constitution of the United States of America and should be
taken as good natured and friendly unless specifically stated otherwise.
------------------------------
Date: 30 Apr 2003 11:51:32 -0700
From: dalgould@hotmail.com (dalgould)
Subject: What is the best software to run for an aspiring Perl programer?
Message-Id: <a26ee76d.0304301051.6b9af55d@posting.google.com>
Hello,
I have a question for anyone who may be able to answer.
What is the best and most avaiable way of testing my perl script from
my computer itself and not from my web server. I would like to test
my perl script locally on my computer first. What is the best
software to run for an aspiring Perl programer, on my home computer?
Im getting a little tired of uploading my perl script to my
CGI-directory over and over just to debug my script.
thank you in advance for any advice or tips!
--- Dal Gould
email is : dalgould@hotmail.com
------------------------------
Date: Wed, 30 Apr 2003 18:58:24 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: What is the best software to run for an aspiring Perl programer?
Message-Id: <m3n0i7vmm3.fsf@mail.goedsole.com>
Dear Dal -
dalgould@hotmail.com (dalgould) writes:
> What is the best and most avaiable way of testing my perl script from
> my computer itself and not from my web server.
Perl, available at: http://www.perl.com/pub/a/language/info/software.html
Yours - Billy
============================================================
William Goedicke goedicke@goedsole.com
http://www.goedsole.com:8080
============================================================
Lest we forget:
War is caused by the squabling of princes.
- Machievelli
------------------------------
Date: Wed, 30 Apr 2003 21:40:31 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: What is the best software to run for an aspiring Perl programer?
Message-Id: <b8p8r0$cgre7$1@ID-184292.news.dfncis.de>
dalgould wrote:
> What is the best and most avaiable way of testing my perl script from
> my computer itself and not from my web server.
If you are on Windows locally, I think you should check out
http://www.indigostar.com/indigoperl.htm
It's *very* easy to install, and you get Apache with CGI and PHP as well.
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 30 Apr 2003 21:09:30 GMT
From: "Herb Martin" <News@LearnQuick.Com>
Subject: Re: What is the best software to run for an aspiring Perl programer?
Message-Id: <eYWra.7358$8Z3.119031@twister.austin.rr.com>
Others have given good answers, also consider:
The 'best' software includes the SAME server and
version of Perl as your production web site runs.
So if you are hosted on a Win2000 machine with
IIS then Win2000 Server running IIS is your first
choice or the personal version on Win2000 Pro
or XP might be good alternatives. For these you
would likely run ActiveState Perl.
If your production web is on a Unix/Linux box
running Apache, ideally you would run the same
thing even if you had to buy a cheap box to do this.
You CAN build on Windows and send to Linux but
you must be a bit more careful to ensure that you
use ONLY common features and test carefully.
Being portable is one of the strengths of Perl but
no language is 100% compatible across different
OS's and across different Web server software.
Perl comes close.
--
Herb Martin
Try ADDS for great Weather too:
http://adds.aviationweather.noaa.gov/projects/adds
"dalgould" <dalgould@hotmail.com> wrote in message
news:a26ee76d.0304301051.6b9af55d@posting.google.com...
> Hello,
>
> I have a question for anyone who may be able to answer.
> What is the best and most avaiable way of testing my perl script from
> my computer itself and not from my web server. I would like to test
> my perl script locally on my computer first. What is the best
> software to run for an aspiring Perl programer, on my home computer?
>
> Im getting a little tired of uploading my perl script to my
> CGI-directory over and over just to debug my script.
>
> thank you in advance for any advice or tips!
>
> --- Dal Gould
> email is : dalgould@hotmail.com
------------------------------
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 4918
***************************************