[11789] in Perl-Users-Digest
Perl-Users Digest, Issue: 5389 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 15 07:07:25 1999
Date: Thu, 15 Apr 99 04:00:19 -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 Thu, 15 Apr 1999 Volume: 8 Number: 5389
Today's topics:
Re: $variables in <FILES> (Bart Lateur)
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Can I write a #!-style interpreter with Perl ? <jorma.laaksonen@hut.fi>
compare form input with log file <seugenio@man.amis.com>
Re: Cookie problem <c-denman@dircon.co.uk>
Re: Current Date (David Cantrell)
Re: DBI as a Base Module <gellyfish@gellyfish.com>
Re: Flocking, Locking, DBM's & TXT's <gellyfish@gellyfish.com>
Re: How do I format form input to DOS text (sort of) ?? (Kvan)
Re: Looking for y2k code scanner for Perl code (Bart Lateur)
Re: Odbc won't work for database on network ajeet@my-dejanews.com
Please Help Me :-))) <JK@sandwell98.free-online.co.uk>
Re: Please Help Me :-))) <thorsten.dittmar@debitel.net>
Re: Please Help Me :-))) (Bart Lateur)
Re: Q: Convert two newlines to \n<p> <gellyfish@gellyfish.com>
Re: Randomize Please Help <gellyfish@gellyfish.com>
Re: removing ^M, ^B and other wierd chars (Bart Lateur)
Re: SQL and the ODBC module ajeet@my-dejanews.com
Re: Trying to get the cgi script to print the date last <Michael.Cameron@no.spam.technologist.com>
Re: Unitialized var errors & -w flag (Bart Lateur)
want regex to set a value in place of a procedure (Jim Britain)
Re: Would anyone care to teach me perl? ajeet@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 Apr 1999 08:16:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $variables in <FILES>
Message-Id: <3719a071.3763461@news.skynet.be>
Eric Bohlman wrote:
>For ease of debugging, I'd change that to:
>
>s/\$(\w+)/(exists $macros{$1})?$macros{$1}:$1/ge;
>
>so that misspelled macro names will stick out like sore thumbs in the
>translated text instead of quietly disappearing.
"Stick out"?
s/\$(\w+)/(exists $macros{$1})?$macros{$1}:"###$1###"/ge;
That's what I call "stick out". Giving a warning to draw the attention
to this, would be nice too.
Bart.
------------------------------
Date: Thu, 15 Apr 1999 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage924171841.16932@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 15 Apr 1999 12:21:39 +0300
From: Jorma Laaksonen <jorma.laaksonen@hut.fi>
Subject: Can I write a #!-style interpreter with Perl ?
Message-Id: <x4d816z1b0.fsf@james.hut.fi>
Hello!
Currently, I have a text parser named /my-script-dir/parser written in
Perl. It reads and processes standard input and works as such fine.
I.e., I can use it: "/my-perl-script-dir/parser < textfile".
I can also run it with "/usr/bin/perl /my-perl-script-dir/parser textfile".
But, what I now would like to be able to do is to write the input
to the script as a script like:
*** #! /my-perl-script-dir/parser
***
*** here are the input lines...
*** ...
I have "chmod +x"'d this file and tried to run it. It seems to me that
the lines end up to be processed by /bin/csh, not by my Perl script.
The parser script /my-script-dir/parser simply begins like:
*** #! /usr/bin/perl
Is this a FAQ? Any advise? Is there a general solution to this
problem? I'm using Linux 2.0.36 on an i686.
Jorma
--
Jorma Laaksonen, Dr. of Science in Technology email: jorma.laaksonen@hut.fi
Laboratory of Computer and Information Science http://www.cis.hut.fi/~jorma/
Helsinki University of Technology tel. +358-9-4513269
P.O.BOX 5400, FIN-02015 HUT, FINLAND fax. +358-9-4513277
------------------------------
Date: Thu, 15 Apr 1999 10:42:54 GMT
From: "Sheila Eugenio" <seugenio@man.amis.com>
Subject: compare form input with log file
Message-Id: <01be872c$97143fb0$2bbe10ac@amipnet>
Hi,
I have a log file with the ff. format. The first two are username and
password respectively. I am having trouble with comparing the user input
with these two.
ISD:ipre:sroque@man.amis.com:Sheila:Eugenio:::::::::::::::::::::::::0
BMG:troy:trodriguez@man.amis.com:Troy:Rodriguez:::::::::::::::::::::::::0
HED:sample:ldavid@man.amis.com:Ana Liza:David:::::::::::::::::::::::::0
Here's a part of my code:
$log = 'f:/ama/amdata.db';
$username = $q->param(username');
$password = $q->param('password');
open (PEOPLE, "$log") or die "Cannot find log file: $!";
while ($line = <PEOPLE>) {
@data = split(/\:/, $line);
#stopped here because it's not getting any better :-)
}
if ($FORM{'username'} ne ???) {
print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD>\n";
print "<BODY><H1>Access Denied</H1>",$FORM{username}," username you
supplied does not exist.<P>\n";
print "<a href=http://go/back.htm>Please try again</a>\n";
print "</BODY>\n";
print "</HTML>\n";
} elsif ($FORM{'password'} ne ???) {
Thanks all for your help!
------------------------------
Date: Thu, 15 Apr 1999 09:09:06 +0100
From: "Chris Denman" <c-denman@dircon.co.uk>
Subject: Re: Cookie problem
Message-Id: <37159e9a@glitch.nildram.co.uk>
Yea, I had a few probs with this library (not that there is anything wrong
with it, I just like to hand code stuff)
Try this:-
sub
kies{
@cookies=split(/; /,$ENV{'HTTP_COOKIE'}); #gets the cookies
foreach $acookie (@cookies){ #separate the cookies up
($left,$right)=split(/=/,$acookie);
$cookie{$left}=$right;
}
if(!$cookie{'classid'}){ #in this case I want to give the user
temporary ID (should be unique, I
know - 100000000/1 chance
of problems)
$cookie{'classid'}=int(rand(100000000));
}
print "Set-Cookie: classid=$cookie{'classid'}\n"; #set this cookie
if($ENV{'HTTP_COOKIE'}){ #cookies are enabled, else use IP
$ENV{'REMOTE_ADDR'}=$cookie{'classid'};
}
}
$id=$ENV{'REMOTE_ADDR'};
hope it helps....
ChrisD
jatgal@my-dejanews.com wrote in message <7f2res$qm4$1@nnrp1.dejanews.com>...
>I'm trying to set a cookie, however I'm not being able to.
>here is following what I'm doing
>
>use CGI;
>
>$query = new CGI;
>
>$cookie = $query->cookie(-name =>'ID', -value => $ID);
>
>print $query->header(-cookie=>$cookie);
>
>
>any ideas why it might not be setting cookie. I also tried using
>CGI::cookie module and other methods as
>
> print "Set-Cookie: name='cookiename'; value='cookievalue'; path='/';
> expires='time';\n";
>
>
>Your help would be greatly appreciated
>
>
>Thanks
>J
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 15 Apr 1999 10:18:58 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Current Date
Message-Id: <3715bcec.66077734@news.insnet.net>
On Thu, 15 Apr 1999 00:51:23 GMT, Eric Bohlman <ebohlman@netcom.com>
enlightened us thusly:
>I would just like to point out to those posters who have in the past
>complained that Perl's handling of years is "broken" that they ought to
>look at the way JavaScript handles dates if they want to see a truly
>broken implementation ...
Javascript's date handling is misdocumented as well. Unlike perl.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: 15 Apr 1999 09:35:24 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBI as a Base Module
Message-Id: <3715a4cc.0@newsread3.dircon.co.uk>
In comp.lang.perl.misc Sys Adm 89806 Manager of programing development and Intranet Resources <ruben@llinderman.dental.nyu.edu> wrote:
> [Posted and mailed]
>
> Are you certain that I need to call use or require within a module when
> assigning the module to ISA?
>
Yep :
t1.pl :
use t1;
$blah = new t1;
t1.pm (before):
package t1;
@ISA = qw(CGI);
1;
Result :
P:\test>perl t1.pl
Can't locate object method "new" via package "t1" at t1.pl line 3.
t1.pm (after) :
package t1;
require CGI;
@ISA = qw(CGI);
1;
Result:
P:\test>perl t1.pl
(offline mode: enter name=value pairs on standard input)
P:\test>
Tada !
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 15 Apr 1999 09:18:57 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Flocking, Locking, DBM's & TXT's
Message-Id: <3715a0f1.0@newsread3.dircon.co.uk>
NOSPAMcrstlblu@planet.eon.net wrote:
> On Wed, 14 Apr 1999 13:08:29 GMT, snowhare@long-lake.nihongo.org (Benjamin >>
> or must one use the FULL NAME ?
>>>eg: flock "dbmname.DIR",2; or,
>>> flock "dbmname.PAG",8; ????
>>No. This won't work, either. 'flock' works on
>>_file handles_ - not _file names_.
>
> thanks,
> if a text file one would say:
> $Handle="dbmfile.txt";
> flock $Handle, 2;
Er no. $Handle is just a scalar variable contain the filename - it is not
a filehandle which is created when one does for instance:
open(FILE,"dbmfile.txt") || die "blah ...\n";
FILE is the filehandle.
> if a DBM , isn't the "%ass_arr" a sort of a HANDLE too?
> dbmopen(%Handle,"thedbmfile",0666)
>
> isn't the "%Handle" associative array therefor "TIED" already to the DBM file?
> I've tried this:
> flock %Handle,2; # where %Handle is the ass arr that was (PSEUDO-TIED)
>
> # to the DBM file
> flock %Handle,8;
%Handle is a hash that is tied to the dbm it can not be used where one would
use a filehandle. What messages did you get when you ran this with perl -w ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 15 Apr 1999 09:31:11 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: How do I format form input to DOS text (sort of) ???
Message-Id: <37159f5a.2682387@news.newsguy.com>
On Thu, 15 Apr 1999 05:12:49 GMT, rdcomp@sympatico.ca (Mark Creelman)
wrote:
> $lines[$a] =s/[\cM\cB]//g
Your problem is simple: In MS-DOS, and hence also in Windows, each
line ends with a Carriage Return followed by a Line Feed, while in
most other standards, including web forms, lines end with an LF only.
What you want is:
$lines[$a] = s/\n$/\r\n/g;
Kvan.
-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- | dumb, panicky, dangerous animals
| and you know it.'
| - "K" in Men in Black.
------------------------------
Date: Thu, 15 Apr 1999 09:27:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Looking for y2k code scanner for Perl code
Message-Id: <3716b047.7817310@news.skynet.be>
Tad McClellan wrote:
>Tom Karches wrote:
>
>: We would like to scan our internally developed Perl code for potential
>: y2k coding problems. If someone has develped such a tool, I'd like to
>: hear from you.
>
> Here's a simple and free one:
>
> while (<>) {
> print "check me!\n" if /19\$/;
> }
Excellent! :-)
However, it would be a *bit* more checker-friendly if it would also
print out file name and line number ($.). Er... sounds like an
application for grep (the program, not the function).
Any code containing keywords like "localtime" and "gmtime" deserves
inspection.
Bart.
------------------------------
Date: Thu, 15 Apr 1999 07:54:52 GMT
From: ajeet@my-dejanews.com
Subject: Re: Odbc won't work for database on network
Message-Id: <7f460a$v1f$1@nnrp1.dejanews.com>
Thats the problem with access, as it is not exactly meant for client-server.
If I am not wrong, You cannot have the database open, if you want to send a
ODBC call. SQL server would be good choice, especially if it's gonna be
heavliy used.
In article <3715825a.2226093@news.eunet.ch>,
th.eichmann@gmx.net wrote:
> The error message says the reason: it's obvious that another has the
> mdb file opened in the exclusiv mode. When the other user closes the
> file you should get access to the database.
>
> Thomas
>
> On Wed, 14 Apr 1999 19:26:37 -0400, qinqiang sun <qsun@kitco.ca>
> wrote:
> >Hi,
> > I use perl Win32:odbc WinNT4.0. The Database is access97 and ODBC
> >driver version is 3.50. If use database on local driver there is no
> >problem. When I tried to use database on network driver, I got error:
> > **********
> >Error:[-1032] [] "[Microsoft][ODBC Microsoft Access 97 Driver] The
> >Microsoft Jet database engine cannot open the file '(unknown)'. It is
> >already opened exclusively by
> >another user, or you need permission to view its data."
> > ************
> >
> >could you please give some clue so I can fix the problem>
> >
> >Thank you.
> >
> >Qinqiang
> >
> >
> >
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 18:33:59 +0100
From: "Sandwell" <JK@sandwell98.free-online.co.uk>
Subject: Please Help Me :-)))
Message-Id: <nl4R2.45$n_2.63@stones>
Dear All,
Please could you help me, I am currently programming my second program using
Delphi, with no programming experience before, I would be grateful if you
could answer some of my questions. Reply in this newsgroup or by email
(just click reply, none of that NOSPAM thing!!)
1. My application uses drag and drop, all the form accepts drag and drop (in
the create method) How do you make a memo pad do something when it gets a
file dropped on it?
2. How do you get the program to look and load Microsoft Internet Explorer
(any version). I also need the same for Netscape.
3. Are there any simple components to make Walk though Wizards, Delphi 2?
4. Now here the hard one.....I uses a standard open dialog. The drag and
drop writes command lines to a memo pad. To there a component or a way to
to make the program open the command line(s) as it would do in the open
dialog. I wish to uses mutable lines.
Thank-You for you help in advance, please could you help in any shape or
form.
Graeme Sandwell....
------------------------------
Date: Thu, 15 Apr 1999 11:02:36 +0200
From: Thorsten Dittmar <thorsten.dittmar@debitel.net>
Subject: Re: Please Help Me :-)))
Message-Id: <3715AB2C.F23E054E@debitel.net>
1) Go to http://www.delphipages.com and look for a TDropFiles component
(may also be found on www.torry.ru). If you place it on your form, you
get an event when file(s) are dropped on the form.
2) ?
3) Download RX Library from the pages mentioned above. There's a
component that helps you create wizards. And even more *VERY GOOD*
components!
4) Well...er...sure!
Thorsten
Sandwell wrote:
>
> Dear All,
>
> Please could you help me, I am currently programming my second program using
> Delphi, with no programming experience before, I would be grateful if you
> could answer some of my questions. Reply in this newsgroup or by email
> (just click reply, none of that NOSPAM thing!!)
>
> 1. My application uses drag and drop, all the form accepts drag and drop (in
> the create method) How do you make a memo pad do something when it gets a
> file dropped on it?
>
> 2. How do you get the program to look and load Microsoft Internet Explorer
> (any version). I also need the same for Netscape.
>
> 3. Are there any simple components to make Walk though Wizards, Delphi 2?
>
> 4. Now here the hard one.....I uses a standard open dialog. The drag and
> drop writes command lines to a memo pad. To there a component or a way to
> to make the program open the command line(s) as it would do in the open
> dialog. I wish to uses mutable lines.
>
> Thank-You for you help in advance, please could you help in any shape or
> form.
>
> Graeme Sandwell....
------------------------------
Date: Thu, 15 Apr 1999 09:33:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Please Help Me :-)))
Message-Id: <3719b244.8325970@news.skynet.be>
Sandwell wrote:
>I am currently programming my second program using
>Delphi, with no programming experience before
Please remove "comp.lang.perl.misc" from any follow-ups to this post.
Thank you.
Bart.
------------------------------
Date: 15 Apr 1999 09:10:51 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <37159f0b.0@newsread3.dircon.co.uk>
Abigail <abigail@fnx.com> wrote:
> Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMLII September
> MCMXCIII in <URL:news:3714aa2f.0@newsread3.dircon.co.uk>:
> $$
> $$ fatmog:~$ od -c test.blah
> $$ 0000000 t h i s \r \n i s \r \n a \r \n t e
> $$ 0000020 s t \r \n i s n t \r \n i t \r \n
> $$ 0000036
> $$
> $$ test.blah was created in DOS and then FTP'd in binary mode.
>
> That's very misleading. What byte, or byteset, \n is depends from platform
> to platform. Whenever I see someone write '\r\n', I wonder if they know
> what they are talking about. They probably mean CR LF, but '\r\n' is only
> a CR LF on certain systems.
>
Sure. But if I had put the output of 'od -b' :
0000000 164 150 151 163 015 012 151 163 040 015 012 141 015 012 164 145
0000020 163 164 015 012 151 163 156 164 015 012 151 164 015 012
0000036
*I* would have known what there was what is referred to as \r\n and so
would have (I hope) most people but it would have been an unnecessary
obfuscation when I would have hoped that it was clear that I was talking
about a file that was created on DOS and transferred to Unix.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 15 Apr 1999 09:38:41 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Randomize Please Help
Message-Id: <3715a591.0@newsread3.dircon.co.uk>
News <dixonmat@pouch.com> wrote:
> I want to randomly display a table how would I do that in perl
> I already have the shopping cart system running, but I want it to display a
> random table almost like a banner.
What kind of table - a dinner table ? You can cut out the nice pictures
from the Habitat or Ikea catalogue and stick them on your monitor.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 15 Apr 1999 09:20:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: removing ^M, ^B and other wierd chars
Message-Id: <3715acf5.6966796@news.skynet.be>
kal@valistech.com wrote:
>If I ftp'd text files (in ascii mode) that contain the above characters,
>how do I get rid of them?
>what regex would clean them off.
Depends on if you really want to. :-)
Anyway, this gets rid of any control characters except tab and newlines:
tr/\n\t\000-\037/\n\t/d;
So why wouldn't you want? Because backspace (ctrl-H, chr(8), "\010") is
often used to get some character formatting change.
"a\010a" bold "a"
"_\010a" underlined "a"
"a\010_" underlined "a"
So my guess is that you be very careful when just stripping out the
control characters. You might end up with "aa", "_a" or "a_" instead of
just plain "a". Try something along these lines (before getting rid of
the remaining control characters as above):
s/_\010(.)|(.)\010_|(.)\010\3/$+/g;
Bart.
------------------------------
Date: Thu, 15 Apr 1999 07:58:38 GMT
From: ajeet@my-dejanews.com
Subject: Re: SQL and the ODBC module
Message-Id: <7f467c$vc3$1@nnrp1.dejanews.com>
What's the Error mesg?
The format is ok..can you chk you datatypes? are they conflicting?
I somehow get the idea that you might want to UPDATE and not INSERT...
more details?
In article <7f3us7$ojh$1@nnrp1.dejanews.com>,
leejola@my-dejanews.com wrote:
> I am using the ODBC module to interface with and Access 97 database for a
> web-based project. I need to use an "INSERT INTO" statement to append a new
> record to the database. I was using the statement shown below and yet still it
> doesn't work. Any assistance given to help solve this problem would be greatly
> appreciated.
>
> $db->Sql("INSERT INTO tblPayeeList (Payee, Address, City, PayeeDescr, AcctNum,
> Phone) VALUES ('$PayeeName', '$Address', '$City', '$PayeeType', '$AccountNum',
> '$Phone') WHERE Username = '$LoginName'");
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 15 Apr 1999 09:29:26 +0000
From: Michael Cameron <Michael.Cameron@no.spam.technologist.com>
To: Loans2001 <loans2001@aol.com>
Subject: Re: Trying to get the cgi script to print the date last updated rates!
Message-Id: <3715B176.38BD7530@no.spam.technologist.com>
Loans2001 wrote:
<snip>
>
> This code prints a "1" in front of the date ie 4-18-99 so 14/18/99
>
> Why does it print a silly "1"?
>
<snip>
I copied and modified your code as follows:
<----Begin-------->
#!/usr/bin/perl
$mod_time = (stat("test.pl"))[9];
($min,$hour,$day,$mon,$yr) = (localtime($mod_time))[1..5];
$yr += 1900;
$outstr = "3/$day/$yr at ".sprintf("%.2d",$hour).':'.sprintf("%.2d", $min);
print $outstr;
print "\n";
<----End--------->
and get no 1 am using perl 5.004_04 built for i386-linux. eg:
3/15/1999 at 10:23
Did you post the complete script?
HTH
Michael
PS Don't forget to add 1 to the month if you are using that value (Jan=0).
------------------------------
Date: Thu, 15 Apr 1999 08:16:57 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Unitialized var errors & -w flag
Message-Id: <37179aa5.2279717@news.skynet.be>
Gordon Shannon wrote:
>A point of philosophy. I disagree with the way Perl acts when
>-w is on, with regard to unitialized variables. Can anyone
>change my mind?
> % #Test B:
> % perl -we 'my $foo; print "OK\n" if !$foo'
> OK
>
> It seems inconsistent.
Perl uses the undefined value for a boolean flag a LOT. Just one
example:
while(<>) {
...
}
which loops until $_ gets *undefined*. You don't really want
Are you going to have to change code *everywhere*?
A boolean false is documented to be "undefined, the empty string or
zero". Actually, that list is not complete, it includes the string "0"
too, which is not a full memeber of this list.
But anyway, undefined is a valid boolean flag. No reason for a warning,
it is legitimite use. BTW you may *assign* an undefined value to a
variable without warnings:
undef $x;
$y = $x; # no warning here
If you compare an undefined value to a number (or a string), you convert
it to anumber first. That is no longer legitimite use: you get this
particular warning if and only when converting the undefined value
either to a string, or to a number.
If you really want to complain about inconsistency, try this:
undef $x;
$x += 3; # no warning!
print $x; # prints "3"
But, here it's the large existing code base, and difficult coding around
the warnings, that would make warnings impractical.
Bart.
------------------------------
Date: Thu, 15 Apr 1999 09:28:17 GMT
From: jbritain@home.com (Jim Britain)
Subject: want regex to set a value in place of a procedure
Message-Id: <3715af87.169375173@news>
I got tired of trying to figure out the regular expression to
accomplish what this does... but, this works to do what I want.
I want to clean up hand keyed input that may contain garbage
characters. The only valid results are: empty string, or return a
single character in the set [0-5].
There's got to be a better way.. but again, this works..
if ($value =~ s/.*([0-5]).*/$1/){}else{$value=''}
------------------------------
Date: Thu, 15 Apr 1999 08:09:43 GMT
From: ajeet@my-dejanews.com
Subject: Re: Would anyone care to teach me perl?
Message-Id: <7f46s4$vq8$1@nnrp1.dejanews.com>
Hi Jeff!
Hope u dun mind..just added some more perl to prevent our fren from
getting caught in an infinite loop. heehee
That's some more perl for you!
> > Would anyone care to teach me perl? Just with email though.
>
> Sure. First lesson:
>
> 1) open a terminal window; $flag = 0;
> 2) type: man perl; $flag=1;
> 3) if that doesn't work, try: perldoc perl; $flag=1;
> 4) if that doesn't work, try: which perl; $flag=1;
> 5) if that doesn't work, spit "you don't have perl";
> 6) if $flag=0 {download perl;} else {exit;}
> 7) go to step 1
>
> --
> Jeff Pinyan (jeffp@crusoe.net)
> www.crusoe.net/~jeffp
>
> Crusoe Communications, Inc.
> 732-728-9800
> www.crusoe.net
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5389
**************************************