[21987] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4209 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 3 09:05:55 2002

Date: Tue, 3 Dec 2002 06:05:13 -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           Tue, 3 Dec 2002     Volume: 10 Number: 4209

Today's topics:
    Re: A regex 'whoa' <bart.lateur@pandora.be>
    Re: A regex 'whoa' <bart.lateur@pandora.be>
    Re: A regex 'whoa' <nobull@mail.com>
    Re: A regex 'whoa' <bart.lateur@pandora.be>
    Re: A regex 'whoa' <mgjv@tradingpost.com.au>
    Re: advanced html form question <flavell@mail.cern.ch>
        any cool script site??? (keshav prasad)
    Re: Asterisk (was: disable Unicode in Perl 5.8 ?) <nobull@mail.com>
    Re: Asterisk (was: disable Unicode in Perl 5.8 ?) <bart.lateur@pandora.be>
        Cache the execution of a Perl CGI? <me@privacy.net>
    Re: Cache the execution of a Perl CGI? <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: Cache the execution of a Perl CGI? <me@privacy.net>
    Re: Cache the execution of a Perl CGI? <nobull@mail.com>
    Re: Closing an unsaved modded Excel spreadsheet? <spikey-wan@bigfoot.com>
    Re: Closing an unsaved modded Excel spreadsheet? <ouellmi@videotron.ca>
        how can i check if <iamsameer@hotmail.com>
    Re: how can i check if <josef.moellers@fujitsu-siemens.com>
    Re: how can i check if <iamsameer@hotmail.com>
    Re: how can i check if <kurzhalsflasche@netscape.net>
    Re: how can i check if <iamsameer@hotmail.com>
    Re: how can i check if <josef.moellers@fujitsu-siemens.com>
    Re: how can i check if <bart.lateur@pandora.be>
        Installing of Win32::API on Win2K <josef.moellers@fujitsu-siemens.com>
    Re: Installing of Win32::API on Win2K (Helgi Briem)
    Re: Installing of Win32::API on Win2K <josef.moellers@fujitsu-siemens.com>
    Re: Installing of Win32::API on Win2K <bart.lateur@pandora.be>
    Re: Installing of Win32::API on Win2K (Helgi Briem)
    Re: Installing of Win32::API on Win2K <josef.moellers@fujitsu-siemens.com>
    Re: Installing of Win32::API on Win2K (Helgi Briem)
    Re: Installing of Win32::API on Win2K <josef.moellers@fujitsu-siemens.com>
    Re: Installing of Win32::API on Win2K (Helgi Briem)
        Kicking off commands on a remote machine <robconvery@totalise.co.uk>
    Re: mysql <bart.lateur@pandora.be>
    Re: mysql <bart.lateur@pandora.be>
    Re: perl on RedHat8 <mgjv@tradingpost.com.au>
    Re: reference to a tied hash <nobull@mail.com>
    Re: sys/wait.ph problem (Ben Morrow)
    Re: Timezone (Villy Kruse)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 03 Dec 2002 12:02:49 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: A regex 'whoa'
Message-Id: <q97puugm26k7qp7n1jtt5juqmmvt96287a@4ax.com>

Bryan wrote:

>I saw this in a colleagues code today (I SWEAR it's not mine!):
>
>$part1 =~ 
>/^(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*([-|\+])\s*\t*$/;
>
>Comments?

Tabs are whitespace. All occurrences of "\s*\t\s*" can be replaced with
just "\s+".

-- 
	Bart.


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

Date: Tue, 03 Dec 2002 12:19:07 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: A regex 'whoa'
Message-Id: <a88puuohhp9cp1snr7ocrsjmcpejef99qp@4ax.com>

Vilmos Soti wrote:

>The problem is that "\s*\t\s*"
>will fail since the first \s* will consume the tab. Thus the \t
>will not match anything, game over.

Have you ever heard of backtracking? They're a very important concept in
regex processing.

-- 
	Bart.


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

Date: 03 Dec 2002 12:15:12 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: A regex 'whoa'
Message-Id: <u93cpfe1tb.fsf@wcl-l.bham.ac.uk>

Bart Lateur <bart.lateur@pandora.be> writes:

> Bryan wrote:
> 
> >I saw this in a colleagues code today (I SWEAR it's not mine!):
> >
> >$part1 =~ 
> >/^(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*([-|\+])\s*\t*$/;
> >
> >Comments?
> 
> Tabs are whitespace. 

True.

> All occurrences of "\s*\t\s*" can be replaced with just "\s+".

This is only true if you are not relying on the fact that the regex
will reject inputs that lack tabs.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 03 Dec 2002 12:20:55 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: A regex 'whoa'
Message-Id: <mc8puuctphr2vnb5auveetoeubv2mg10f0@4ax.com>

Bryan wrote:

>I saw this in a colleagues code today (I SWEAR it's not mine!):
>
>$part1 =~ 
>/^(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*([-|\+])\s*\t*$/;
>
>Comments?

Personally I think I'd prefer to use split().

-- 
	Bart.


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

Date: Tue, 3 Dec 2002 23:37:43 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: A regex 'whoa'
Message-Id: <slrnaup9cn.1rk.mgjv@martien.heliotrope.home>

On Tue, 03 Dec 2002 12:02:49 GMT,
	Bart Lateur <bart.lateur@pandora.be> wrote:
> Bryan wrote:
> 
>>I saw this in a colleagues code today (I SWEAR it's not mine!):
>>
>>$part1 =~ 
>>/^(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*(\d+)\s*\t\s*\d+\s*\t\s*([-|\+])\s*\t*$/;
>>
>>Comments?
> 
> Tabs are whitespace. All occurrences of "\s*\t\s*" can be replaced with
> just "\s+".

Unless the original author of that regular expression wanted to make
sure that the separator contained at least one tab, surrounded by
optional other whitespace. Hard to tell without any context or comments.
Also see my other post in this thread.

"   " will be matched by \s+, but not by \s*\t\s*

Martien
-- 
                        | 
Martien Verbruggen      | Begin at the beginning and go on till you
                        | come to the end; then stop.
                        | 


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

Date: Tue, 3 Dec 2002 11:55:20 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: advanced html form question
Message-Id: <Pine.LNX.4.40.0212031149320.20938-100000@lxplus073.cern.ch>

On Dec 3, Tassilo v. Parseval inscribed on the eternal scroll:

> Also sprach William Alexander Segraves:
>
> > "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
> > message news:asgq6c$aum$1@nets3.rz.RWTH-Aachen.DE...
>
> [ CGI.pm's HTML generation ]

I suggest that you guys call a truce ;-)  I've used both methods of
generating snippets of HTML - on the one hand CGI.pm's methods, seeing
that I'd be using CGI.pm already, or on the other hand Here-documents
or other sources of snippets of HTML boilerplate - and could be
comfortable with either in many contexts.

Generating form elements, I'd certainly veer towards fully exploiting
the CGI.pm methods, I guess that speaks for itself.  Generating simple
boilerplate (with maybe the occasional variable interpolation) I think
I'd more often veer towards Here-docs.  But I don't think it's worth
arguing the point one way or the other, compared with some
more-important aspects of CGI programming (like security...)

> Consistency isn't the worst for a beginner. It probably requires some
> experience to come up with one's own preferences and style.

Indeed.

all the best



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

Date: 3 Dec 2002 04:32:01 -0800
From: keshavforever@rediffmail.com (keshav prasad)
Subject: any cool script site???
Message-Id: <5784681f.0212030432.1a36b72e@posting.google.com>

Guys ...

if you know any cool network script site.. please tell me


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

Date: 03 Dec 2002 12:10:16 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Asterisk (was: disable Unicode in Perl 5.8 ?)
Message-Id: <u97kere21j.fsf@wcl-l.bham.ac.uk>

"Andreas Gohr" <a.gohr@web.de> writes:

> On Sun, 01 Dec 2002 23:02:37 +0000, Benjamin Goldberg wrote:
> > I don't see your problem -- Obviously, you've got to have two code
> > paths, but that's not especially difficult.
> > 
> >    BEGIN {
> >        my $have_encode = eval {
> >          require Encode;
> >          import  Encode qw(encode);
> >          1;
> >       } || 0;
> >       *HAVE_ENCODE = sub () { $have_encode };
> >    }
> 
> Thanks a lot. This works fine and is more elegant than checking for the
> Perl version. Just a question on the syntax. What does the asterisk in
> *HAVE_ENCODE stand for?

Typeglob (aka symbol tablem entry).

> I've never seen that before... How does it work?

See perldata/"Typeglobs and Filehandles"

> Any FAQ sections I have to read?

FAQs are not the primary documentation.  Reference manuals are the
primary documentation.  FAQs are, well, FAQs.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 03 Dec 2002 12:50:41 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Asterisk (was: disable Unicode in Perl 5.8 ?)
Message-Id: <uf9puukbod7c71f8o7kphnq1oj9j3ge4fa@4ax.com>

Andreas Gohr wrote:

>On Sun, 01 Dec 2002 23:02:37 +0000, Benjamin Goldberg wrote:
>> I don't see your problem -- Obviously, you've got to have two code
>> paths, but that's not especially difficult.
>> 
>>    BEGIN {
>>        my $have_encode = eval {
>>          require Encode;
>>          import  Encode qw(encode);
>>          1;
>>       } || 0;
>>       *HAVE_ENCODE = sub () { $have_encode };
>>    }

Can't this be cleaned up to:

	use constant HAVE_ENCODE => eval {
	          require Encode;
	          import  Encode qw(encode);
	          1;
	  } || 0;

>Thanks a lot. This works fine and is more elegant than checking for the
>Perl version. Just a question on the syntax. What does the asterisk in
>*HAVE_ENCODE stand for? I've never seen that before... How does it work?
>Any FAQ sections I have to read?

All global variables of the same name, $y, @y, %y, the handle y, the sub
y, the format y etc. are all stored in one record associated with the
name "y", in a Symbol Table hASH, AKA a "stash". The name of such a
record is a typeglob, prefix "*".

This here is an assignment of a reference to a typeglob, which is
magical as it results in only the slot for that type of reference in the
typeglob to be modified. For example:

	$x = 'Cheers';
	@y = qw(a b c);
	*y = \$x;
	print "$y - @y\n";

Result:
	Cheers - a b c

So $y's behaviour is modified, now it's an alias to the original $x:
modify the value in $y, and $x will follow -- but other slots, like @y
etc, are left alone.

p.s. it only works for global variables, of course, as those are the
only variables stored in a typeglob.


I first read about it in the O'Reilly book "Advanced Perl Programming",
but I'm not sure where I should point you to, otherwise. "perlref"
appears to contain quite some info on typeglobs.

-- 
	Bart.


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

Date: Tue, 3 Dec 2002 21:01:29 +0800
From: "Peter Wu" <me@privacy.net>
Subject: Cache the execution of a Perl CGI?
Message-Id: <asi9ve$r9o0q$1@ID-117651.news.dfncis.de>

I'm doing CGI programming in Perl.

I understand that an CGI script is interpreted when requested instead of
being compiled into native code before executed.

I wonder if there is anything that can *cache* the native code generated by
the 1st execution of that particular CGI. Say, I have a test.cgi. When a
request for the test.cgi arrives, the cgi script gets interpreted and
executed. Afterwards, it will get interpreted for the 2nd time when a 2nd
request arrives.

Thanks for any input.

--
This message is provided "AS IS" with no warranties, and confers no rights.




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

Date: Tue, 3 Dec 2002 13:05:01 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Cache the execution of a Perl CGI?
Message-Id: <asia5t$6no$1@korweta.task.gda.pl>

In article <asi9ve$r9o0q$1@ID-117651.news.dfncis.de>, Peter Wu wrote:
> I'm doing CGI programming in Perl.
> 
> I understand that an CGI script is interpreted when requested instead of
> being compiled into native code before executed.
> 
> I wonder if there is anything that can *cache* the native code generated by
> the 1st execution of that particular CGI. Say, I have a test.cgi. When a
> request for the test.cgi arrives, the cgi script gets interpreted and
> executed. Afterwards, it will get interpreted for the 2nd time when a 2nd
> request arrives.


What is your Perl question?


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: Tue, 3 Dec 2002 21:07:39 +0800
From: "Peter Wu" <me@privacy.net>
Subject: Re: Cache the execution of a Perl CGI?
Message-Id: <asiaau$r951l$1@ID-117651.news.dfncis.de>

"Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
>
> What is your Perl question?

The Perl question is whether there is a way to cache the native code
generated by the interpreter. I just use CGI in Perl as an example. Hope you
have some ideas.




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

Date: 03 Dec 2002 13:39:21 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Cache the execution of a Perl CGI?
Message-Id: <u9y977cjcm.fsf@wcl-l.bham.ac.uk>

"Peter Wu" <me@privacy.net> writes:

> I'm doing CGI programming in Perl.
> 
> I understand that an CGI script is interpreted when requested instead of
> being compiled into native code before executed.

The truth is somewhere between.  A Perl script compiled into an
intermediate virtual machine code (sometimes called a p-code) just
before execution.  (This has nothing to do with CGI).

> I wonder if there is anything that can *cache* the native code generated by
> the 1st execution of that particular CGI.

If, as you say, you _understand_ that Perl is not compiled into native
code how can you wonder that?

Even if I change 'native' to 'p-' the answer is still 'no'.  There is
in the current version of Perl no way to (usefully) have a precompiled
Perl executable.  The CGI API always lanches a new process for each
request so you can't have a precompiled Perl CGI script.  

Anyhow even if you were to write the CGIs in a compiled language like
C (or C++, FORTRAN, Pascal whatever) then you'd still have the process
setup time to worry about.

> Say, I have a test.cgi. When a request for the test.cgi arrives, the
> cgi script gets interpreted and executed. Afterwards, it will get
> interpreted for the 2nd time when a 2nd request arrives.

If you want a way to cache the compiled p-code and have a single Perl
process service multiple HTTP transaction then there are alternative
APIs you can use instead of CGI.  For example Apache+mod_perl and
FastCGI and IIRC there's something ActiveState do for IIS too.

Some of these mechanisms (e.g. Apache+mod_perl when used with the
Apache::Registry and CGI modules) allow you to write dual-API Perl
scripts that can interface to the web server either using the CGI API
(usefull during the development phase or if you need maximum
portability) or the other faster one (during final testing and
production).

It is, however, important to remember that, although similar, the
Apache+mod_perl+Apache::Registry API (or whatever you choose) is not
totally the same as the CGI API and you must RTFM.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 3 Dec 2002 11:08:44 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: Closing an unsaved modded Excel spreadsheet?
Message-Id: <asi3d9$hnj$1@newshost.mot.com>


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3DEC3595.30400@rochester.rr.com...

> [untested]:
> Try setting the Saved property of your workbook to true (-1 in VBA),
>
> and then doing a close.  That makes Excel think the workbook was
> previously saved and is up-to-date.  Maybe something like [untested]:
>
> $book->{Saved}=-1;
> $excel->Close;

It's no longer untested. It doesn't work, though. ;-)

Thanks, Bob.

R.




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

Date: Tue, 3 Dec 2002 06:46:37 -0500
From: "Michele Ouellet" <ouellmi@videotron.ca>
Subject: Re: Closing an unsaved modded Excel spreadsheet?
Message-Id: <oO0H9.24106$QT3.279959@weber.videotron.net>


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3DEC3595.30400@rochester.rr.com...
> Richard S Beckett wrote:
>
> >
> > I have searched the web, and Google, and have found many "solutions" to
this
> > problem. Unfortunately none of them actually work!
> >
Actually, the best source of information for this kind of problem is the
"Programming Information" chapter in the Help system for Excel; in
particular, the API documentation for Open() and Close(). I think the
hardest part of using OLE is the object model and that is not really a Perl
question. ( I have had similar problems with Word... )

Good Luck,

Michele Ouellet.




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

Date: Tue, 3 Dec 2002 16:34:08 +0530
From: "Sameer" <iamsameer@hotmail.com>
Subject: how can i check if
Message-Id: <asi305$ri8vc$1@ID-160782.news.dfncis.de>

how can i check if  " sqrt $a " is integer ?




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

Date: Tue, 03 Dec 2002 12:06:49 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: how can i check if
Message-Id: <3DEC9049.DF7BE60A@fujitsu-siemens.com>

Sameer wrote:
> =

> how can i check if  " sqrt $a " is integer ?

How about

$sqrta=3Dsqrt($a);
if ($sqrta eq int($sqrta)) {
    print "Is integral\n";
else { {
    print "Is not integral\n";
}

TMTOWTDI,
-- =

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


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

Date: Tue, 3 Dec 2002 16:40:07 +0530
From: "Sameer" <iamsameer@hotmail.com>
Subject: Re: how can i check if
Message-Id: <asi3bb$r9sv9$1@ID-160782.news.dfncis.de>

Thank you

"Josef Möllers" <josef.moellers@fujitsu-siemens.com> wrote in message
news:3DEC9049.DF7BE60A@fujitsu-siemens.com...
Sameer wrote:
>
> how can i check if  " sqrt $a " is integer ?

How about

$sqrta=sqrt($a);
if ($sqrta eq int($sqrta)) {
    print "Is integral\n";
else { {
    print "Is not integral\n";
}

TMTOWTDI,
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T.  Pratchett




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

Date: Tue, 03 Dec 2002 12:08:12 +0100
From: Dominik Seelow <kurzhalsflasche@netscape.net>
Subject: Re: how can i check if
Message-Id: <asi3e1$q7str$2@fu-berlin.de>

Recently, Sameer told us:
> how can i check if  " sqrt $a " is integer ?
> 
> 
print 'sqrt $x is an integer' if (int(sqrt $x) eq (sqrt $x));


but there are lots of ways to do this...

HTH,
Dominik



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

Date: Tue, 3 Dec 2002 16:43:50 +0530
From: "Sameer" <iamsameer@hotmail.com>
Subject: Re: how can i check if
Message-Id: <asi3ia$rgvgp$1@ID-160782.news.dfncis.de>

What are the other ways ?

"Dominik Seelow" <kurzhalsflasche@netscape.net> wrote in message
news:asi3e1$q7str$2@fu-berlin.de...
> Recently, Sameer told us:
> > how can i check if  " sqrt $a " is integer ?
> >
> >
> print 'sqrt $x is an integer' if (int(sqrt $x) eq (sqrt $x));
>
>
> but there are lots of ways to do this...
>
> HTH,
> Dominik
>




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

Date: Tue, 03 Dec 2002 12:27:21 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: how can i check if
Message-Id: <3DEC9519.A74A5A47@fujitsu-siemens.com>

Sameer wrote:
> =

> What are the other ways ?
> =

> "Dominik Seelow" <kurzhalsflasche@netscape.net> wrote in message
> news:asi3e1$q7str$2@fu-berlin.de...
> > Recently, Sameer told us:
> > > how can i check if  " sqrt $a " is integer ?
> > >
> > >
> > print 'sqrt $x is an integer' if (int(sqrt $x) eq (sqrt $x));
> >
> >
> > but there are lots of ways to do this...

Well, you could post the result in a newsgroup and wait for replies ...

Good grief!
-- =

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


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

Date: Tue, 03 Dec 2002 11:46:15 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: how can i check if
Message-Id: <8v5puuc4aqi4lh2j35mglaendt7dq65uot@4ax.com>

Sameer wrote:

>how can i check if  " sqrt $a " is integer ?

I can imagine having round off errors in the squareroot function, so
that, for example, sqrt(169) is not exactly identical to 13. For
example. The larger the number, the more likely this becomes. (n.b. For
the tests I've tried, I've not seen this actually happen.)

So my thought would be to take the sqrt of the integer, take the nearest
integer, and square it again. If you get the same number as the
original, then your condition is met.

	$intsqrt = int(sqrt($a)+0.5);
	print "Yes" if $intsqrt*$intsqrt == $a;

-- 
	Bart.


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

Date: Tue, 03 Dec 2002 12:05:04 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Installing of Win32::API on Win2K
Message-Id: <3DEC8FE0.837D3487@fujitsu-siemens.com>

Hi,

Has anyone successfully installed Dada's Win32::API module on ASPerl
5.6.1 Build 633 on Win2K?
I've tried almost everything possible (even unpacking a tar.gz file
under Linux, then copy/paste the blib directory to G:\Perl\site\ and
moving it around a bit.)

I actually need it to use Win32::SerialPort;

TIA,
-- =

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


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

Date: Tue, 03 Dec 2002 11:21:29 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3dec9102.4176175522@news.cis.dfn.de>

On Tue, 03 Dec 2002 12:05:04 +0100, Josef
=?iso-8859-1?Q?M=F6llers?=
<josef.moellers@fujitsu-siemens.com> wrote:

>Has anyone successfully installed Dada's Win32::API module on 
>ASPerl 5.6.1 Build 633 on Win2K?

Of course.  It comes as standard with every installation
of Activeperl.  If you need to upgrade it (unlikely), you
need to run:
ppm verify --upgrade Win32-API

-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Tue, 03 Dec 2002 12:31:18 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3DEC9606.DF581F9B@fujitsu-siemens.com>

Helgi Briem wrote:
> =

> On Tue, 03 Dec 2002 12:05:04 +0100, Josef
> =3D?iso-8859-1?Q?M=3DF6llers?=3D
> <josef.moellers@fujitsu-siemens.com> wrote:
> =

> >Has anyone successfully installed Dada's Win32::API module on
> >ASPerl 5.6.1 Build 633 on Win2K?
> =

> Of course.  It comes as standard with every installation
> of Activeperl.  If you need to upgrade it (unlikely), you
> need to run:
> ppm verify --upgrade Win32-API

Why the does perl complain if I use Win32::SerialPort:

C:\Documents and Settings\Administrator>sp.pl
Can't locate Win32/API.pm in @INC (@INC contains: G:/Perl/lib
G:/Perl/site/lib .
) at G:/Perl/site/lib/Win32API/CommPort.pm line 5.
BEGIN failed--compilation aborted at
G:/Perl/site/lib/Win32API/CommPort.pm line
5.
Compilation failed in require at G:/Perl/site/lib/Win32/SerialPort.pm
line 4.
BEGIN failed--compilation aborted at
G:/Perl/site/lib/Win32/SerialPort.pm line 4
=2E
Compilation failed in require at C:\Documents and
Settings\Administrator\sp.pl l
ine 1.
BEGIN failed--compilation aborted at C:\Documents and
Settings\Administrator\sp.
pl line 1.

-- =

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


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

Date: Tue, 03 Dec 2002 11:48:54 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <ad6puu08rad9vgbl901qhd0ol0534j0bjj@4ax.com>

Josef Möllers wrote:

>Has anyone successfully installed Dada's Win32::API module on ASPerl
>5.6.1 Build 633 on Win2K?
>I've tried almost everything possible (even unpacking a tar.gz file
>under Linux, then copy/paste the blib directory to G:\Perl\site\ and
>moving it around a bit.)

This most definitely is an XS module, so you NEED the precompiled
binaries (with the DLL), for example from
<http://www.activestate.com/PPMpackages/>.

You'd better use the PPM utility to download and install the module for
you, if you have direct internet access on that computer. Otherwise, get
the ZIP file which includes the PPD and the .tar.gz file, and do a local
install.

-- 
	Bart.


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

Date: Tue, 03 Dec 2002 12:48:27 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3deca72f.4181853076@news.cis.dfn.de>

On Tue, 03 Dec 2002 12:31:18 +0100, Josef
=?iso-8859-1?Q?M=F6llers?=
<josef.moellers@fujitsu-siemens.com> wrote:

>> >Has anyone successfully installed Dada's Win32::API module on
>> >ASPerl 5.6.1 Build 633 on Win2K?

>> Of course.  It comes as standard with every installation
>> of Activeperl.  If you need to upgrade it (unlikely), you
>> need to run:
>> ppm verify --upgrade Win32-API
>
>Why the does perl complain if I use Win32::SerialPort:
>
>C:\Documents and Settings\Administrator>sp.pl
>Can't locate Win32/API.pm in @INC (@INC contains: G:/Perl/lib
>G:/Perl/site/lib .

One possibility is something I have come across before.

Did you have an older version of Activeperl installed
and failed to uninstall that before installing 633?

Neglecting to do so seems to lead to trouble with modules
not being found.  

If so, try uninstalling all versions you have on your 
machines, but *not* removing any directories by hand,
then reinstalling AP 633.  
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Tue, 03 Dec 2002 13:49:17 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3DECA84D.3B35DB3@fujitsu-siemens.com>

Bart Lateur wrote:
> =

> Josef M=F6llers wrote:
> =

> >Has anyone successfully installed Dada's Win32::API module on ASPerl
> >5.6.1 Build 633 on Win2K?
> >I've tried almost everything possible (even unpacking a tar.gz file
> >under Linux, then copy/paste the blib directory to G:\Perl\site\ and
> >moving it around a bit.)
> =

> This most definitely is an XS module, so you NEED the precompiled
> binaries (with the DLL), for example from
> <http://www.activestate.com/PPMpackages/>.
> =

> You'd better use the PPM utility to download and install the module for=

> you, if you have direct internet access on that computer. Otherwise, ge=
t
> the ZIP file which includes the PPD and the .tar.gz file, and do a loca=
l
> install.

Please have mercy B-{)
What _exactly_ do I have to type?

I tried
ppm install --location=3Dhttp://www.activestate.com/PPMpackages/5.6plus
Win32::API
and also
ppm install --location=3Dhttp://www.activestate.com/PPMpackages/5.6plus
Win32::API.ppm

but it sill complains about not being able to find the package for
Win32-API

-- =

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


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

Date: Tue, 03 Dec 2002 12:58:31 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3deca88b.4182201307@news.cis.dfn.de>

On Tue, 03 Dec 2002 13:49:17 +0100, Josef
=?iso-8859-1?Q?M=F6llers?=
<josef.moellers@fujitsu-siemens.com> wrote:
>You'd better use the PPM utility to download and install the module 

>Please have mercy B-{)
>What _exactly_ do I have to type?

ppm install Win32::API
or
ppm verify --upgrade Win32::API

>I tried
>ppm install --location=3Dhttp://www.activestate.com/PPMpackages/5.6plus
>Win32::API
>and also
>ppm install --location=3Dhttp://www.activestate.com/PPMpackages/5.6plus
>Win32::API.ppm


What's with the location stuff?  Why are you putting that 
in? 

>but it sill complains about not being able to find the package for
>Win32-API

Are you able to connect with PPM at all?  Have you 
configured your proxy properly?  See
perldoc PPM 
   "ENVIRONMENT VARIABLES"
for details.
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Tue, 03 Dec 2002 14:08:05 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3DECACB5.BC399AFB@fujitsu-siemens.com>

Helgi Briem wrote:

> What's with the location stuff?  Why are you putting that
> in?

It was mentioned on Aldo Calpini's (dada) site.

> >but it sill complains about not being able to find the package for
> >Win32-API
> =

> Are you able to connect with PPM at all?  Have you
> configured your proxy properly?  See
> perldoc PPM
>    "ENVIRONMENT VARIABLES"
> for details.

That was exactly what was missing.

Thanks,

Josef
-- =

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


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

Date: Tue, 03 Dec 2002 13:11:42 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Installing of Win32::API on Win2K
Message-Id: <3decacfa.4183336039@news.cis.dfn.de>

On Tue, 03 Dec 2002 14:08:05 +0100, Josef
=?iso-8859-1?Q?M=F6llers?=
<josef.moellers@fujitsu-siemens.com> wrote:

>> Are you able to connect with PPM at all?  Have you
>> configured your proxy properly?  See
>> perldoc PPM
>>    "ENVIRONMENT VARIABLES"
>> for details.
>
>That was exactly what was missing.

Well, missing the proxy setting is the reason for 99%
of the problems people have with PPM.

However, I repeat what I said earlier.  Win32::API
comes standard with Activeperl.  If your install does
not have it already, it is broken and needs to be
fixed.  Installing each missing module by hand is
the *wrong* way to go about it  (presumably they are all 
missing, since  your @INC array is much too short) 

-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Tue, 3 Dec 2002 10:46:55 -0000
From: "Rob" <robconvery@totalise.co.uk>
Subject: Kicking off commands on a remote machine
Message-Id: <asi25t$qtu5h$1@ID-68370.news.dfncis.de>

Currently I have a program which runs on a single machine. I now want this
perl app to kick off a command on a remote machine. Which module would I use
for doing this and does anyone have any pointer to any good online guides?
Below is a summary of what I am looking to do.

Have the main perl program running on machine 1.
I have a perl app waiting/listening on machine 2
The main program sends a smessage to machine 2 to run "some_command.exe"
app on machine 2 gets message and then runs command.

Cheers for any advice

Rob





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

Date: Tue, 03 Dec 2002 11:58:31 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: mysql
Message-Id: <to6puu8d77j2grjbruqdtf0afl6npesafb@4ax.com>

^darkage wrote:

>> $mysql->query(qq!
>>    INSERT INTO logs (field1, field2, field3, field4, field5, field6) VALUES
>>    (@fields)
>> !);

>Is this a reliable method?

Most definitely not. It'll work for numbers, but not for random strings.
You could try putting single quotes around your individual field data in
the string above, but that will still fail if the data contains a single
quote or a backslash.

Use DBI+DBD::mysql, and use placeholders (the question marks, think of
them as anonymous variables). The added bonus is that it will be faster
for lots of data, because the SQL statement only needs to be compiled
("prepared") once, after which you can execute() it many times with
different data.

The homepage for DBI is <http://dbi.perl.org>.

-- 
	Bart.


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

Date: Tue, 03 Dec 2002 12:00:27 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: mysql
Message-Id: <257puu8a9j5as8ngm9pn2cst9b7iai7hk9@4ax.com>

^darkage wrote:

>I seem to be missing 1500 records from a 5600 record insert. using the
>$mysql->query(qq!
>   INSERT INTO logs (field1, field2, field3, field4, field5, field6) VALUES
>($fields[0],$fields[1],$fields[2],$fields[3],$fields[4],$fields[5])!);
>method.
>
>hmm in small amounts 50 or so records its ok.

Most likely it's the data that doesn't fit your model. This method can
only work if the data is all numbers, and nothing else.

-- 
	Bart.


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

Date: Tue, 3 Dec 2002 23:33:54 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: perl on RedHat8
Message-Id: <slrnaup95i.1rk.mgjv@martien.heliotrope.home>

On Mon, 02 Dec 2002 05:43:29 GMT,
	Gadrael <news@none.com> wrote:
> Whenever I write a simple print script on my newly installed RH8 box the 
> text will not print to the screen unless I add in a \n character. This 
> never happened under older distributions of RH. Does anyone know why this 

This has nothing to do with Perl. It has to do with your environment,
most likely a change in the version of your shell.

If you want all output to appear, always end the last line of output
with a newline. You will not have any guarantee otherwise that it will
actually show up on your screen.

Martien
-- 
                        | 
Martien Verbruggen      | Little girls, like butterflies, need no
                        | excuse - Lazarus Long
                        | 


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

Date: 03 Dec 2002 08:51:41 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: reference to a tied hash
Message-Id: <u9k7ire8qf.fsf@wcl-l.bham.ac.uk>

"Lois" <lois@hotmail.com> writes:

>     Is $r a reference to a tied hash?
> 
> my $r = \tie %event, "DB_File", "events.db", O_CREAT | O_RDWR or die "$!\n";

No.  See "perldoc -f tie" for a description of the return value of the
tie() function.

> and when this is passed to a sub, how can %event be used.

There is no way to infer \%event from the value in $r.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 3 Dec 2002 13:42:17 +0000 (UTC)
From: mauzo@ux-ma160-15.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: sys/wait.ph problem
Message-Id: <asicbp$le2$1@wisteria.csv.warwick.ac.uk>

dturley@pobox.com (David Turley) wrote:
>I'm trying to run a script that requires sys/wait.ph:

I would strongly suggest
use POSIX qw/:sys_wait_h/;
instead. It will probably work, and is rather more likely to get the constants
right. .ph files are a Perl4 thing: Perl5 programs should generally look for a
 .pm to do the same job.

HTH
Ben


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

Date: 03 Dec 2002 08:40:45 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Timezone
Message-Id: <slrnauorgd.7c3.vek@station02.ohout.pharmapartners.nl>

On Mon, 02 Dec 2002 18:39:38 GMT,
    Darren Dunham <ddunham@redwood.taos.com> wrote:


>BrianWhitehead <bgwhite@uofu.net> wrote:

>[...]
>
>> From the command line it does work on linux, for example:
>> perl -e '$ENV{TZ}="GMT+8"; print scalar localtime, "\n"'
>> perl -e '$ENV{TZ}="GMT+9"; print scalar localtime, "\n"'
>
>Verrry interesting.  That would seem to rule out problems with the
>actual time libraries.  
>
>> Does anyone have any help?
>
>What version of perl is on the Linux box?
>


It may also be a question of when the time library is looking at the
TZ variable.  If in does only the first time it is used then changing
TZ won't make a difference.  Try look at POSIX::tzset.


Villy


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

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


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