[16867] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4279 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 10 18:10:27 2000

Date: Sun, 10 Sep 2000 15:10:14 -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: <968623814-v9-i4279@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 10 Sep 2000     Volume: 9 Number: 4279

Today's topics:
    Re: HTML::Template (Keith Calvert Ivey)
    Re: HTML::Template (brian d foy)
    Re: Msql-Mysql-modules-1.2215 install error <robert_pearse@hotmail.com>
        Perl Location Variable? <preble@ipass.net>
    Re: Perl Location Variable? <jeffp@crusoe.net>
    Re: pppperll.. <tina@streetmail.com>
        problem calling 'system' command onarasim@my-deja.com
    Re: problem calling 'system' command <tony_curtis32@yahoo.com>
    Re: problem calling 'system' command <gnat@frii.com>
    Re: Regular Expressions <markmccarthy1@home.com>
        using Module::Function question <randy_734@my-deja.com>
    Re: using Module::Function question <tina@streetmail.com>
    Re: VBA conversion to Perl (Tim Hammerquist)
        Where to download binary DBI and DBD::mysql for win32 (Ian Vincent)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 10 Sep 2000 18:39:41 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: HTML::Template
Message-Id: <39bbd4db.839372@news.newsguy.com>

brian@smithrenaud.com (brian d foy) wrote:

>BEGIN { @YEARS  = 2000 .. 2010;

Or even

    BEGIN { my $y = (localtime)[5] + 1900;
            @YEARS = $y .. $y + 10;

so that it doesn't have to be edited every year.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Sun, 10 Sep 2000 16:56:44 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: HTML::Template
Message-Id: <brian-ya02408000R1009001656440001@news.panix.com>

In article <39bbd4db.839372@news.newsguy.com>, kcivey@cpcug.org (Keith Calvert Ivey) posted:

> brian@smithrenaud.com (brian d foy) wrote:

> >BEGIN { @YEARS  = 2000 .. 2010;

>     BEGIN { my $y = (localtime)[5] + 1900;
>             @YEARS = $y .. $y + 10;
> 
> so that it doesn't have to be edited every year.

ah - yes.  much better than what i typed :)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Sun, 10 Sep 2000 18:09:18 GMT
From: "Robert Eric Pearse" <robert_pearse@hotmail.com>
Subject: Re: Msql-Mysql-modules-1.2215 install error
Message-Id: <i7Qu5.35904$C5.719943@typhoon.austin.rr.com>

btw,

apt-get install zlib1g-dev
ldconfig

did not fix the problem.

tia,

robert

"Robert Eric Pearse" <robert_pearse@hotmail.com> wrote in message
news:LuPu5.35901$C5.719180@typhoon.austin.rr.com...
> hi,
>
> i'm having some ld errors when i run 'make install'. the output is below.
>
> i believe this is the offending line:
>
> LD_RUN_PATH="/usr/lib:/usr/lib/gcc-lib/i386-linux/2.95.2" /usr/bin/gcc -o
> ../blib/arch/auto/DBD/mysql/mysql.so  -shared -L/usr/local/lib dbdimp.o
>
mysql.o -L/usr/lib    -L/usr/lib -lmysqlclient -lm -lz -L/usr/lib/gcc-lib/i3
> 86-linux/2.95.2 -lgcc
> /usr/bin/ld: cannot find -lz
>
> my apologies if this is a silly question. i'll be you dollars for
doughnuts
> that this is a misconfiguration on my part. but, i would certainly
> appreciate any help.
>
> cheeers,
>
> pearse
>
> debian:~/.cpan/build/Msql-Mysql-modules-1.2215# make
> mkdir blib
> mkdir blib/lib
> mkdir blib/arch
> mkdir blib/arch/auto
> mkdir blib/arch/auto/Msql-Mysql-modules
> mkdir blib/lib/auto
> mkdir blib/lib/auto/Msql-Mysql-modules
> mkdir blib/man1
> make[1]: Entering directory
> `/root/.cpan/build/Msql-Mysql-modules-1.2215/mysql'
> mkdir ../blib/lib/DBD
> mkdir ../blib/arch/auto/DBD
> mkdir ../blib/arch/auto/DBD/mysql
> mkdir ../blib/lib/auto/DBD
> mkdir ../blib/lib/auto/DBD/mysql
> mkdir ../blib/man3
> cp lib/DBD/mysql.pm ../blib/lib/DBD/mysql.pm
> cp lib/Bundle/DBD/mysql.pm ../blib/lib/Bundle/DBD/mysql.pm
> cp lib/Mysql/Statement.pm ../blib/lib/Mysql/Statement.pm
> cp lib/Mysql.pm ../blib/lib/Mysql.pm
>
/usr/bin/gcc -c -I/usr/local/lib/perl5/site_perl/5.6.0/i686-linux-thread-mul
>
ti/auto/DBI -I/usr/include/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5
>
 .6.0/i686-linux-thread-multi/auto/DBI -I/usr/local/lib/perl5/5.6.0/i686-linu
>
x-thread-multi -D_REENTRANT -fno-strict-aliasing -I/usr/local/include -D_LAR
>
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2     -DVERSION=\"2.0415\" -DXS_VERSI
>
ON=\"2.0415\" -fpic -I/usr/local/lib/perl5/5.6.0/i686-linux-thread-multi/COR
> E -DDBD_MYSQL dbdimp.c
> /usr/local/bin/perl -p -e "s/~DRIVER~/mysql/g" <
>
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux-thread-multi/auto/DBI/Driver
> .xst > mysql.xsi
>
/usr/local/bin/perl -I/usr/local/lib/perl5/5.6.0/i686-linux-thread-multi -I/
> usr/local/lib/perl5/5.6.0
> usr/local/lib/perl5/5.6.0/ExtUtils/xsubpp  -typemap
> /usr/local/lib/perl5/5.6.0/ExtUtils/typemap mysql.xs > mysql.xsc && mv
> mysql.xsc mysql.c
>
/usr/bin/gcc -c -I/usr/local/lib/perl5/site_perl/5.6.0/i686-linux-thread-mul
>
ti/auto/DBI -I/usr/include/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5
>
 .6.0/i686-linux-thread-multi/auto/DBI -I/usr/local/lib/perl5/5.6.0/i686-linu
>
x-thread-multi -D_REENTRANT -fno-strict-aliasing -I/usr/local/include -D_LAR
>
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2     -DVERSION=\"2.0415\" -DXS_VERSI
>
ON=\"2.0415\" -fpic -I/usr/local/lib/perl5/5.6.0/i686-linux-thread-multi/COR
> E -DDBD_MYSQL mysql.c
> Running Mkbootstrap for DBD::mysql ()
> chmod 644 mysql.bs
> LD_RUN_PATH="/usr/lib:/usr/lib/gcc-lib/i386-linux/2.95.2" /usr/bin/gcc -o
> ../blib/arch/auto/DBD/mysql/mysql.so  -shared -L/usr/local/lib dbdimp.o
>
mysql.o -L/usr/lib    -L/usr/lib -lmysqlclient -lm -lz -L/usr/lib/gcc-lib/i3
> 86-linux/2.95.2 -lgcc
> /usr/bin/ld: cannot find -lz
> collect2: ld returned 1 exit status
> make[1]: *** [../blib/arch/auto/DBD/mysql/mysql.so] Error 1
> make[1]: Leaving directory
> `/root/.cpan/build/Msql-Mysql-modules-1.2215/mysql'
> make: *** [subdirs] Error 2
>
>




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

Date: Sun, 10 Sep 2000 14:24:40 -0400
From: "E. Preble" <preble@ipass.net>
Subject: Perl Location Variable?
Message-Id: <3lQu5.797$dg2.4763@saturn.ipass.net>

As we all know, one must place the location of perl at the
start of all executables... like so:

#!/usr/local/bin/perl

My question is, can the executable "figure out" what it is
using so that it can create other executable files for
users?  I'm writing a script that "auto-installs" everything
that it needs so that the end-user only has to configure a
couple of variables, but I can't figure out how to get at
this information.

Thanks ahead.

E Preble




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

Date: Sun, 10 Sep 2000 14:48:31 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Perl Location Variable?
Message-Id: <Pine.GSO.4.21.0009101448150.12441-100000@crusoe.crusoe.net>

[posted & mailed]

On Sep 10, E. Preble said:

>My question is, can the executable "figure out" what it is
>using so that it can create other executable files for
>users?  I'm writing a script that "auto-installs" everything
>that it needs so that the end-user only has to configure a
>couple of variables, but I can't figure out how to get at
>this information.

$^X

perldoc perlvar

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: 10 Sep 2000 19:17:49 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: pppperll..
Message-Id: <8pgmos$csnku$6@ID-24002.news.cis.dfn.de>

hi,
In comp.lang.perl.misc Mark Livingstone <cccurious@ottawa.com> wrote:

> i am executing a perl script using SSI (<!--#exec
> cgi="/cgi-bin/mcount.cgi" -->).

> if i specify "mcount.cgi 1212", how do i make perl read that "1212" syntax
> and based upon it, print "command 1".. if "2323" given, then print "2323"?

the #exec might not work with a query string such as
script?param=42

it might work with path_info:
script/42/other/stuff

if you want to use the query string you should
use include virtual (not sure if it works on every server)

but this has nothing to do with perl.
ask in the appropriate newsgroup.

tina


-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Sun, 10 Sep 2000 20:31:25 GMT
From: onarasim@my-deja.com
Subject: problem calling 'system' command
Message-Id: <8pgr2u$7c3$1@nnrp1.deja.com>

Hi,
  I wrote a perl program in unix, and am now trying to fix it for use on
WindowsNT. The following lines, which worked fine on unix, give me an
error message in windows.

my @args = ("rm", "$page1");
  system(@args) == 0
  or die "system @args failed: $?";

i changed the 'rm' to 'del', but that doesn't seem to help. the error i
get is:
  "can't spawn rm: no such file or directory at ..."

i have run this on unix, and it runs fine. also, clearly the file
referred to above exists, and is of positive size, so the rm or del
command should work.

since i use the above piece of code fairly often to eliminate duplicate
files, any solution would be very useful.

thanks a lot.

om


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 10 Sep 2000 15:54:02 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: problem calling 'system' command
Message-Id: <87its4ge8l.fsf@limey.hpcc.uh.edu>

>> On Sun, 10 Sep 2000 20:31:25 GMT,
>> onarasim@my-deja.com said:

> Hi, I wrote a perl program in unix, and am now trying to
> fix it for use on WindowsNT. The following lines, which
> worked fine on unix, give me an error message in
> windows.

> my @args = ("rm", "$page1"); system(@args) == 0 or die

unnecessary quotes around $page1

> "system @args failed: $?";

> i have run this on unix, and it runs fine. also, clearly
> the file referred to above exists, and is of positive
> size, so the rm or del command should work.

rm also deletes empty files you know :-)

> since i use the above piece of code fairly often to
> eliminate duplicate files, any solution would be very
> useful.

Why go into a shell and lose portability?

    perldoc -f unlink

hth
t
-- 
WWNKD?


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

Date: Sun, 10 Sep 2000 21:39:52 GMT
From: Nathan Torkington <gnat@frii.com>
Subject: Re: problem calling 'system' command
Message-Id: <IcTu5.74$W3.170567680@news.frii.net>

onarasim@my-deja.com wrote:
: my @args = ("rm", "$page1");
:   system(@args) == 0
:   or die "system @args failed: $?";

: i changed the 'rm' to 'del', but that doesn't seem to help. the error i
: get is:
:   "can't spawn rm: no such file or directory at ..."

The problem is that there's no "del" command on Windows.  It's a
pseudo-command implemented by the shell.  The best solution is to use
the unlink() function built into Perl:

  unlink $page1
	or die "couldn't remove $page1 : $!";

This works on every platform that has files.

Nat


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

Date: Sun, 10 Sep 2000 19:29:23 GMT
From: "Mark McCarthy" <markmccarthy1@home.com>
Subject: Re: Regular Expressions
Message-Id: <niRu5.69035$xg1.646757@news1.rdc1.sdca.home.com>


"Abigail" <abigail@foad.org> wrote in message
news:slrn8rj2cf.b1k.abigail@alexandra.foad.org...
> Dietmar Staab (dietmar.staab@t-online.de) wrote on MMDLXVI September
> MCMXCIII in <URL:news:8pbv2v$4c7$17$1@news.t-online.com>:
> () In article <MPG.142307bef60e9aa298ad4b@nntp.hpl.hp.com>, Larry Rosler
> () <lr@hpl.hp.com> wrote:
> ()
> () >     /([<"'])(.*?)\1/ and print $2;
> ()
> () Doesn't work, because left and right delimiter are not equal for <>
> ()
> () /(["'<])(.*?)[\1>]/ and print $2;
> ()
> () should fix it.
>
>
> Not really.


In which case, could we instead of the

[\1>]

do

\1|>$         (can get rid of the non-greediness then too)

Also, if we are allowing <> possibilities, do not we also need to worry
about [],{},() too.

Mark





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

Date: Sun, 10 Sep 2000 18:26:01 GMT
From: Randy <randy_734@my-deja.com>
Subject: using Module::Function question
Message-Id: <39bbd0d5.10537125@207.126.101.100>

I'm a perl rookie in need of an explanation.

I tried:

use Win32::Service ;
GetServices("", \%sl);

and get the error:
Undefined subroutine &main::GetServices called

If I use:
use Win32::Service ;
Win32::Service::GetServices("", \%sl);
it works.

I read through perlmod and it seems to say that if I use "use" (as
opposed to require) the function names should be known in the program.
What am I missing?

TIA


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

Date: 10 Sep 2000 20:08:28 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: using Module::Function question
Message-Id: <8pgpnr$csnku$7@ID-24002.news.cis.dfn.de>

hi,
In comp.lang.perl.misc Randy <randy_734@my-deja.com> wrote:

> I tried:

> use Win32::Service ;
> GetServices("", \%sl);

> and get the error:
> Undefined subroutine &main::GetServices called

> If I use:
> use Win32::Service ;
> Win32::Service::GetServices("", \%sl);
> it works.

> I read through perlmod and it seems to say that if I use "use" (as
> opposed to require) the function names should be known in the program.
> What am I missing?

the functions in Win32::Service are not autmatically
imported, so you have to say
use Win32::Service qw(GetServices);

read more about this in
perldoc perlmod (search for @EXPORT_OK).

HTH,
tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Sun, 10 Sep 2000 20:02:18 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: VBA conversion to Perl
Message-Id: <slrn8rnqtt.k2.tim@degree.ath.cx>

Dwight T. Oakey <DTOakey@cinci.rr.com> wrote:
> Also, if using ActiveState (port of) Perl, you can actually use
> "PerlScript".
> This means that the Windows Script Host becomes the Perl interpreter.  This
> also means that you can mix Perl and VB code in the same script.
> 
> While I'm no expert, I have experimented with this, a little, in ASP pages.
> If I'm not mistaken (please, anyone who knows better, feel free to correct
> me!) in your example, you'd have to *convert* all the VBA code into perl.

As far as mixing languages in Microsoft's various scripting hosts
(namely ASP and WSH), VBScript and JScript mix better than than any two
other languages, though their array objects are incompatible.  (There
are ways around this, but this is a Perl ng.)

When mixing PerlScript and any other language, there are just more
compatibility problems.  When passing/accessing variables between the
languages, non-reference type scalars are best.  Calling
procedures/function/subs in another language (mostly from PerlScript)
is unnecessarily complicated (at least in the ASP environment).

The ASP engine (not sure about WSH) keeps separate namespaces for
each language.  This is dealt with transparently between VBScript and
JScript, but PerlScript has to (AFAIK) access the other namespace
explicitly to access variables from another namespace.

Should it be this complicated?  Maybe it has to be to mix VBScript and
PerlScript.  Should VBScript exist?  Well, I switched to
linux/Apache/mod_perl/Apache::ASP for some consistency and
predictability and....Oh YEAH! STABILITY!  ;)

Sorry Bill.  You came; you saw; you lost.  Deal.

</Rant>

-- 
-Tim Hammerquist <timmy@cpan.org>
The probability of finding me in this office is inversely
proportional to the magnitude of your urgency.
	-- (on a lecturer's door)


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

Date: Sun, 10 Sep 2000 22:04:16 GMT
From: vincent@mail.igrin.co.nz (Ian Vincent)
Subject: Where to download binary DBI and DBD::mysql for win32
Message-Id: <39bc047c.12071722@news.igrin.co.nz>

I guess the title says it all... im looking (in vain) for a site where
I can obtain a binary for win32 for Perl DBI and DBD::mysql driver. 

I currently have ActivePerl installed on Win98 and mySQL, all working,
but the connectivity layer  is illuding me at this point.

Any help would be much appreciated

Ian 


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4279
**************************************


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