[22863] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5084 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 6 14:05:56 2003

Date: Fri, 6 Jun 2003 11:05:06 -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           Fri, 6 Jun 2003     Volume: 10 Number: 5084

Today's topics:
        [Crypt::SSLeay] Win32 Compile Problems (john)
    Re: and if I killed this programmer *I'd* go to jail.. <gfg-usenet@stuebegreen.com>
        DBD:mysql make test problem <a.bruns@sauerland.de>
    Re: How? Multiple perl scripts on two different hosts n (bd)
        Loading perl modules / Caching when it shouldn't - HELP (David Gavini)
        parsing multiple data member declarations in C++ with P (largo)
    Re: perl and surveys (Steve)
        Perl and Win32 OLE Excel scripting problem/question...  (Jeff Leary)
    Re: perl (Tad McClellan)
        Regular expressions Question  HELP (Dan MacLeod)
    Re: Regular expressions Question  HELP <laocoon@fastmail.fm>
    Re: Regular expressions Question  HELP <nobull@mail.com>
    Re: Temporary "holding"/"Working" page - ideas? <glex_nospam@qwest.net>
        Unusual Can't load fail (web only) (Mike Bobbitt)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 6 Jun 2003 10:23:20 -0700
From: raptnor@msn.com (john)
Subject: [Crypt::SSLeay] Win32 Compile Problems
Message-Id: <a3db0d59.0306060923.594d4456@posting.google.com>

Hello all,

I'm trying to compile Crypt::SSLeay and have run into compile problems
using VC++, Perl 5.8.0, the latest stable from OpenSSL (compiled,
installed, and tested), and the latest copy of Crypt::SSLeay.

I have noticed that this problem has been posted before, but there was
no visible resolution to it.  Has anyone here encountered this before
and found a solution?  Using ActiveState's distribution is not an
option.

Thanks in advance,

John Fraser
(raptnor at mac dot com)
        
Capture from the Command Window:


cl -c  -Ic:\openssl\include -Ic:\openssl\inc32  -nologo -Gf -W3 -MD
-DND
EBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_
SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -DNDEBUG -O1   
-DVERSION=\"0.49\"  -
DXS_VERSION=\"0.49\"  "-IC:\perl\lib\CORE"   SSLeay.c
SSLeay.c
SSLeay.xs(53) : error C2064: term does not evaluate to a function
SSLeay.xs(53) : warning C4133: 'function' : incompatible types - from
'char [7]'
 to 'FILE *'
SSLeay.xs(57) : error C2064: term does not evaluate to a function
SSLeay.xs(57) : warning C4133: 'function' : incompatible types - from
'char [21]
' to 'FILE *'
SSLeay.xs(64) : error C2064: term does not evaluate to a function
SSLeay.xs(64) : warning C4133: 'function' : incompatible types - from
'char [17]
' to 'FILE *'
SSLeay.xs(66) : error C2064: term does not evaluate to a function
SSLeay.xs(66) : warning C4133: 'function' : incompatible types - from
'char [16]
' to 'FILE *'
SSLeay.xs(172) : warning C4047: '=' : 'FILE *' differs in levels of
indirection
from 'PerlIO * '
SSLeay.xs(174) : warning C4047: 'function' : 'PerlIO * ' differs in
levels of in
direction from 'FILE *'
SSLeay.xs(247) : warning C4090: 'function' : different 'const'
qualifiers
SSLeay.xs(247) : warning C4028: formal parameter 1 different from
declaration
SSLeay.xs(294) : warning C4018: '>' : signed/unsigned mismatch
SSLeay.xs(297) : warning C4018: '>=' : signed/unsigned mismatch
SSLeay.xs(300) : warning C4018: '>' : signed/unsigned mismatch
SSLeay.xs(331) : warning C4018: '>' : signed/unsigned mismatch
SSLeay.xs(339) : warning C4018: '>' : signed/unsigned mismatch
SSLeay.xs(347) : warning C4018: '<' : signed/unsigned mismatch
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.


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

Date: Fri, 06 Jun 2003 12:09:35 -0400
From: "Geoffrey F. Green" <gfg-usenet@stuebegreen.com>
Subject: Re: and if I killed this programmer *I'd* go to jail..
Message-Id: <gfg-usenet-D10267.12093506062003@reader1.news.rcn.net>

In article <776e0325.0306050958.319bfc19@posting.google.com>,
 genericax@hotmail.com (Sara) wrote:

> This is one of the less ugly examples what I've inherited from my
> "ancestral" programmers here.

Don't tease us.  Show us the really awful code!

 - geoff

-- 
Visit http://PostingUp.net
All college basketball, no Andy Katz


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

Date: Fri, 6 Jun 2003 17:22:13 +0200
From: "Alexander Bruns" <a.bruns@sauerland.de>
Subject: DBD:mysql make test problem
Message-Id: <1054912779.608074@emil.nef>

Hi,

i installed my mysql under /usr/local/mysql/current

libs are in /usr/local/mysql/current/lib/mysql
headers in /usr/local/mysql/current/lib/include

i compiled DBD:mysql with:

perl Makefile.PL \
--libs=-L/usr/local/mysql/current/lib/mysql/ \
-lmysqlclient -lz \
--cflags=-I/usr/local/mysql/current/include/mysql/ \
--testdb=test \
--testuser=test \
--testpassword=test \
--testhost=localhost


which prints out:
I will use the following settings for compiling and testing:

  cflags        (Users choice)
= -I/usr/local/mysql/current/include/mysql/
  libs          (Users choice) = -L/usr/local/mysql/current/lib/mysql/
  nocatchstderr (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (Users choice) = test
  testhost      (Users choice) = localhost
  testpassword  (Users choice) = test
  testuser      (Users choice) = test

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Using DBI 1.37 installed in
/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI
Writing Makefile for DBD::mysql

a make test gives these errors:


[root@holodeck DBD-mysql-2.1027]# make test
/bin/sh -c true
/bin/sh -c true
gcc -c -I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI -I/usr/loc
al/mysql/current/include/mysql/ -fno-strict-aliasing -I/usr/local/incl
ude -O2 -march=i386 -mcpu=i686   -DVERSION=\"2.1027\" -DXS_VERSION=\"2
 .1027\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE  mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="" /usr/bin/perl myld gcc  -shared -L/usr/local/lib
dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
PERL_DL_NONLAZY=1
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.1/i386-linux
 -I/usr/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $verbose);
$verbose=0; runtests @ARGV;' t/*.t
t/00base............install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/00base.t line 38
t/00base............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
        Failed 2/5 tests, 60.00% okay
t/10dsnlist.........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/10dsnlist.t line 45
t/10dsnlist.........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-3
        Failed 3/3 tests, 0.00% okay
t/20createdrop......install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/20createdrop.t line 45
t/20createdrop......dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-5
        Failed 5/5 tests, 0.00% okay
t/30insertfetch.....install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/30insertfetch.t line 48
t/30insertfetch.....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40bindparam.......install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/40bindparam.t line 64
t/40bindparam.......dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-28
        Failed 28/28 tests, 0.00% okay
t/40blobs...........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/40blobs.t line 68
t/40blobs...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40listfields......install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/40listfields.t line 57
t/40listfields......dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-16
        Failed 16/16 tests, 0.00% okay
t/40nulls...........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/40nulls.t line 50
t/40nulls...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40numrows.........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/40numrows.t line 59
t/40numrows.........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-25
        Failed 25/25 tests, 0.00% okay
t/50chopblanks......install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/50chopblanks.t line 57
t/50chopblanks......dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-35
        Failed 35/35 tests, 0.00% okay
t/50commit..........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/50commit.t line 64
t/50commit..........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-30
        Failed 30/30 tests, 0.00% okay
t/60leaks...........skipped test on this platform
t/ak-dbd............install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/ak-dbd.t line 59
t/ak-dbd............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-90
        Failed 90/90 tests, 0.00% okay
t/akmisc............Had to create DBD::mysql::dr::imp_data_size
unexpectedly at /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line
1020.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line 1020.
Can't locate object method "connect" via package "Mysql" (perhaps you
forgot to load "Mysql"?) at blib/lib/Mysql.pm line 71.
t/akmisc............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-351
        Failed 351/351 tests, 0.00% okay
t/dbdadmin..........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/dbdadmin.t line 74
t/dbdadmin..........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-21
        Failed 21/21 tests, 0.00% okay
t/insertid..........install_driver(mysql) failed: Can't load
'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at t/insertid.t line 13
t/insertid..........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
        Failed 12/12 tests, 0.00% okay
t/mysql2............Had to create DBD::mysql::dr::imp_data_size
unexpectedly at /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line
1020.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line 1020.
Can't locate object method "connect" via package "Mysql" (perhaps you
forgot to load "Mysql"?) at blib/lib/Mysql.pm line 71.
t/mysql2............dubious
        Test returned status 255 (wstat 65280, 0xff00)
t/mysql.............Can't load 'blib/arch/auto/DBD/mysql/mysql.so' for
module DBD::mysql: blib/arch/auto/DBD/mysql/mysql.so: undefined
symbol: mysql_real_escape_string at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206.
 at blib/lib/Mysql.pm line 13
Compilation failed in require at blib/lib/Mysql.pm line 13.
Compilation failed in require at t/mysql.t line 34.
BEGIN failed--compilation aborted at t/mysql.t line 34.
t/mysql.............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-68
        Failed 68/68 tests, 0.00% okay
Failed Test       Status Wstat Total Fail  Failed  List of Failed
----------------------------------------------------------------------
----------
t/00base.t               255 65280     5    2  40.00%  4-5
t/10dsnlist.t            255 65280     3    3 100.00%  1-3
t/20createdrop.t         255 65280     5    5 100.00%  1-5
t/30insertfetch.t        255 65280    11   11 100.00%  1-11
t/40bindparam.t          255 65280    28   28 100.00%  1-28
t/40blobs.t              255 65280    11   11 100.00%  1-11
t/40listfields.t         255 65280    16   16 100.00%  1-16
t/40nulls.t              255 65280    11   11 100.00%  1-11
t/40numrows.t            255 65280    25   25 100.00%  1-25
t/50chopblanks.t         255 65280    35   35 100.00%  1-35
t/50commit.t             255 65280    30   30 100.00%  1-30
t/ak-dbd.t               255 65280    90   90 100.00%  1-90
t/akmisc.t               255 65280   351  351 100.00%  1-351
t/dbdadmin.t             255 65280    21   21 100.00%  1-21
t/insertid.t             255 65280    12   12 100.00%  1-12
t/mysql.t                255 65280    68   68 100.00%  1-68
t/mysql2.t               255 65280    ??   ??       %  ??
1 test skipped.
Failed 17/18 test scripts, 5.56% okay. 719/722 subtests failed, 0.42%
okay.
make: *** [test_dynamic] Fehler 2
[root@holodeck DBD-mysql-2.1027]#


whats wrong?
make works fine

-- 
Freundliche Grüsse

Alexander Bruns





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

Date: 6 Jun 2003 09:51:19 -0700
From: bdonlan@bd-home-comp.no-ip.org (bd)
Subject: Re: How? Multiple perl scripts on two different hosts need Mutex to lock critical code section.
Message-Id: <a8bd895.0306060851.2b762054@posting.google.com>

Klaus FOERSTER <r26375@motorola.com> wrote in message news:<3EDF3D64.7060500@motorola.com>...
> Hi everybody.
> 
> I'm not very good with interprocess communication therefore my question
> 
> I'm having multiple perl scripts running on different hosts
> and operating systems (solaris, linux).
> 
> What mechanism can be used to make sure, that only one of the perl scripts enters a
> critical code section (locking)?
> 
> 
> I tried to use the flock mechanism to lock files and use them by this means as mutex.
> However this seems only to work reliable if all processes do run on the same host.
> When running on multiple hosts this does not seem to be reliable.
> 
> Is there anything generic enough, that could be used to achieve this?
> 
> One option would be to have a lock server, that listens on a socket and hands mutexes over
> to any of the active perl scripts.
> This seems to be a little overkill for me (having a lock server), but that's the only idea,
> that I have so far.
> 
> any feedback welcome

Haven't tried this, but how about:
use POSIX;

my $fd = POSIX::open("/path/to/lock/file", O_CREAT | O_EXCL | O_WRONLY, 0600);
if($fd < 0){
 /* We don't have the lock. Sleep and retry, or something. */
}
close $fd;
/* Do stuff */
unlink "/path/to/lock/file";


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

Date: 6 Jun 2003 09:52:04 -0700
From: david.gavini@digitallook.com (David Gavini)
Subject: Loading perl modules / Caching when it shouldn't - HELP!
Message-Id: <8dbc4bcc.0306060852.1ef38bbe@posting.google.com>

Hi,

I'm having a strange problem with perl being served through apache.

Below is an example of how to reproduce this problem.

The problem is that we cannot dynamically export between 2 modules if
our import logic resides in a 3rd module held in modperl.
This causes the code to appear to be cached, resulting in our scripts
acting in an unexpected manner.


[ Introduction to problem replication]

I have a problem where a script is being read into apache using
mod_perl that requires
another script depending on the type parameter being passed in through
the URL. What I
need is a solution where the code is executed correctly every time a
different type is passed in.

[ How to reproduce the problem ]

The source code for these examples can be found at the bottom of this
email.

I have created the following scripts to reproduce the problem (created
in
the cgi-bin directory).
Digital/test.cgi
Digital/Test.pm
A/Test.pm
B/Test.pm

I have also configured apache in the following way so that you can see
that 1 child will read in the modules:
KeepAliveTimeout 15
MinSpareServers 1
MaxSpareServers 1
StartServers 1
MaxClients 1

This is how the script works. I execute Digital/test.cgi through the
browser
like http://www......com/digital/test.cgi?A or
http://www......com/digital/test.cgi?B this calls Digital/Test.pm for
the
function printletter().

Digital/Test.pm imports the function from another module located in
either
A/Test.pm or B/Test.pm depending on what parameter you pass in through
the
URL.


Output first time should for /digital/test.cgi?A is correct

Starting...looking for: A
FOUND A

Then trying B like /digital/test.cgi?B
Should give Found B as the code states, but gives the following
because the
entire module has been read into apache:

Starting...looking for: B
FOUND A


[ Current environment ]
red hat linux
perl v5.6.1
apache 1.3.22
mod_perl 1.27


Any help would be of huge help!!!

Thanks in advance,

Hetal.


[ Code for the scripts to replicate the problem ]

##########################################################################
# SCRIPT 1 - saved as /Digital/test.cgi

#!/usr/local/bin/perl -w

use strict;
use lib qw( /usr/local/etc/httpd/cgi-bin/ );

use Digital::Test;

print "Content-type:text/html\n\n";

print "<p>Starting...looking for: $ENV{'QUERY_STRING'}<br>";

printletter();
##########################################################################


##########################################################################
# SCRIPT 2 - saved as /Digital/Test.pm

#!/usr/local/bin/perl -w

package Digital::Test;
use Exporter;
@ISA = ('Exporter');
@EXPORT = qw(&printletter);

use strict;

use lib qw( /usr/local/etc/httpd/cgi-bin/ );

use Shared::UsefulStuff;

my $type = $ENV{'QUERY_STRING'};

if ($type eq "A")
{
 require A::Test;
 A::Test->import();
}
elsif ($type eq "B")
{
 require B::Test;
 B::Test->import();
}

1;
##########################################################################


##########################################################################
# SCRIPT 3 - saved as /A/Test.pm

#!/usr/local/bin/perl -w

package A::Test;
use Exporter;
@ISA = ('Exporter');
@EXPORT = qw(&printletter);
use strict;

use lib qw( /usr/local/etc/httpd/cgi-bin/ );

sub printletter {
print "<P>FOUND A<P>\n";
}

1;
##########################################################################


##########################################################################
# SCRIPT 4 - saved as /B/Test.pm

#!/usr/local/bin/perl -w

package B::Test;
use Exporter;
@ISA = ('Exporter');
@EXPORT = qw(&printletter);
use strict;

use lib qw( /usr/local/etc/httpd/cgi-bin/ );

sub printletter {
print "<P>FOUND B<P>\n";
}

1;
##########################################################################


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

Date: 6 Jun 2003 09:30:55 -0700
From: loic.raux@laposte.net (largo)
Subject: parsing multiple data member declarations in C++ with Perl regular expressions
Message-Id: <e8b677e2.0306060830.7867a01@posting.google.com>

Multiple data member declarations separated  by commas are often
used in C++ code, such as :

int a,b,c;

Though many systems for generating documentation or
reverse-engineering C++ code (e.g. Rational Rose : Warning: Multiple
data member declarations
separated by commas are not supported.) 
don't support multiple data member declarations separated by commas.


Unless you know a tool that could handle this (i.e. produce valid c++
header files for these systems), could you give the regular
expressions that would
recognize multiple data member declarations, split them and output
a valid c++ header file ? I'm almost sure this is feasible with a Perl
script

Thank you


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

Date: 6 Jun 2003 10:59:26 -0700
From: techadmin@shaw.ca (Steve)
Subject: Re: perl and surveys
Message-Id: <2e27f51a.0306060959.4c28dbe0@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<bbn5n7$9tmsv$1@ID-184292.news.dfncis.de>...
> BitZer0 wrote:
> > I'm trying to make site that'll display different surveys depending
> > on the count of visitors.  Can anyone help me out?  I have 12
> > different surveys that needs to be properly cycled through.  The
> > surveys also need to store the results to an appropriately named
> > file (ie, survey1, survey2, ..., survey12). I'm not much of a perl
> > script programmer, ...
> 
> Then hire somebody who is. Or learn it yourself.
> 
> / Gunnar

Gunnar, maybe is't time for you to take a break, from the internet..
you sound old and tired.

/ Steve


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

Date: 6 Jun 2003 09:49:21 -0700
From: jeffleary00@hotmail.com (Jeff Leary)
Subject: Perl and Win32 OLE Excel scripting problem/question... simple?
Message-Id: <7dd4facb.0306060849.559625a9@posting.google.com>

Hi all,

can someone please answer this? 
I'm tryin to extract info from specific cells in a spreadsheet. I've
placed the cell ID pairs into an array.
The call to extract the data ( $Sheet->Cells($row,$col)->{'Value'} )
seems to object to the $ROW,$COL assignments from an array... I keep
getting an error message that says:

>> Win32::OLE(0.1601) error 0x800a03ec
>> in METHOD/PROPERTYGET "Cells" at C:\perl_dev\b.pl line 18

yet, the same $ROW,$COL assignments from a FOREACH statement works
fine... (?!?)

HERE IT IS:
--------------------------------------------------------------------
#!perl -w

#
# A simple script to extract and print information from
# specific cells in an Excel spreadsheet (cells 4,2 5,2 3,8 2,8 13,9)
#

use Win32::OLE qw(in with);				# open WIN32 OLE
use Win32::OLE::Const 'Microsoft Excel';		# handle EXCEL files
$Win32::OLE::Warn = 3;					# die on errors

$Excel = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application','Quit');
$Book = $Excel->Workbooks->Open("c:\\perl_dev\\test2.xls"); 
$Sheet = $Book->Worksheets(1);

# -- HERE IS WHERE THE PROBLEMS START! -- #

@L = qw(4 2 5 2 3 8 2 8 13 9);
for ($i = 0; $i <= 8; $i += 2) {
	$row=$L[$i];
	$col=$L[$i+1];					
	
	# skip empty cells, or print cells containing information	 	
	next unless defined $Sheet->Cells($row,$col)->{'Value'};
	printf "ROW %s, COL %d, VALUE
%s\n",$row,$col,$Sheet->Cells($row,$col)->{'Text'};
}
	
$Book->Close;


# #################################################
# The above code DOES NOT work, yet the $ROW, $COL
# assignments in this very similar code works fine(!?)
#
#	foreach my $row (1..10)
#	{
# 		foreach my $col (1..10)
# 		{
#    		next unless defined $Sheet->Cells($row,$col)->{'Value'};
#		printf "ROW %s, COL %d, VALUE %s\n",
#   			$Sheet->Cells($row,$col)->{'Value'},
#   			$Sheet->Cells($row,$col)->{'Formula'};        
# 		}
#	}
#
#


THANKS!!!!!
Jeff


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

Date: Fri, 6 Jun 2003 12:39:28 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: perl
Message-Id: <slrnbe1keg.2gk.tadmc@magna.augustmail.com>

Graham Drabble <graham.drabble@lineone.net> wrote:
> On 06 Jun 2003 tadmc@augustmail.com (Tad McClellan) wrote in
> news:slrnbe154d.264.tadmc@magna.augustmail.com: 
> 
>> As far as book recommendations go, if someone says to me:
>> 
>>    I am so poor that I can only afford ONE book, what
>>    would you recommend?
>> 
>> I recommend a book that isn't even really a Perl book (MRE),
>                                                         ^^^^^
> 
> EXPN?


   perldoc -q book

          Special Topics
                  Mastering Regular Expressions
                      by Jeffrey E. F. Friedl
                      ISBN 1-56592-257-3 [1st edition January 1997]
                      http://www.oreilly.com/catalog/regex/



(but get the *2nd* edition!)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 6 Jun 2003 09:13:41 -0700
From: dan.macleod@eds.com (Dan MacLeod)
Subject: Regular expressions Question  HELP
Message-Id: <73192987.0306060813.5647bc54@posting.google.com>

I'm trying to use a regular expression to mak sure a string does NOT
match "0000" (four zeros in a row).  This is what I thought would work
- "[^0]{4}" but if a zero is the first charactor it will also fail
(01234 fails).  What is the correct way to check that "0000" was not
matched?

Thanks


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

Date: Fri, 6 Jun 2003 18:18:18 +0200
From: Lao Coon <laocoon@fastmail.fm>
Subject: Re: Regular expressions Question  HELP
Message-Id: <Xns9392BA41CF353laocoon@62.153.159.134>

dan.macleod@eds.com (Dan MacLeod) wrote in 
news:73192987.0306060813.5647bc54@posting.google.com:

> I'm trying to use a regular expression to mak sure a string does NOT
> match "0000" (four zeros in a row).  This is what I thought would work
> - "[^0]{4}" but if a zero is the first charactor it will also fail
> (01234 fails).  What is the correct way to check that "0000" was not
> matched?
> 
> Thanks

if($foo !~ /0000/) { ... } 


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

Date: 06 Jun 2003 17:48:23 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Regular expressions Question  HELP
Message-Id: <u9brxb884o.fsf@wcl-l.bham.ac.uk>

dan.macleod@eds.com (Dan MacLeod) writes:

> Subject: Regular expressions Question  HELP

Subject lines are important.  Do not shirk your responsibily.

"Question" is noise in subject lines.  Leave it out.

"HELP" is read as "please ignore".  Leave it out.

"Regular expressions" is a very wide topic.  You need to be  more precise.

If in doubt try this simple test.  Imagine you could have been
bothered to have done a search before you posted.  Next imagine you
found a thread with your subject line.  Would you have been able to
recognise it as the same subject?

Remember, just because you are asking a question, you should not come
here displaying a "take, take, take!" mindset.  As an asker of
questions you can still contribute if you take care with your subject
lines.  Your carefully constucted subject lines will help to lead the
next person to the answer.

Better still, rather than imagining, actually do a search.  If you
don't find the answer then make sure that whatever subject line you
choose would have been found by your search.

For example, this question was posted here in the last month with subject lines
"Negating phrases" and "dont match this pattern".

Theses are not perfect but can you see how much more helpful they are
than "Regular expressions Question  HELP"?

> I'm trying to use a regular expression to mak sure a string does NOT
> match "0000" (four zeros in a row).

That is the wrong tool for the job.

The way to negate a condition is to negate the condition.

i.e. 

  ! /0000/

>  This is what I thought would work
> - "[^0]{4}"

Why would you think that?

  "String does not contain four consecutive '0' characters"

Is nothing like

  "String contains four consecutive non-'0' characters"

> What is the correct way to check that "0000" was not matched?

 ! /0000/

For another (INHO, incorrect way) see the other threads to which I
allude.

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


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

Date: Fri, 06 Jun 2003 11:54:45 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: Temporary "holding"/"Working" page - ideas?
Message-Id: <oH3Ea.756$md3.33711@news.uswest.net>

Lawrence Tierney wrote:
> Hi there,
> 
> Looking for some ideas.
> 
> Got a script which runs a sql search. This search can take anything up to 60
> secs - quite a long time. What I'd like to do is while the mySQL is
> doing its stuff display a page like "Hold on - searching".

See Randal's column at:
http://www.stonehenge.com/merlyn/WebTechniques/col20.html



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

Date: 6 Jun 2003 10:25:38 -0700
From: Mike@Army.ca (Mike Bobbitt)
Subject: Unusual Can't load fail (web only)
Message-Id: <2b6e9805.0306060925.afdbe5@posting.google.com>

Hi all,

I've got an odd problem, that doesn't seem to be covered by any of the
exisiting threads. When I run a simple DB perl script through the
command line, it fetches the info and works fine. However, if I run it
via the web, I get the following error:

install_driver(mysql) failed: Can't load
'/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so'
for module DBD::mysql:
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so:
undefined symbol: PL_perl_destruct_level at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.

I've re-installed DBD::mysql using perl -MCPAN -e shell; and manually,
and there's no change. The fact that it runs via command line seems to
indicate permissions, but I ran "chmod -R o+r /usr/lib/perl5" and no
change.

Any help would be appreciated.

Thanks!


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

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


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