[18507] in Perl-Users-Digest
Perl-Users Digest, Issue: 675 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 11 14:06:14 2001
Date: Wed, 11 Apr 2001 11:05:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987012325-v10-i675@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 11 Apr 2001 Volume: 10 Number: 675
Today's topics:
Re: [OT] Re: password encryption <SiStie@nuclear-network.com>
A CGI question <SiStie@nuclear-network.com>
Re: A CGI question (Logan Shaw)
Re: A CGI question <flavell@mail.cern.ch>
Re: A CGI question nobull@mail.com
CGI-ODBC Problem <sg@loralskynet.com>
Re: CGI-ODBC Problem nobull@mail.com
Re: CGI.PM and Forms <artd@speakeasy.net>
Re: CGI.PM and Forms <artd@speakeasy.net>
Re: CGI.PM and Forms <bart.lateur@skynet.be>
Re: CGI.pm V. Here Docs . . . <uri@sysarch.com>
Re: complaint about moderation of this group <iltzu@sci.invalid>
Re: complaint about moderation of this group <hartleh1@westat.com>
Re: complaint about moderation of this group <camerond@mail.uca.edu>
Re: converting UTF8 to 8bit character <c.manley@_REMOVE_THIS_chello.nl>
Re: converting UTF8 to 8bit character <b_nospam_ill.kemp@wire2.com>
Re: converting UTF8 to 8bit character <c.manley@_REMOVE_THIS_chello.nl>
Copying a ColdFusion site <robr@vitesse.com>
DBD::DB2 and positioned updates? <shah@typhoon.xnet.com>
Re: DBD::DB2 and positioned updates? <davids@N_O_S_P_A_M.ca.ibm.com>
Re: DBD::DB2 and positioned updates? <shah@typhoon.xnet.com>
Re: Deleting one line from a file (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 11 Apr 2001 16:40:08 +0200
From: Simon Stiefel <SiStie@nuclear-network.com>
Subject: Re: [OT] Re: password encryption
Message-Id: <Pine.LNX.4.31.0104111633490.2205-100000@server.stiefel.priv>
On Sat, 7 Apr 2001, Steven Smolinski wrote:
Hi all,
> [
> First of all, DO NOT STEALTH CC ME AGAIN!
> Yes, I meant to shout that.
> ]
Sorry about that. I don't know which mail client you're using.
I use Pine and if you want to reply a newsgroup posting you have to choose
if you want to reply personaly (that whats happened to you) or if you want
to reply to the newsgroup.
I don't post to newsgroups very often and so I've pushed the wrong key.
So again, Sorry about that.
I hope it will not happen again. ;-)
> Steve
Mit freundlichen Gr=FC=DFen, .~. Open Minds.
with best regards /V\ Open Sources.
// \\ Open Future!
Simon Stiefel /( )\_ I N U X
^ ~ ^
--=20
|Simon Stiefel | Zwerbachstrasse 17 | 72555 Metzingen-Glems | Germany |
|SimonStiefel@nuclear-network.com | http://www.nuclear-network.com |
|ICQ#: 20196644 | phone: +49(0)7123/379070 | fax: +49(0)179/335990106 |
|Tux#: 114751 | PingoS - Linux-User helfen Schulen | Powered by LiNUX |
------------------------------
Date: Wed, 11 Apr 2001 18:37:23 +0200
From: Simon Stiefel <SiStie@nuclear-network.com>
Subject: A CGI question
Message-Id: <Pine.LNX.4.31.0104111821170.2832-100000@server.stiefel.priv>
Hi,
first of all, I'm more or less a newbie in CGI. :)
I have to realize the following scenario:
In a table which was created with a 'for'-function (don't know the english
expression :)) there is a checkbox in every row. I don't know the
exact number of rows because it is (of course) dynamically
generated.
Every checkbox has the name "entry_X" while X is the number beginning with
1. The value is "1" if it is checked.
For example, when I click on 2 checkboxes the new URL will be the
following:
http://www.stiefel.priv/cgi-bin/pos/pos.cgi?entry_1=3D1&entry_7=3D1&action=
=3Ddo+smthg
Now my problem:
Every checked checkbox will appear as "entry_X=3D1" in the URL.
How can I fetch them in variables??
Do I have to create for every entry a new variable? When yes, how can I do
that, because there could be 200 (or more) "entry_X"es?
I hope everybody can understand my question.
Mit freundlichen Gr=FC=DFen, .~. Open Minds.
with best regards /V\ Open Sources.
// \\ Open Future!
Simon Stiefel /( )\_ I N U X
^ ~ ^
--=20
|Simon Stiefel | Zwerbachstrasse 17 | 72555 Metzingen-Glems | Germany |
|SimonStiefel@nuclear-network.com | http://www.nuclear-network.com |
|ICQ#: 20196644 | phone: +49(0)7123/379070 | fax: +49(0)179/335990106 |
|Tux#: 114751 | PingoS - Linux-User helfen Schulen | Powered by LiNUX |
------------------------------
Date: 11 Apr 2001 12:08:46 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: A CGI question
Message-Id: <9b232u$t31$1@charity.cs.utexas.edu>
In article <Pine.LNX.4.31.0104111821170.2832-100000@server.stiefel.priv>,
Simon Stiefel <SimonStiefel@nuclear-network.com> wrote:
>Every checked checkbox will appear as "entry_X=3D1" in the URL.
>How can I fetch them in variables??
The best thing would be to fetch them all into one variable. That's
exactly what hashes (a/k/a associative arrays) are good for: storing
things by name, without using a separate variable for each one.
>Do I have to create for every entry a new variable? When yes, how can I do
>that, because there could be 200 (or more) "entry_X"es?
Are you using the "CGI" module? If so, you can just fetch all the
parameters into a hash, like this:
$query = new CGI;
%params = $query->Vars;
Now, $params{entry_1} will contain whatever "entry_1" was set to, and
so on. You can even get a list of which "entry_X" parameters
were passed to your CGI with this:
@entries = grep (/^entry_\d+$/, keys %params);
Of course, there may be other ways to get this information (from
another parameter, for example).
"perldoc CGI" for more info.
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Wed, 11 Apr 2001 19:03:35 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: A CGI question
Message-Id: <Pine.LNX.4.30.0104111848280.15082-100000@lxplus003.cern.ch>
On Wed, 11 Apr 2001, Simon Stiefel wrote:
> first of all, I'm more or less a newbie in CGI. :)
And second, it seems that you haven't been reading the
comp.lang.perl.misc Perl language group, so you haven't noticed that
CGI questions are generally unwelcome, except when a perl language
issue is the main problem.
> In a table which was created with a 'for'-function (don't know the english
> expression :)) there is a checkbox in every row.
Dann halte ich de.comm.infosystems.www.authoring.cgi fuer
eher angebracht...
> Every checked checkbox will appear as "entry_X=1" in the URL.
> How can I fetch them in variables??
The Perl answer has to be "CGI.pm".
> Do I have to create for every entry a new variable?
Use hashes. It's a very bad idea to try to construct the names of
variables by using input data.
Now, was this really a question about CGI? In the end it turned into
a question (a) about Perl (OK here) and (b) about how to use CGI.pm
(not really OK here - better on a CGI programming group - or just
possibly on c.l.perl.modules, I think). What say the regulars?
viel Spass noch.
------------------------------
Date: 11 Apr 2001 18:26:48 +0100
From: nobull@mail.com
Subject: Re: A CGI question
Message-Id: <u93dbf8i07.fsf@wcl-l.bham.ac.uk>
Simon Stiefel <SiStie@nuclear-network.com> writes:
> I have to realize the following scenario:
>
> In a table which was created with a 'for'-function (don't know the english
> expression :)) there is a checkbox in every row. I don't know the
> exact number of rows because it is (of course) dynamically
> generated.
> Every checkbox has the name "entry_X" while X is the number beginning with
> 1. The value is "1" if it is checked.
Probably more efficient to change that to:
Every checkbox has the name "entry". The value is X if it is checked
where X is the number beginning with 1.
> http://www.stiefel.priv/cgi-bin/pos/pos.cgi?entry_1=1&entry_7=1&action=
> =do+smthg
That becomes:
http://www.stiefel.priv/cgi-bin/pos/pos.cgi?entry=1&entry=7&action=
do+smthg
> How can I fetch them in variables??
Following my advice you can simply set a single array variable to the
list of checked boxes with:
my @checked_boxes = param('entry');
[ Note: I'm assuming you are using the standard CGI module rather
than trying to make your own flint-axes ]
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 11 Apr 2001 11:34:14 -0400
From: Stephan Gross <sg@loralskynet.com>
Subject: CGI-ODBC Problem
Message-Id: <2au8dtghcgcudv9a557feti58urqi09o4u@4ax.com>
I have a perl script that uses ODBC to connect to a database. When I
run the file as a CGI program from a browser, it can no longer
connect. Any ideas?
------------------------------
Date: 11 Apr 2001 17:58:02 +0100
From: nobull@mail.com
Subject: Re: CGI-ODBC Problem
Message-Id: <u9d7aj8jc5.fsf@wcl-l.bham.ac.uk>
Stephan Gross <sg@loralskynet.com> writes:
> I have a perl script that uses ODBC to connect to a database. When I
> run the file as a CGI program from a browser, it can no longer
> connect. Any ideas?
Sounds like a user identity/permissions issue with the DSN.
Almost certainly nothing to do with Perl, it would likely be the same
in any language.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 11 Apr 2001 11:14:32 -0400
From: "speakeasy" <artd@speakeasy.net>
Subject: Re: CGI.PM and Forms
Message-Id: <rA_A6.3127$lJ2.1343098@e3500-chi1.usenetserver.com>
Below is the code snippets from my script... some names may have changed
<< Begin code
print "Add the following email addresses to " ,
Some_Module::LDAP_Get_CN($LDAP,$List_DN) , "<br>";
print "<b>Separate each email by a comma, space or new line</b>";
print "<form method='post' name='$Form_Values{'form'}{'name'}'
action='/cgi-bin/distrolist.pl'>";
print "<table border='0'>\n";
print "<TEXTAREA NAME='$Form_Values{'addresses'}{'fieldname'}' COLS='30'
ROWS='10'></TEXTAREA>";
print "<input type='hidden' name='list_dn' value='$List_DN'>";
print "</table>";
print "<input type='submit' name='script_action' value='Add Email Only
Members'> <input type='reset' value='reset'>";
print "</form>";
<< End Code
Once I change it to GET it works fine (haven't tested with extremem numbers
of lines, but it does accept the 17 original that were causing this to
croak).
"Bryan Coon" <bcoon@sequenom.com> wrote in message
news:3AD38CBE.B46D2407@sequenom.com...
> Can you post the code so we can take a look at it? There is almost
certainly an
> error in your script.
>
> Bryan
>
> speakeasy wrote:
>
> > Well GET method works, but POST does not... I though POST allowed for
more
> > data... hmm....
> >
> > "John Joseph Trammell" <trammell@bayazid.hypersloth.invalid> wrote in
> > message news:slrn9d6lfn.eoh.trammell@bayazid.hypersloth.net...
> > > On Tue, 10 Apr 2001 14:23:03 -0400, speakeasy <artd@speakeasy.net>
wrote:
> > > > Are there memory restrictions applied to CGI.pm and forms? My form
will
> > not
> > > > submit a textarea that has more than 10 lines, the request
eventually
> > times
> > > > out, and the perl process hangs in memory on the server... I have
the
> > same
> > > > problem with submitting a form with more than 5 checkboxes
checked...
> > Any
> > > > ideas? I am using ActivePerl on Windows 2000 IIS 5.... Any
insights
> > would
> > > > be greatly appreciated...
> > >
> > > I've used CGI.pm to process forms much more complicated than
> > > that. More than likely you are looking at a server or coding
> > > problem. Do you have access to the server logs? They're
> > > likely to shed some light.
> > >
> > > --
> > > According to the Genesis account, the tower of Babel was man's second
> > > major engineering undertaking, after Noah's ark. Babel was the first
> > > engineering fiasco.
> > > - F. Brooks, _The Mythical Man-Month_
>
------------------------------
Date: Wed, 11 Apr 2001 11:29:26 -0400
From: "speakeasy" <artd@speakeasy.net>
Subject: Re: CGI.PM and Forms
Message-Id: <xO_A6.3134$lJ2.1356241@e3500-chi1.usenetserver.com>
This was my first take at it:
# Debug code:
print
start_form(-method=>"post", -name=>"$Form_Values{'form'}{'name'}", -action=>
"/cgi-bin/distrolist.pl"), "\n";
print
textarea(-name=>"$Form_Values{'addresses'}{'fieldname'}", -cols=>"30", -rows
=>"10"), "<br>\n";
print hidden(-name=>"list_dn", -value=>"$List_DN"), "<br>\n";
print submit(-name=>"script_action", -value=>"Add Email Only Members"),
"\n";
print end_form();
# Here is the form handling code:
my $List_DN = param('list_dn') || '';
my @Addresses = param('addresses') or ();
&Add_Email_To_List($VCookie,$LDAP,$List_DN,\@Addresses);
For debug, I've removed the sub, and added a print @Addresses, which hangs
as well...
I guess it does look like a server issue....
"Bryan Coon" <bcoon@sequenom.com> wrote in message
news:3AD38CBE.B46D2407@sequenom.com...
> Can you post the code so we can take a look at it? There is almost
certainly an
> error in your script.
>
> Bryan
>
> speakeasy wrote:
>
> > Well GET method works, but POST does not... I though POST allowed for
more
> > data... hmm....
> >
> > "John Joseph Trammell" <trammell@bayazid.hypersloth.invalid> wrote in
> > message news:slrn9d6lfn.eoh.trammell@bayazid.hypersloth.net...
> > > On Tue, 10 Apr 2001 14:23:03 -0400, speakeasy <artd@speakeasy.net>
wrote:
> > > > Are there memory restrictions applied to CGI.pm and forms? My form
will
> > not
> > > > submit a textarea that has more than 10 lines, the request
eventually
> > times
> > > > out, and the perl process hangs in memory on the server... I have
the
> > same
> > > > problem with submitting a form with more than 5 checkboxes
checked...
> > Any
> > > > ideas? I am using ActivePerl on Windows 2000 IIS 5.... Any
insights
> > would
> > > > be greatly appreciated...
> > >
> > > I've used CGI.pm to process forms much more complicated than
> > > that. More than likely you are looking at a server or coding
> > > problem. Do you have access to the server logs? They're
> > > likely to shed some light.
> > >
> > > --
> > > According to the Genesis account, the tower of Babel was man's second
> > > major engineering undertaking, after Noah's ark. Babel was the first
> > > engineering fiasco.
> > > - F. Brooks, _The Mythical Man-Month_
>
------------------------------
Date: Wed, 11 Apr 2001 16:53:20 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CGI.PM and Forms
Message-Id: <6039dt8scmaes1hlfhu7hm61c2leh18hr3@4ax.com>
speakeasy wrote:
>Once I change it to GET it works fine (haven't tested with extremem numbers
>of lines, but it does accept the 17 original that were causing this to
>croak).
Try a variation on this script that simply prints out a report on the
parameters in html format. See what difference you see between GET and
POST.
--
Bart.
------------------------------
Date: Wed, 11 Apr 2001 17:37:05 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: CGI.pm V. Here Docs . . .
Message-Id: <x7u23vnxrx.fsf@home.sysarch.com>
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> According to A_Geekette <moiraine@qwest.net>:
AS> [...]
>> I hate to leave you hanging like this, but if I write any more I'll get
>> criticized
>> by someone.
AS> If you don't want to be criticized, don't post. No-one is immune.
AS> Claiming that you can't write for fear of being criticized is ridiculous.
>> I speak bluntly and to the point; some people have a problem with that.
AS> Oh? You have detected a new trend in clpm. Who, in particular,
AS> would that be?
yeah, we are all a bunch of shy wallflowers who never say a cross word
at anyone. the whole perl community is so warm and loving. all posts
here are welcomed equally and are all deserving of being read by all who
wander in. newbie can learn perl from anyone they choose to learn from.
:)
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: 11 Apr 2001 15:43:48 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: complaint about moderation of this group
Message-Id: <987003395.24594@itz.pp.sci.fi>
In article <Pine.LNX.4.30.0104111314210.21895-100000@lxplus003.cern.ch>, Alan J. Flavell wrote:
>On 11 Apr 2001, Ilmari Karonen wrote:
>
>> This suggests to me a potential course of action -- answer all the CGI
>> questions posted to this group *in ciwac*.
>
>That's a good idea. How about a trivial followup here saying nothing
>more than that the question is being answered in ciwac, and a separate
>followup posted only to ciwac?
Hmm.. maybe. Those extra posts would still be noise, but on the other
hand they'd provide pointers to the appropriate group.
Now that I think about it, I suppose a note in clpm would be useful.
But only one per thread even if several people reply, please.
>> (Before someone mentions it: No, you can't crosspost to ciwac because
>> the moderator bot doesn't let you.
>
>Yes, that's one of the most irritating features of the bot, since it
>prevents the use of the standard usenet technique of crossposting to
>set followups and keep both sets of readers aware of what's going on.
It *should* be possible to fix that. After all, there are perfectly
clear rules on how crossposted articles should be approved, and they
could easily be implemented by a script.
And it could still limit the number of crossposted groups, if that's
considered a feature.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: Wed, 11 Apr 2001 13:22:12 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: complaint about moderation of this group
Message-Id: <3AD492C4.3F1E8E95@westat.com>
Mark Jason Dominus wrote:
>
> In article <3AD35A6E.29F6AF0D@fnal.gov>,
> David J. Ritchie <ritchie@fnal.gov> wrote:
> >A name that would put off all but the bravest newbies might
> >help. E.g.,:
> >
> >comp.lang.perl.advancedtopics
>
> That's a nice theory, but it has been tried, and what happens is that
> the beginners think "Ah! That's the newsgroup where all the experts
> hang out. Just the people I need to help me solve me problem!"
Perhaps:
comp.lang.perl.misc_but_not_cgi_and_read_the_FAQ_first
--
Henry Hartley
------------------------------
Date: Wed, 11 Apr 2001 12:45:44 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: complaint about moderation of this group
Message-Id: <3AD49848.FDD4FEA4@mail.uca.edu>
Henry Hartley wrote:
>
> Mark Jason Dominus wrote:
> >
> > In article <3AD35A6E.29F6AF0D@fnal.gov>,
> > David J. Ritchie <ritchie@fnal.gov> wrote:
> > >A name that would put off all but the bravest newbies might
> > >help. E.g.,:
> > >
> > >comp.lang.perl.advancedtopics
> >
> > That's a nice theory, but it has been tried, and what happens is that
> > the beginners think "Ah! That's the newsgroup where all the experts
> > hang out. Just the people I need to help me solve me problem!"
>
> Perhaps:
>
> comp.lang.perl.misc_but_not _cgi_and_read_the_FAQ_first
^^^^^^^^
_generic
>
> --
> Henry Hartley
As an aside (actually this whole thread is an aside), I haven't ever
found too many "moderates" on this newsgroup, on either side. But, that
shows that we think it's important.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Wed, 11 Apr 2001 16:46:05 +0200
From: Craig Manley <c.manley@_REMOVE_THIS_chello.nl>
Subject: Re: converting UTF8 to 8bit character
Message-Id: <3AD46E2D.21B9CEB7@_REMOVE_THIS_chello.nl>
Hi,
I'm a collegue of Sven. We have to use Perl 5.0 (ISP refuses to
upgrade). So were stuck. Below is the quick and dirty solution we just
made (by trial and error) that seems to work with our input data
(translating from UTF-8 to ISO-8859-1 code page). If anybody has a
better and solid conversion function for Perl < 5.6 then we'ld like to
know about it for future use.
my $s = 'Brazilië, Kimi Räikkönen';
print "$s\n";
$s =~ s/\xC3(.)/chr(ord($1)+64)/egs;
print "$s\n";
open(F,'>test.out');
print F "$s\n";
close(F);
-Craig Manley.
Sven Franke wrote:
>
> Hi,
> I need to translate UTF8 to 8bit character. I use this function (see under),
> but I get an error.
> Does anybody know why this is?
> (strange thing...on another machine this is running ok....)
>
> sub UTF8toChar {
> my $s = shift;
> $s =~ tr/\0-\x{ff}//UC;
> return $s;
> }
>
> Illegal hex digit ignored at ../lib/F1.pm line 1161.
> Bareword found where operator expected at ../lib/F1.pm line 1161, near
> "tr/\0-\x{ff}//UC"
> Bareword "UC" not allowed while "strict subs" in use at ../lib/F1.pm line
> 1161.
> syntax error at ../lib/F1.pm line 1161, near "tr/\0-\x{ff}//UC"
> BEGIN failed--compilation aborted at ./simple.pl line 22.
>
> Sven Franke
------------------------------
Date: Wed, 11 Apr 2001 17:46:06 +0100
From: "W K" <b_nospam_ill.kemp@wire2.com>
Subject: Re: converting UTF8 to 8bit character
Message-Id: <987007806.27894.0.nnrp-10.c3ad6974@news.demon.co.uk>
>(translating from UTF-8 to ISO-8859-1 code page). If anybody has a
>better and solid conversion function for Perl < 5.6 then we'ld like to
>know about it for future use.
>
>my $s = 'Brazilië, Kimi Räikkönen';
>print "$s\n";
>$s =~ s/\xC3(.)/chr(ord($1)+64)/egs;
>print "$s\n";
>open(F,'>test.out');
>print F "$s\n";
>close(F);
>
>-Craig Manley.
Actually a second helpful line would be
$s =~ s/\xC2(.)/chr(ord($1)-64)/egs;
Which would translate more characters, (actually the full latin-1 stuff (I
think - don't jump on me))
It should work fine if the string is utf-8 and has only ISO-8859-1 (...some
windows characters aren't)
------------------------------
Date: Wed, 11 Apr 2001 18:58:45 +0200
From: Craig Manley <c.manley@_REMOVE_THIS_chello.nl>
Subject: Re: converting UTF8 to 8bit character
Message-Id: <3AD48D45.BEE7E8DA@_REMOVE_THIS_chello.nl>
FYI:
We found the solution using Perl < v5.6:
use Unicode::String;
Sven Franke wrote:
>
> Hi,
> I need to translate UTF8 to 8bit character. I use this function (see under),
> but I get an error.
> Does anybody know why this is?
> (strange thing...on another machine this is running ok....)
>
> sub UTF8toChar {
> my $s = shift;
> $s =~ tr/\0-\x{ff}//UC;
> return $s;
> }
>
> Illegal hex digit ignored at ../lib/F1.pm line 1161.
> Bareword found where operator expected at ../lib/F1.pm line 1161, near
> "tr/\0-\x{ff}//UC"
> Bareword "UC" not allowed while "strict subs" in use at ../lib/F1.pm line
> 1161.
> syntax error at ../lib/F1.pm line 1161, near "tr/\0-\x{ff}//UC"
> BEGIN failed--compilation aborted at ./simple.pl line 22.
>
> Sven Franke
------------------------------
Date: Wed, 11 Apr 2001 11:10:03 -0600
From: Rob Root <robr@vitesse.com>
Subject: Copying a ColdFusion site
Message-Id: <3AD48FEB.F7FABE09@vitesse.com>
HI,
I need to copy a site (ours) built with ColdFusion to regular HTML. Is
there a perl module to help?
Cheers,
Rob Root
Vitesse Semiconductor Corp.
robr@vitesse.com
------------------------------
Date: Wed, 11 Apr 2001 16:25:48 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: DBD::DB2 and positioned updates?
Message-Id: <9b20ic$bab$1@flood.xnet.com>
Folks,
I am using perl DBI/DBD to perform update in DB2 database. The perl DBI book
mentions that positioned update are supported in DBI::DB2, but
I cannot figure out how to use it.
$SqlStmt = "SELECT
TIMESHEET.DATE,
RTRIM(TIMESHEET.EMP_ID),
RTRIM(TIMESHEET.PROJECT_ID),
RTRIM(TIMESHEET.TASK_ID),
RTRIM(PROJECT.CONTRACT_ID),
TIMESHEET.RATE
FROM BILLING.TIMESHEET,
BILLING.PROJECT,
BILLING.CONTRACT
WHERE
TIMESHEET.DATE <= ?
AND TIMESHEET.ADJ_ID = ''
AND TIMESHEET.RATE != 0
AND TIMESHEET.PROJECT_ID = PROJECT.PROJECT_ID
AND PROJECT.CONTRACT_ID = CONTRACT.CONTRACT_ID
;";
$StmtHandle = $DbHandle->prepare($SqlStmt);
if (! $StmtHandle)
{
print STDERR "$ExeName: ERROR getting info from timesheet table.\n";
ExitProc(1);
}
my($MyCursor) = $StmtHandle->{CursorName};
print "MyCursor = $MyCursor\n";
$UpdtStmt="UPDATE BILLING.TIMESHEET
SET RATE = ?
WHERE CURRENT OF $MyCursor
;";
$UpdtStmtHandle = $DbHandle->prepare($UpdtStmt);
if (! $UpdtStmt)
{
print STDERR "$ExeName: ERROR Cannot prepare update statement.\n";
ExitProc(1);
}
$StmtHandle->execute($EndDate);
while loop for $StmtHandle->fetchrow()
{
Calculate $NewRate
$UpdtStmtHandle->execute($NewRate);
$UpdtStmtHandle->finish;
}
# Release database resources.
$StmtHandle->finish;
If I execute the above code, the cursorname is set, but I get following
error when I execute $UpdtStmtHandle:
MyCursor = SQLCURCS297
DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/6000] SQL0727N An error
occurred during implicit system action type "2". Information returned for
the error includes SQLCODE "-510", SQLSTATE "42828" and message tokens "".
SQLSTATE=56098
If I add the update clause as follows:
$SqlStmt = "SELECT
TIMESHEET.DATE,
RTRIM(TIMESHEET.EMP_ID),
RTRIM(TIMESHEET.PROJECT_ID),
RTRIM(TIMESHEET.TASK_ID),
RTRIM(PROJECT.CONTRACT_ID),
TIMESHEET.RATE
FROM BILLING.TIMESHEET,
BILLING.PROJECT,
BILLING.CONTRACT
WHERE
TIMESHEET.DATE <= ?
AND TIMESHEET.ADJ_ID = ''
AND TIMESHEET.RATE != 0
AND TIMESHEET.PROJECT_ID = PROJECT.PROJECT_ID
AND PROJECT.CONTRACT_ID = CONTRACT.CONTRACT_ID
FOR UPDATE OF TIMESHEET.RATE
;";
If fails while setting the $MyCursor:
Describe failed during DBI::st=HASH(0x203e86b8)->FETCH(CursorName) at
./tstphase1.pl line 478.
How can I use positioned updates in DBD::DB2?
Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Wed, 11 Apr 2001 13:15:19 -0400
From: David Sharpe <davids@N_O_S_P_A_M.ca.ibm.com>
Subject: Re: DBD::DB2 and positioned updates?
Message-Id: <3AD49127.21843F43@N_O_S_P_A_M.ca.ibm.com>
Hi Hemant,
You cannot update a cursor with more than one table in the FROM clause. You have a
join record result: this is an intermediate result that does not actually exist in
the database. The database needs to update a record that actually exists in a base
table.
Hope this helps,
David.
Hemant Shah wrote:
> Folks,
>
> I am using perl DBI/DBD to perform update in DB2 database. The perl DBI book
> mentions that positioned update are supported in DBI::DB2, but
> I cannot figure out how to use it.
>
> $SqlStmt = "SELECT
> TIMESHEET.DATE,
> RTRIM(TIMESHEET.EMP_ID),
> RTRIM(TIMESHEET.PROJECT_ID),
> RTRIM(TIMESHEET.TASK_ID),
> RTRIM(PROJECT.CONTRACT_ID),
> TIMESHEET.RATE
> FROM BILLING.TIMESHEET,
> BILLING.PROJECT,
> BILLING.CONTRACT
> WHERE
> TIMESHEET.DATE <= ?
> AND TIMESHEET.ADJ_ID = ''
> AND TIMESHEET.RATE != 0
> AND TIMESHEET.PROJECT_ID = PROJECT.PROJECT_ID
> AND PROJECT.CONTRACT_ID = CONTRACT.CONTRACT_ID
> ;";
>
> $StmtHandle = $DbHandle->prepare($SqlStmt);
> if (! $StmtHandle)
> {
> print STDERR "$ExeName: ERROR getting info from timesheet table.\n";
> ExitProc(1);
> }
>
> my($MyCursor) = $StmtHandle->{CursorName};
> print "MyCursor = $MyCursor\n";
>
> $UpdtStmt="UPDATE BILLING.TIMESHEET
> SET RATE = ?
> WHERE CURRENT OF $MyCursor
> ;";
>
> $UpdtStmtHandle = $DbHandle->prepare($UpdtStmt);
> if (! $UpdtStmt)
> {
> print STDERR "$ExeName: ERROR Cannot prepare update statement.\n";
> ExitProc(1);
> }
>
> $StmtHandle->execute($EndDate);
>
> while loop for $StmtHandle->fetchrow()
> {
> Calculate $NewRate
>
> $UpdtStmtHandle->execute($NewRate);
> $UpdtStmtHandle->finish;
> }
>
> # Release database resources.
> $StmtHandle->finish;
>
> If I execute the above code, the cursorname is set, but I get following
> error when I execute $UpdtStmtHandle:
>
> MyCursor = SQLCURCS297
> DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/6000] SQL0727N An error
> occurred during implicit system action type "2". Information returned for
> the error includes SQLCODE "-510", SQLSTATE "42828" and message tokens "".
> SQLSTATE=56098
>
> If I add the update clause as follows:
>
> $SqlStmt = "SELECT
> TIMESHEET.DATE,
> RTRIM(TIMESHEET.EMP_ID),
> RTRIM(TIMESHEET.PROJECT_ID),
> RTRIM(TIMESHEET.TASK_ID),
> RTRIM(PROJECT.CONTRACT_ID),
> TIMESHEET.RATE
> FROM BILLING.TIMESHEET,
> BILLING.PROJECT,
> BILLING.CONTRACT
> WHERE
> TIMESHEET.DATE <= ?
> AND TIMESHEET.ADJ_ID = ''
> AND TIMESHEET.RATE != 0
> AND TIMESHEET.PROJECT_ID = PROJECT.PROJECT_ID
> AND PROJECT.CONTRACT_ID = CONTRACT.CONTRACT_ID
> FOR UPDATE OF TIMESHEET.RATE
> ;";
>
> If fails while setting the $MyCursor:
>
> Describe failed during DBI::st=HASH(0x203e86b8)->FETCH(CursorName) at
> ./tstphase1.pl line 478.
>
> How can I use positioned updates in DBD::DB2?
>
> Thanks.
>
> --
> Hemant Shah /"\ ASCII ribbon campaign
> E-mail: NoJunkMailshah@xnet.com \ / ---------------------
> X against HTML mail
> TO REPLY, REMOVE NoJunkMail / \ and postings
> FROM MY E-MAIL ADDRESS.
> -----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
> I haven't lost my mind, Above opinions are mine only.
> it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Wed, 11 Apr 2001 17:37:41 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: DBD::DB2 and positioned updates?
Message-Id: <9b24p5$d34$1@flood.xnet.com>
While stranded on information super highway David Sharpe wrote:
:)Hi Hemant,
:)You cannot update a cursor with more than one table in the FROM clause. You have a
:)join record result: this is an intermediate result that does not actually exist in
:)the database. The database needs to update a record that actually exists in a base
:)table.
:)
:)Hope this helps,
:)David.
:)
Thanks for the info. Now that I think about it, it makes sense.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Wed, 11 Apr 2001 07:01:06 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Deleting one line from a file
Message-Id: <slrn9d8ebi.7r1.tadmc@tadmc26.august.net>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>According to Chris Stith <mischief@velma.motion.net>:
>
>[...]
>
>> If what you want is what your code suggests you want, then this
>> ugly approach may work:
>>
>> my @array = (
>> 'foo',
>> 'bar',
>> );
>> while(<>) {
>> my $regex = join '|', @array;
>> print unless /$regex/;
>> }
>
>Why do you build the regex inside the loop? It doesn't change.
And, with
my @array = (
'foo',
'foobar',
'bar',
);
you will never match "foobar" due to the left-to-right nature
of the match (it will match "foo" before "foobar").
When you have elements that are prefixes of other elements, you
need to ensure that the longer alternatives are leftmost. This
once bit me to the tune of about 3 hours of troubleshooting.
An expedient way of eliminating that concern:
my $regex = join '|', reverse sort @array;
or
my $regex = join '|', sort {$b cmp $a} @array;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 675
**************************************