[9883] in Perl-Users-Digest
Perl-Users Digest, Issue: 3476 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 18 17:07:15 1998
Date: Tue, 18 Aug 98 14:00:24 -0700
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, 18 Aug 1998 Volume: 8 Number: 3476
Today's topics:
"use DBI;" fails? <alex@digi-q.com>
Re: "use DBI;" fails? <jdf@pobox.com>
Re: #!usr/bin/perl is ignored, WHY? tigger@io.nospaam.com
5.005_02 build error on linux (Mark Shadley)
? sprite database: = gets eq <dirkw@rhrk.uni-kl.de>
Re: can perl be compiled into EXE format? <nguyend7@msu.edu>
Re: Converting to lowecase <jdporter@min.net>
difference between dates (HeliSpot)
Re: difference between dates (Maurice Aubrey)
Re: Don't have 65535 lines (was Re: Enhance Warning mea (M.J.T. Guy)
Re: exception handling (M.J.T. Guy)
h2ph on Solaris 2.6 psabp@concentric.net
Help! (with web database) <ap619@chebucto.ns.ca>
Re: here's an implementation of diff in perl (Greg Bacon)
Re: How do I execute perl from html program <tbsmith@viper.net>
Re: Julian Date (I R A Aggie)
looking for examples of Dumper.pm and/or MLDBM.pm <estranged@lion.ccit.arizona.edu>
Re: looking for examples of Dumper.pm and/or MLDBM.pm <jdf@pobox.com>
Re: need help in using perl in windows for the first ti (Steve Linberg)
Re: newbie questions (Steven Barbash)
Re: Oraperl. Where can I get it? <rledo@wdc.com>
Re: Output to the top of the file (Tad McClellan)
Performing an Access query from Perl <sucheta@nmtec.com>
Period.pm or any other time module <anthony@nc.com>
Re: Period.pm or any other time module <abarfoot@eng.auburn.edu>
perl script "daemon" <rledo@wdc.com>
Re: perl script "daemon" (Maurice Aubrey)
Re: Printing letters with bolding, underline, and itali (Steve Linberg)
Re: regexp does'nt work (Ilya Zakharevich)
Removing one item from long list <george@tapestry.net>
Re: Removing one item from long list <jdf@pobox.com>
Re: request for comments... <jdporter@min.net>
Re: setrlimit: Operation not permitted (Kevin P. Neal)
test post -- please ignore (Steven Barbash)
test posting -- ignore (Steven Barbash)
Win32 Perl rm -rf Equivalent? (Lauren Elizabeth Darcey)
Re: win32 printing <JKRY3025@comenius.ms.mff.cuni.cz>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Aug 1998 13:28:22 -0700
From: Alex Guberman <alex@digi-q.com>
Subject: "use DBI;" fails?
Message-Id: <35D9E3E6.5ABB@digi-q.com>
Hi,
Can anybody tell me what to do if "use DBI;" command gives a "Internal
Server Error". I have Perl 5.003 running on the server.
Thanks a lot for you help.
Regards,
Alex Guberman
--
___________________________________
DIGI-Q Productions Co.
Web Site: http://www.Digi-Q.com
E-Mail: alex@digi-q.com
Phone: (408) 252-4091
Toll Free: (888) 55 DIGI-Q
(888) 553-4447
___________________________________
------------------------------
Date: 18 Aug 1998 16:48:32 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: alex@digi-q.com
Subject: Re: "use DBI;" fails?
Message-Id: <lnomneq7.fsf@mailhost.panix.com>
Alex Guberman <alex@digi-q.com> writes:
> Can anybody tell me what to do if "use DBI;" command gives a "Internal
> Server Error". I have Perl 5.003 running on the server.
See this document:
http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 18 Aug 1998 16:57:05 GMT
From: tigger@io.nospaam.com
Subject: Re: #!usr/bin/perl is ignored, WHY?
Message-Id: <6rcbp1$j03$1@hiram.io.com>
Well, without seeing the actual error message from doing a './test.pl', I
can't say for sure, but my guess is that either your #!/usr/bin/perl isn't
on the very first line of your script, or it has some bad characters in
it. Try deleting the first line of the script and redoing it.
HTH,
Paul Archer
> Could it be that the first command
> #!usr/bin/perl
> is ignored?
> Being in the cgi-bin directory (Unix shell), I tried to start another
> script using:
> ./test.pl
> It didn't work, as well. But using:
> usr/bin/perl test.pl
> it worked perfectly...
--
___________________________________________________________
* Tech Support: "I need you to boot the computer."
* Customer: (THUMP! Pause.) "No, that didn't help."
__________(http://www.rinkworks.com/stupid)________________
------------------------------
Date: 18 Aug 1998 20:55:22 GMT
From: shadcat@nospam.-shad-.net (Mark Shadley)
Subject: 5.005_02 build error on linux
Message-Id: <18081998.134204@nospam.-shad-.net>
I've run into this problem with 5.00_01 and 5.00_02. I eventually
got 5.00_01 to compile. But, like an idiot I neglected to save the
information! :( I can't find it on dejanews.
Here's the relevant portion of the make error.
(I'm specifying libdb.so.2.0.0 because although libdb.so.2.4.14 links ok,
perl isn't happy with it later, "dbm_*" vs "__dbm_*". This is why I'm
rebuilding).
rm -f libperl.a
ar rcu libperl.a perl.o gv.o toke.o perly.o op.o regcomp.o dump.o
util.o mg.o byterun.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
pp_ctl.o pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o
globals.o perlio.o
gcc -L/usr/local/lib -o miniperl miniperlmain.o libperl.a -lgdbm
/usr/lib/libdb.so.2.0.0 -ldl -lm -lpthread -lc -lcrypt
./miniperl -w -Ilib -MExporter -e 0 || make minitest
make[1]: Entering directory `/usr/local/src/perl5.005_02'
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm.
cd t && (rm -f perl; /bin/ln -s ../miniperl perl) \
&& ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t
pragma/*.t </dev/tty
Out of memory!
make[1]: [minitest] Error 139 (ignored)
make[1]: Leaving directory `/usr/local/src/perl5.005_02'
./miniperl configpm tmp
Out of memory!
make: *** [lib/Config.pm] Segmentation fault
Here's my setup:
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
Platform:
osname=linux, osvers=2.1.112, archname=i586-linux-thread
uname='linux home 2.1.112 #1 thu jul 30 11:45:07 pdt 1998 i586
unknown '
hint=previous, useposix=true, d_sigaction=define
usethreads=define useperlio=undef d_sfio=undef
Compiler:
cc='gcc', optimize='-mpentium -O6 -pipe', gccversion=egcs-2.90.29
980515 (egcs-1.0.3 release)
cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm /usr/lib/libdb.so.2.0.0 -ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc.so.5.4.46, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
I definitely am not running out of memory.
total used free shared buffers
cached
Mem: 160300 140812 19488 20168 41560
77824
-/+ buffers/cache: 21428 138872
Swap: 139692 108 139584
Total: 299992 140920 159072
Thank you in advance for any assistance with this. I know others are
running into this, they must be!
Mark
--
please reply to mark AT shad DOT net
------------------------------
Date: 18 Aug 1998 17:59:13 GMT
From: "Dirk Wiescher" <dirkw@rhrk.uni-kl.de>
Subject: ? sprite database: = gets eq
Message-Id: <01bdcad1$f0df8d00$32dbf683@WIESCHER>
Hi !!
I did a small database that uses the sprite v3.1 module from Shishir
Gundavaram.
everything works fine till one day I want to include a '=' character to my
database.
What happed: if I put the '=' character at the end of an inputstring it
changed to ' eq'
in the databasefile if I put a '=' between some other characters I get ' ==
'.
I tried to escape the = but nothing changed.
Has anybody an idea what is going on there ?
this is the part that updates the database:
for ($i=1; $i<$no_fields; $i++){
$form_data{$field[$i]} =~ s/(['"])/\\$1/g;
+ other escape procedures
$rdb->sql(<<End_of_query);
update $database
set $field[$i] = ('$form_data{$field[$i]}')
where (ID=$id)
End_of_query
}
$rdb->close ($database);
By the way, is there a simpler way to update all fields in one step?
waiting for your ideas
Ciao Dirk
------------------------------
Date: Tue, 18 Aug 1998 15:17:48 -0400
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: can perl be compiled into EXE format?
Message-Id: <35D9D35C.4482F3BF@msu.edu>
Sure, buy a faster computer. There is a perl compiler, but it probably won't
run the script faster. You should probably go through the script and try to
optimize it for more speed.
wings wrote:
> sometimes i do feel perl is running slowly.. is there anyway to make an
> EXE file out of a .pl? i am using ActiveState Perl5.005 in Windows NT4.0.
>
> thx for any enlightenment.
>
> wings
------------------------------
Date: Tue, 18 Aug 1998 15:54:36 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Converting to lowecase
Message-Id: <35D9DBFC.4C65@min.net>
[Posted and Mailed]
Grant Griffin wrote:
>
> John Porter wrote:
>
> > Now let me tell you about the park I hang out in.
> > [...]
> I think most of the good, decent people of the neighborhood
> probably avoid _your_ park, too...
Your thoughts of what's probable bear little semblance to reality.
Sorry.
You would know better if you would hang here just a little longer.
> I'll save you the trouble and write it for you:
> > GOOD RIDDANCE, IDIOT!!!
Please be more conscious of how you quote.
This kinda makes it look like I said it.
> (I gotta tell you, though, I never dreamed that this park could
> be this ugly...)
Yeah, it's not pretty to see tempers flare now and then.
But far preferable (in terms of ugliness) than to have to wade
through knee-deep trash, not being able to get to the vendors'
stands.... That's the alternative, and that's what were fighting.
--
John Porter
------------------------------
Date: Tue, 18 Aug 1998 17:36:03 GMT
From: news@helispot.com (HeliSpot)
Subject: difference between dates
Message-Id: <35d9bad6.80447707@news.newsguy.com>
I'm running a database site (mysql), and I want to flag items
displayed as "new" if they were added less then 30 days prior to the
system date. The added-date is a field in the database.
Is there an easy way to do this in perl?
Something along the lines of:
if (formula < 30) {
print "new" ;
}
Thanks.
Alex
HeliSpot
news@helispot.com
------------------------------
Date: Tue, 18 Aug 1998 19:19:57 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: difference between dates
Message-Id: <slrn6tjkut.15a.maurice@localhost.localdomain>
On Tue, 18 Aug 1998 17:36:03 GMT, HeliSpot <news@helispot.com> wrote:
>I'm running a database site (mysql), and I want to flag items
>displayed as "new" if they were added less then 30 days prior to the
>system date. The added-date is a field in the database.
>
>Is there an easy way to do this in perl?
>
>Something along the lines of:
>
>if (formula < 30) {
> print "new" ;
>}
Well, you could make added-date an int field and store the time in
seconds (i.e. the result of time() in Perl).
Then, do your select and iterate through the rows, checking
if added-date is >= (time() - 86400 * 30).
--
Maurice Aubrey <maurice@hevanet.com>
We must not forget that the wheel is reinvented so often because it is
a very good idea; I've learned to worry more about the soundness of
ideas that were invented only once.
- David Lorge Parnas, Computer, 1996
------------------------------
Date: 18 Aug 1998 20:41:37 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Don't have 65535 lines (was Re: Enhance Warning meaning, possibly?)
Message-Id: <6rcou1$2s3$1@pegasus.csx.cam.ac.uk>
Colin Kuskie <ckuskie@cadence.com> wrote:
>This is a known bug with 5.004_04. Chip Salzenburg posted a patch that
>was supposed to fix it at the end of his announcement for 5.004_04. I
>tried it, found that it didn't and after consulting some of the p5p people
>got a patch from Tim Bunce.
>
>Now, perl5.005 is out, and I hear talk of another maintenance release of
>perl5.004 (to put out perl5.004_05). I'd expect either/both of them to
>include the fix.
Yes. Both 5.005+ and 5.004_05-to-be have this fix.
Mike Guy
------------------------------
Date: 18 Aug 1998 20:36:41 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: exception handling
Message-Id: <6rcokp$288$1@pegasus.csx.cam.ac.uk>
Spencer W Thomas <spencer@umich.edu> wrote:
>Greg Bacon wrote:
>"eval "returns undef if there was an error executing the expression, then you
>can look at $@ to get the error message. The hard part is figuring out from
>the error message just *what* it was that happened.
That's the wrong way round to do things. The eval{} may return undef
even if there was no failure (i.e. die() ). To determine whether an
eval failed you must test $@. That will be true exactly if there was
a failure.
> my $err = $@; # Copy error message so debugger won't stomp on it
Eh? What's that for? Since $@ is a global variable, almost anything
in the known universe *can* stomp on it. But the debugger is very careful
to be polite - it should only squash $@ if you ask it to, for example by
replying
DB<1> $@ = 'Something entirely different'
DB<1>
Do you have an example where this isn't true?
Mike Guy
------------------------------
Date: Tue, 18 Aug 1998 12:44:34 -0600
From: psabp@concentric.net
Subject: h2ph on Solaris 2.6
Message-Id: <35D9CB92.543485E8@concentric.net>
Hello all,
Just wondering if anyone else has seen a problem with h2ph on Solaris
2.6. I am trying to use the system sockets but when I run h2ph on a
header file I get a .ph file that has a syntax error in it.
Any suggestions would be appreciated, please respond to psabp@msn.com.
Thanks,
Peter Abplanalp
------------------------------
Date: Tue, 18 Aug 1998 16:35:23 -0300
From: Kevin <ap619@chebucto.ns.ca>
Subject: Help! (with web database)
Message-Id: <35D9D77B.3871@chebucto.ns.ca>
Hi,
I have a database(text file) of "goaltending tips".
I've created a TIPs webpage and want to have it so that the user can
click a "VIEW NEXT TIP" button and the next record in the database will
be displayed. So far I have only found scripts that allow for "random"
displays, i.e. click the button and it randomly picks a tip from the
database. This is a problem because they often choose the same tip(same
record) several times in a row, even if teh database is large.
Can anyone direct me to a script like the one I've described?
I am on a unix server.
**PLEASE RESOND BY EMAIL**
Much appreciated!
Sincerely,
Kevin Howe
------------------------------
Date: 18 Aug 1998 18:05:22 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rcfp2$rfm$21@info.uah.edu>
In article <6rcf1b$jug$1@pegasus.csx.cam.ac.uk>,
mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
: In article <6rcdf6$rfm$20@info.uah.edu>,
: Greg Bacon <gbacon@cs.uah.edu> wrote:
: >O(n + n lg n) is the same as O(n lg n).
:
: What's that got to do with Abigail's (correct) statement?
It takes O(n) comparisons to check whether a set is already sorted.
This is a simple approach, but most modern implementations of quicksort
do something to avoid quicksort's O(n**2) worst case.
Greg
--
Why do they call it a "building"? It looks like they're finished. Why isn't
it a `built'?
-- Jerry Seinfeld
------------------------------
Date: Tue, 18 Aug 1998 15:19:26 -0500
From: Todd Smith <tbsmith@viper.net>
Subject: Re: How do I execute perl from html program
Message-Id: <35D9E1CE.A51FE7E8@viper.net>
where you want the script's output, put
<!--exec cmd="script.pl" -->
guys- just answer the question!
Jon Bell wrote:
> In article <35D8FF58.A7BCE400@home.net>, Alan Melton <arm@home.net> wrote:
> >I have a perl program example.pl
> [snip]
> >How can I run the program from the web?
> >either straight or as an html?
>
> The same way you run a program written in any other language (in other
> words, this isn't a Perl question). You need to learn about CGI, for
> which the appropriate newsgroup is comp.infosystems.www.authoring.cgi
> (make sure you read the FAQs before you post!)
>
> --
> Jon Bell <jtbell@presby.edu>
--
-------------------------------------
Todd Smith
Perl Programmer - ITC^DeltaCom
tbsmith@viper.net
%|
------------------------------
Date: Tue, 18 Aug 1998 16:47:24 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Julian Date
Message-Id: <fl_aggie-1808981647240001@aggie.coaps.fsu.edu>
In article <6rc3en$633$1@nnrp1.dejanews.com>, ywang@maingate.net wrote:
+ Could anyone please tell me how to generate the Julian Date in Perl?
*Which* Julian date? Astronomical? or the number of days since 1 January?
James
------------------------------
Date: Tue, 18 Aug 1998 01:15:57 -0700
From: "Mark Fischer" <estranged@lion.ccit.arizona.edu>
Subject: looking for examples of Dumper.pm and/or MLDBM.pm
Message-Id: <6rcndf$6ur$1@news.ccit.arizona.edu>
can anyone point me in the direction of some good documentation
and/or examples of using MLDBM.pm or Dumper.pm?
thanks,
mark fischer
------------------------------
Date: 18 Aug 1998 16:43:37 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Mark Fischer" <estranged@lion.ccit.arizona.edu>
Subject: Re: looking for examples of Dumper.pm and/or MLDBM.pm
Message-Id: <r9yeneye.fsf@mailhost.panix.com>
"Mark Fischer" <estranged@lion.ccit.arizona.edu> writes:
> can anyone point me in the direction of some good documentation
> and/or examples of using MLDBM.pm or Dumper.pm?
They both come with documentation that explains their use. The
modules themselves are filled with pod.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Tue, 18 Aug 1998 14:13:53 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: need help in using perl in windows for the first time.
Message-Id: <linberg-1808981413540001@projdirc.literacy.upenn.edu>
In article <35D9A3F7.FB7@nirvanet.fr>, padjo@nirvanet.fr wrote:
> Hi there people. I installed perl on my laptop. I have a book on Perl
> programming that seems to be good but it does not tell me how
> to write a file in win 95 save it as .what and how to run it. I'd really
> appreciate some help.
Look at the documentation that came with your perl system,it should
contain system-specific information.
You can save your scripts with a .pl extension and invoke them like this:
c:\>perl myscript.pl
Have fun!
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Tue, 18 Aug 1998 18:28:19 GMT
From: stevenba@carr.org (Steven Barbash)
Subject: Re: newbie questions
Message-Id: <MPG.10439fdae2cc4586989682@riksbyggen.se>
To all who have answered -- thank you.
Each has added something to my knowledge and understanding.
FYI: Since I posted my question, I (located and) downloaded the source
code.
Some searching seems to suggests that "." is NOT a set of characters
(in the sense of an array somewhere in memory),
but rather, programmatically implemented.
Apparently, ditto for 'space' "s" and 'not space' "S", etc.
also:
\perl5.004_04\handy.h (in part):
====================================================================
#define isALNUM(c) (isALPHA(c) || isDIGIT(c) || (c) == '_')
#define isIDFIRST(c) (isALPHA(c) || (c) == '_')
#define isALPHA(c) (isUPPER(c) || isLOWER(c))
#define isSPACE(c) \
((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f')
#define isDIGIT(c) ((c) >= '0' && (c) <= '9')
#define isUPPER(c) ((c) >= 'A' && (c) <= 'Z')
#define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
#define isPRINT(c) (((c) > 32 && (c) < 127) || isSPACE(c))
#define toUPPER(c) (isLOWER(c) ? (c) - ('a' - 'A') : (c))
#define toLOWER(c) (isUPPER(c) ? (c) + ('a' - 'A') : (c))
====================================================================
Thank you all again.
Steve
------------------------------
Date: Tue, 18 Aug 1998 12:02:57 -0700
From: Roy Ledochowski <rledo@wdc.com>
Subject: Re: Oraperl. Where can I get it?
Message-Id: <35D9CFE1.D405953@wdc.com>
Ch=E9 Letton wrote:
> =
> Hello.
> =
> I have been told that oraperl is the one for accessing Oracle tables
> thru Perl.
> So where do i get it from?
> =
> Thanks for your time
> =
> Che Letton
Best thing to do is make sure you're running Perl 5.004 & go to
www.perl.com. Look for databases & follow the links, or search under
Oracle.
Oraperl is now a module called DBD::Oracle & you'll also need DBI. You
also need the Oracle client & Pro*C installed on the machine which has
Perl installed (the client machine)
------------------------------
Date: Tue, 18 Aug 1998 13:16:23 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Output to the top of the file
Message-Id: <ndgcr6.kg5.ln@metronet.com>
jm@kolumbus.fi wrote:
: I have a script that reads form and adds the data to a file. It works
: fine, but I'd like to put the data always to the top of the file. I have
: taken this script from the Web.
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
: All help greatly appreciated
All reading of the FAQs and not reposting them yet again appreciated...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 18 Aug 1998 13:13:09 -0700
From: Sucheta Khot <sucheta@nmtec.com>
Subject: Performing an Access query from Perl
Message-Id: <35D9E055.7D6B@nmtec.com>
Could anybody please answer my questions:-
I am getting an error:
Use of uninitialized value at peppersearch.pl line 12.
Cannot open ODBC connection to "Article":911[Microsoft][ODBC Driver
Manager] Dat
a source name not found and no default driver specified
Where line 12 is :
my($db) = new Win32::ODBC($DSN) ||
die qq{Cannot open ODBC connection to "$DSN":},
Win32::ODBC::Error, qq{\n}; #******** METHOD I *************
There is an Access database called 'Article' exising in the same
directoty as of the perl script.
Instead, if I use,
if (Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, ("DSN=$DSN",
"Description=The Win32 ODBC Test DSN for Perl", "DBQ=$Dir\\$DBase",
"DEFAULTDIR=$Dir", "UID=", "PWD="))){
print "Successful!\n";
}else{
print "Failure\n";
} #****************METHOD II******************
where,
$Dir = `cd`;
$DBase = "Article.mdb";
Then, I can successfully add the DSN and then if I use 'new' method to
open a connection to the database, i can do it successfully.
Q1. BUT Why this same is not working without using
Win32::ODBC::ConfigDSN method?
Q2. If I use method II, then further in my code code if I place a query
such as,
$stmt = "Select * from BugSpec";
$rc = $O->Sql($stmt);
die qq{SQL failed "$stmt": }, $O->Error(), qq{\n} if $rc;
Then, nothing is happening, why? How should I print the result of this
query to the screen?
Thank you.
------------------------------
Date: Tue, 18 Aug 1998 11:07:21 -0700
From: Anthony Lee-Masis <anthony@nc.com>
Subject: Period.pm or any other time module
Message-Id: <35D9C2D9.96489597@nc.com>
This is a multi-part message in MIME format.
--------------C1C44FF7D0B58B76ABB29613
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi all,
I have a problem i hope you can help with. I need to somehow find out if
a certain day falls within a period of a week or 2 weeks.
Example given the range 7/2/98 - 7/19/98
Now given the date 7/14/98 , does this date fall within the range. I
need to find out how to do that. I poked around CPAN and found a module
called Period.pm and have tried to implement that. The closest i could
get that to work is to see if the date falls within a period of months
and not weeks.
The project i am doing needs to find out if a day falls within a given
week.
Does anyone know how to do this with Period.pm or some other way of
doing it ?
Thanks in advance for your help.
--------------C1C44FF7D0B58B76ABB29613
Content-Type: text/x-vcard; charset=us-ascii;
name="alee.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Anthony Lee-Masis
Content-Disposition: attachment;
filename="alee.vcf"
begin:vcard
n:Lee-Masis;Anthony
x-mozilla-html:TRUE
org:Network Computer Inc.
adr:;;;Redwood Shores;CA;94065;USA
version:2.1
email;internet:anthony@nc.com
title:Technical Support Engineer
x-mozilla-cpt:;0
fn:Anthony Lee-Masis
end:vcard
--------------C1C44FF7D0B58B76ABB29613--
------------------------------
Date: Tue, 18 Aug 1998 15:01:32 -0500
From: andy barfoot <abarfoot@eng.auburn.edu>
To: Anthony Lee-Masis <anthony@nc.com>
Subject: Re: Period.pm or any other time module
Message-Id: <Pine.SOL.3.96.980818150007.5896B-100000@leahy.eng.auburn.edu>
use Time::Local; #should have come with recent perl
# The params to timelocal are the same as the output of localtime
# (in array context)
my $moment_one = timelocal 1,2,3,4,0,98; # Jan(0) 4, 1998 at 3:02:01
my $moment_two = timelocal 1,2,3,4,2,98; # Mar(2) 4, 1998 at 3:02:01
my $moment = timelocal 1,2,3,4,1,98; # Feb(1) 4, 1998 at 3:02:01
print "moment between moment_one and moment_two\n"
if $moment_one <= $moment and $moment <= $moment_two;
--
andy.barfoot@eng.auburn.edu
On Tue, 18 Aug 1998, Anthony Lee-Masis wrote:
> Hi all,
>
> I have a problem i hope you can help with. I need to somehow find out if
> a certain day falls within a period of a week or 2 weeks.
>
> Example given the range 7/2/98 - 7/19/98
> Now given the date 7/14/98 , does this date fall within the range. I
> need to find out how to do that. I poked around CPAN and found a module
> called Period.pm and have tried to implement that. The closest i could
> get that to work is to see if the date falls within a period of months
> and not weeks.
>
> The project i am doing needs to find out if a day falls within a given
> week.
>
> Does anyone know how to do this with Period.pm or some other way of
> doing it ?
>
> Thanks in advance for your help.
>
------------------------------
Date: Tue, 18 Aug 1998 11:45:47 -0700
From: Roy Ledochowski <rledo@wdc.com>
Subject: perl script "daemon"
Message-Id: <35D9CBDB.F1B47AA5@wdc.com>
Help--
Is it possible to run a perl script which is not attached to a terminal?
-- in other words, when I log out it continues to run. If so, how?
Any help would be most appreciated.
thanks,
roy
------------------------------
Date: Tue, 18 Aug 1998 19:24:51 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: perl script "daemon"
Message-Id: <slrn6tjl83.15a.maurice@localhost.localdomain>
On Tue, 18 Aug 1998 11:45:47 -0700, Roy Ledochowski <rledo@wdc.com> wrote:
>Is it possible to run a perl script which is not attached to a terminal?
>-- in other words, when I log out it continues to run. If so, how?
Yes. Check out the Proc::Daemon module. Or just use nohup:
nohup ./myperlscript &
--
Maurice Aubrey <maurice@hevanet.com>
... one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination
of their C programs.
- Robert Firth
------------------------------
Date: Tue, 18 Aug 1998 14:11:59 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Printing letters with bolding, underline, and italics from perl script?
Message-Id: <linberg-1808981411590001@projdirc.literacy.upenn.edu>
In article <35D9A432.65960F8E@nih.gov>, jbl <jlaird@nih.gov> wrote:
> How does one print characters with bolding, underline, and italics from
> perl script?
Perl doesn't know anything about character formatting (unless you're
talking tk). Is this an HTML question? Are you trying to build a web
page? If so, just print your HTML as you would write it normally.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 18 Aug 1998 18:32:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: regexp does'nt work
Message-Id: <6rchce$6c8$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Greg Bacon
<gbacon@cs.uah.edu>],
who wrote in article <6rc6c6$rfm$12@info.uah.edu>:
> : Perl stops executing and displays
> : "s/: regexp *+ operand could be empty at ./stripHTML.pl
> : line 44."
> The reason Perl warns about possibly empty subpatterns is because
> they can take forever (or at least a very long time) to fail.
Wrong. Perl does not care if it gets you enough rope. The reason was
to simplify life of Perl porters. There was a rarely triggered very
hard to trace bug in RE engine, which could cause an infinite recursion,
thus a segfault due to C stack overflow.
At some moment a decision was made to throw away child together with
water, and just prohibit the construct. At this time I thought that
this was going to be a warning (not a fatal error), and did not voice
my concerns.
> jfriedl goes over this in his book, _Mastering Regular Expressions_.
Nowadays one should take this book with a grain of salt. It is a very
old Perl what it documents.
> Perl regular expression engines haven't always spotted this, and
> Tom's code probably predates those checks.
Exactly the opposite. There was a short period-of-versions where Perl
was exhibiting this misfeature. (When debugging this, I needed to
introduce the current format of re debugging, now available via
-Mre=debugcolor.)
Enjoy,
Ilya
------------------------------
Date: 18 Aug 1998 20:20:42 GMT
From: "George H" <george@tapestry.net>
Subject: Removing one item from long list
Message-Id: <01bdcae4$c9d55ec0$dd96cdcf@hp-customer>
For the maintenance of a large opt-in mailing list, I use a simple shell
script to remove an address from a new-line delimited list of addresses. I
don't think the script is very efficient. Basically, it will take the
address I give it at the command line, verify there is only one match in
the list, grep (-v) everything but that address into a temporary file, and
then write the temporary file back into the place of the original.
This works and has been sufficient until now, but the list is getting large
and I was wondering if someone with more advanced programming skill could
offer an alternative in Perl. I think my current script is too processor
intensive ... especially if I have a large list of people to remove on a
given day.
Any ideas that may help in this case?
Curious ... George
------------------------------
Date: 18 Aug 1998 16:46:49 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "George H" <george@tapestry.net>
Subject: Re: Removing one item from long list
Message-Id: <ogtinet2.fsf@mailhost.panix.com>
"George H" <george@tapestry.net> writes:
> This works and has been sufficient until now, but the list is getting large
> and I was wondering if someone with more advanced programming skill could
> offer an alternative in Perl.
Well, aside from using an index into a file, and deleting entries from
the index rather than deleting them from the data (which is how a
database manager might do it), there's no getting around the fact that
you've got to write a new file and move it back over the old one. Of
course, that's easy enough to do:
perl -i~ -ne 'print unless /\Qaddress@to.remove/'
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Tue, 18 Aug 1998 16:11:43 -0400
From: John Porter <jdporter@min.net>
Subject: Re: request for comments...
Message-Id: <35D9DFFF.A42@min.net>
1. isn't 11+1-8 simply 4? Why the pseudo-obfuscation?
2. calling chr() twice?
3. Superfluous empty strings?
4. Unused variables?
5. Put loop exit test as early as possible in the loop.
6. Put loop invariants outside the loop, at least if
they're computationally non-trivial.
7. Declare vars in the smallest enclosing scope (Style).
#!/usr/bin/perl -w
use strict;
use diagnostics;
my $x = 0;
my $max_x = 16*((2**31)-1);
# Program control...
until ( $x++ > $max_x ) {
my $pw = "Password"; # Test Password
my $first = chr( (rand(time) >> 4) % (1 << 7) );
my $second = chr( (rand(time) >> 4) % (1 << 7) );
# print "$first $second\n";
next unless $first =~ /^-?[a-zA-Z0-9]+$/;
next unless $second =~ /^-?[a-zA-Z0-9]+$/;
print "Trying: ", crypt($pw, $first.$second), "\n";
}
--
John Porter
------------------------------
Date: Tue, 18 Aug 1998 17:46:42 GMT
From: kpneal@pobox.com (Kevin P. Neal)
Subject: Re: setrlimit: Operation not permitted
Message-Id: <903463063.927737@tome.pantheon.org>
Marshall Dudley <mdudley@execonn.com> wrote:
>I have moved some debugged perl code from a SUN system to a free BSD
>system, and am now getting the following errors in the error log when I
>try to run the scripts from a browser:
>I don't know if this is a FREE BSD problem, an Apache Problem or a Perl
>problem. The script does not call this function, and runs fine on other
>systems.
Uh, which particular free BSD system?
What platform? Version?
See, there are (at least) NetBSD, OpenBSD, and FreeBSD. FreeBSD
doesn't run on Suns currently. Did you move to a different machine or
just installed a new OS?
There is nothing called "FREE BSD". Are you actually using "FreeBSD"?
Also, it helps to give the version number of the OS, whatever OS you
are running.
--
Kevin P. Neal http://www.pobox.com/~kpn/
'You know, I think I can hear the machine screaming from here... \
"help me! hellpp meeeee!"' - Heather Flanagan, 14:52:23 Wed Jun 10 1998
------------------------------
Date: Tue, 18 Aug 1998 00:53:33 -0300
From: stevenba@carr.org (Steven Barbash)
Subject: test post -- please ignore
Message-Id: <MPG.1042d2d643da45f8989681@news.tmlp.com>
test post -- please ignore
------------------------------
Date: Mon, 17 Aug 1998 18:57:17 -0300
From: stevenba@carr.org (Steven Barbash)
Subject: test posting -- ignore
Message-Id: <MPG.10427f56968e8ed4989680@news.tmlp.com>
test posting -- ignore
------------------------------
Date: 18 Aug 1998 20:32:54 GMT
From: sorsha@cats.ucsc.edu (Lauren Elizabeth Darcey)
Subject: Win32 Perl rm -rf Equivalent?
Message-Id: <6rcodm$70@darkstar.ucsc.edu>
Hi, I am currently trying to convert the NT batch file line
rd /s dirname to the equivalent in PERL. When I checked out the
rmdir function, it only seems to delete if the directory is empty.
So I did a little research on this, and I came up with two methods
I could use.
(1) Use rmtree(dirname, ..) uses rmdir and unlink. What are the affects
of unlinking with the NT filesystem?
(2) Use opendir/readdir on the directory, get an array of all entries in
the directory, delete all files and foreach -d subdirectory, call my
function recursively.
I tested rmtree on unix and nt, and it had the desired effects, but I'm
curious as to if its REALLY equivalent to rd /s dirname. Also,
efficiency-wise, would it be faster for me to write my own routine?
Thanks in advance for any help.
Laurie <sorsha@cats.ucsc.edu>
------------------------------
Date: Tue, 18 Aug 1998 21:48:50 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: win32 printing
Message-Id: <35DA5932.66CB@comenius.ms.mff.cuni.cz>
Daniel wrote:
>
> Here is some text off my web site (www.telerama.com/~ghia) that covers that
> very question:
>
> If you ever need to send information to the LPT1 in Perl here is the code to
> do it:
>
> open( LPT, "+>LPT1" ) or die "Can't access printer: $!";
or
open( LPT, "+>\\\\servername\\printername" ) or die "Can't access
printer: $!";
if you didn't capture any port or if you want to print elsewhere.
You may also want to binmode LPT if you send binary data!
HTH, Jenda
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3476
**************************************