[18584] in Perl-Users-Digest
Perl-Users Digest, Issue: 752 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 24 09:05:50 2001
Date: Tue, 24 Apr 2001 06:05:07 -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: <988117506-v10-i752@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 24 Apr 2001 Volume: 10 Number: 752
Today's topics:
Re: 5.6.0 vs. 5.6.1 (was: Re: Issue with 5.004 to 5.6 u (H. Merijn Brand)
Re: Compression (to .zip/.gz) using system/backticks <webmaster@webdragon.unmunge.net>
Re: Compression (to .zip/.gz) using system/backticks <bart.lateur@skynet.be>
Re: Execute script at certain times? <ubl@schaffhausen.de>
fakessi <johnm@aiamail.com>
Re: fakessi (Bernard El-Hagin)
Re: Good editor for perl (Anno Siegel)
Help with a script <m-a-t-t@m-a-t-t-r-o-s-s.co.uk>
Re: How secure is this.... <errolbrown@hotmail.com>
Re: Idiom: the expression of a copied & substituted str <iltzu@sci.invalid>
Re: Issue with 5.004 to 5.6 upgrade - Use strict now au <iltzu@sci.invalid>
Re: Loading images to Oracle using DBI <ivob@euronet.nl>
Re: Problems with module PlPRC matthias@jaekle.net
Re: removing the \n from the data obtained from a text (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 24 Apr 2001 14:42:35 +0200
From: h.m.brand@hccnet.nl (H. Merijn Brand)
To: comp.lang.perl.misc
Subject: Re: 5.6.0 vs. 5.6.1 (was: Re: Issue with 5.004 to 5.6 upgrade)
Message-Id: <Xns908D95A31E03DMerijn@192.0.1.90>
tadmc@augustmail.com (Tad McClellan) wrote in
<slrn9e9p4b.obh.tadmc@tadmc26.august.net>:
>H. Merijn Brand <h.m.brand@hccnet.nl> wrote:
>> Bart Lateur <bart.lateur@skynet.be> wrote in
>
>>> But what exactly are these problems with 5.6.0, that hopefully got
>>> fixed in 5.6.1? And are there any new problems in 5.6.1 that people
>>> already know of?
>>
>> *lots of* memory leaks
>
>
>Err, which of the two questions is that answer for?
>
>Is it, "5.6.0's leaks were plugged in 5.6.1",
>or is it "5.6.1 has leaks"?
Sorrrrry, but 5.6.1 has *much leaks solved* that were still present in 5.6.0
I'd go for 5.6.1
--
H.Merijn Brand Amsterdam Perl Mongers
(http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.6.1, 5.7.1 & 623 on HP-UX 10.20 & 11.00, AIX
4.2
AIX 4.3, WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.022 &/| DBD-
Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
------------------------------
Date: 24 Apr 2001 10:44:04 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Compression (to .zip/.gz) using system/backticks
Message-Id: <9c3ldk$nlv$0@216.155.33.58>
In article <u9lmoqmyfx.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:
| > 2> I'd most likely want to use Mail::Mailer or MIME::Lite to send
| > the files as attachments, and in either case, it would require the host
| > to install those perl modules.
|
| Why? AFAIK these are flagged on CPAN as pure Perl except MIME::Base64
| which is 'h' meaning the non-Perl bit is optional.
EVEN if I installed them myself by drag-copying them over FTP, since I
can't get Telnet access there, it's still a royal pain to get them to
add the dang things to the web group because they're so paranoid about
things breaking. *eyerolls*
Ohhhhhhhhhh I've triiiiiied .. you dunno how much I've cried *snaps
fingers in rhythm for a second* Hey, that's catchy! :-D anyway, I've
tried explaining to them that I can do a dang LOCALized install of the
modules myself and they wouldn't impact any of their other users.. I'd
have better luck talking a wolf cub into putting his bonesies in my lap.
:-j
| > Since in 5 months, I haven't even been
| > able to get them to update some stock modules that I *know* have bugs in
| > them, and really *require* newer versions... this doesn't seem likely.
| >
| > SO, I'm considering calling out to the shell via system or backticks to
| > have it compress the two files into a .zip archive.
|
| I don't see how shelling out to a compression program is an
| alternative to the Mail modules.
It's not. However, making a 'download link' in the resultant preview
page of the CGI (which is essentially the links to the two template
output files), that downloads the two files with a single click, while
preserving the file names and preventing some foolio from the suggestion
of re-naming them, is still a desirable goal, relatively simple, reduces
the possibilities for abuse, and requires little additional effort from
the end-user.
| > Two things have me pausing.. one, I'm not 100% certain of the syntax
| > needed to .zip (which I use more of between Mac and Windoze) a file
|
| This has nothing to do with Perl. The syntax of the external command
| is well the syntax of the external command - read the manual of that
| command.
You're absolutely correct, and the more of the article I wrote, the more
I realized this, which is why I wrote the rest, and asked for
suggestions on what newsgroup would I be best served by for unix
questions in the future. [sic]
I *trust* you folks to give me an accurate (and not completely useless
.. heh :) answer in THAT regard. I'd prefer that people don't scorefile
me down for this, since my intent is to ask *where*, and I'll definitely
not be repeating this in the future, since now I know where to ask
(thanks), but I understand if you folks may feel inclined to.
| > instead of gzip (which I use more of between my Mac and my shell). I'm
| > quite familiar with gzip from the shell but I've never used anything
| > that created plain .zip files from unix, so I'm unsure which way to go.
|
| So your question is "Where can I get a program to make .zip files on
| Unix?". What possessed you to imagine this had anything even remotely
| to do with Perl?
heh well it didn't *start out* like that, but the more I thought about
the problem 'out loud' as I typed it... (and boiled down into A> below,
instead of the above..)
| http://www.info-zip.org/pub/infozip/
So what you're saying is that to the best of your knowledge, unless
they've already gone ahead and installed some sort of .zip compression
scheme other than gzip, I'd still have to beg them to install something
else.
(seriously considering LARTing them, stuffing the CGI someplace else I
have more control over, and telling the 'client' (it's not really a
client, per-se) their webhost sucks, and oh by the way, it's running
perfectly well over here .... =;)
| > Since I'm of certainty approaching 100% that the people using this
| > script to generate the templates will be on Windows systems, (and some
| > may be complete newbies) I'd rather give them a file that I'm confident
| > can be "unzipped" with something like WinZip[1].
| >
| > so it boils down to two questions
| > A. (non-perl) does anyone offhand know whether WinZip can uncopress a
| > unix .gz file?
|
| Yes.
| > B. (perl ! and thus saving my bacon :) would the proper command look
| > something like
| >
| > `cat $file1 $file2 | gzip > ${fileprefix}.gz`
| > or die "$!";
|
| See FAQ: "What's wrong with using backticks in a void context?"
Ahh, so I should use system() in a situation like this instead... duh..
ok. *smacks forehead* after reading the article.. makes sense. I
probably should have known that by now, but since I don't program in a
unix environ myself being on a Mac, it's not something I've run into yet
-- I don't (and try not to) use a lot of `` or system() calls in my
programming anyway.
| > .. or would it be $@ and not $! ?
|
| You probably should be checking both $! and $?
|
| See: "perldoc -f system" for details.
okay, thanks. (looking up $? cuz I haven't used that one before) :-)
| > Obviously I know the unix part -- cat filea fileb |gzip >foo.gz --
| > that's not what I'm asking in B, above. *cough* :-)
|
| No it is not obvious you know the Unix part. Do you realise that when
| the user unpacks the .gz file they'll get a single file with no way to
| know where to split it to get the two component files?
That exact line is what I *DID* get from reading the gzip manpage,
nobull... are you saying it's NOT correct? *scratching head* or just not
correct for a windows user?
| > Or would you do it a different way?
|
| I would use, and indeed have used, Info-Zip for implementing
| multi-file download from a CGI.
Which gets me running in circles again, begging them to install
something. *sigh* they're pretty hopeless.. 30+boxen only one of which
is unix, and only one of the admins there actually admins the unix
box... everyone else leaves it alone.
| > [2] If you'd rather not answer because you think the whole thing is too
| > much unix and not enough perl[3], would you be so kind as to provide a
| > helpful suggestion as to which comp.unix.* group would be most receptive
| > and responsive to my questions above? I looked, but there's enough of
| > 'em that I'm not sure. I *will* be sure to keep any answer to [2] in
| > mind in the future however, with many thanks for the tip.
|
| I suspect "Where can I get a program to make .zip files on Unix?"
| would be best asked in comp.unix.misc. Although I'd recommend a you
| try a web search first for things like this first.
So noted. And thanks for your time and thoughts.
I'm more or less exploring possible avenues of solving my problem with
getting the two files to the end-user. The rest of the perl going into
making up the script was much more sticky going, but I managed to work
my way through learning to use format/write (which was the big sticky
point in writing this thing) and had a fun time coding all the
error-checking on the input, and working out ways to inform the user
effectively.. I wound up coding it such that each segment was a separate
subroutine (some which are re-usable with optional input to trigger
slightly different responses from the sub), and the 'main' part of the
script only calls each sub in the proper order as input progresses
through by checking the param()'s for existence.
*musing...* I suppose another possibility would be to have CGI.pm simply
SEND the files to the user directly, but I haven't looked into that yet.
I may have to browse Lincoln's website a bit to see how that's done, and
compare what possibilities ensue thereof.
.. off to do some more pondering and reading.. thanks again for your
feedback.
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Tue, 24 Apr 2001 12:09:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Compression (to .zip/.gz) using system/backticks
Message-Id: <45raet0m95lob5t9lv7d5d2ulshifvj88b@4ax.com>
Scott R. Godin wrote:
>EVEN if I installed them myself by drag-copying them over FTP, since I
>can't get Telnet access there, it's still a royal pain to get them to
>add the dang things to the web group because they're so paranoid about
>things breaking. *eyerolls*
They don't have to. You can have your own lib directiry. See the FAQ,
perlfaq8:
How do I keep my own module/library directory?
How do I add the directory my program lives in to the module/library
search path?
And, from an earlier post that didn't appear in my newsfeed:
> 1> there is a (slight to moderate) possibility of it being used for
> abuse, in that the user could enter an incorrect (i.e. someone else's)
> mail address
So, require that these users "log in", i.e. require the need for a
password that they can ask for, but which only gets mailed to their
e-mail account. Then you *know* their e-mail address.
--
Bart.
------------------------------
Date: Tue, 24 Apr 2001 14:10:33 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Execute script at certain times?
Message-Id: <3AE57B49.86B194CE@schaffhausen.de>
Preston Price schrieb:
>
> I was wondering if anyone knew of a way to have a program run at a certain
> time everyday. I want something that will run at midnight every night. Does
> anyone know of a way to do this?
> Thanks in advance.
Seems like you want a Perl solution, well, here it is:
while(1) {
my $div = time / (60*60*24);
if($div == int($div)) {
execute_program()
}
}
But please don't use it,
Bye,
->malte
------------------------------
Date: 24 Apr 2001 10:22:05 GMT
From: "John Michael" <johnm@aiamail.com>
Subject: fakessi
Message-Id: <9c3k4d$mr2@dispatch.concentric.net>
I'm looking for a copy of
fakessi.pl
and can't find it. I have looked at the locations listed in the CGI
programming book and they no longer exist.
http://sw.cse.bris.ac.uk/WebTools/fakessi.html
Does anyone know where to find it.
Thanks in advance
John Michael
------------------------------
Date: Tue, 24 Apr 2001 10:44:39 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: fakessi
Message-Id: <slrn9ealub.bfu.bernard.el-hagin@gdndev25.lido-tech>
On 24 Apr 2001 10:22:05 GMT, John Michael <johnm@aiamail.com> wrote:
>I'm looking for a copy of
>fakessi.pl
>and can't find it. I have looked at the locations listed in the CGI
>programming book and they no longer exist.
>http://sw.cse.bris.ac.uk/WebTools/fakessi.html
Why don't you use a search engine? Just type 'fakessi.pl' in the search window.
Sheesh!
Cheers,
Bernard
--
perl -e's;;s,,Just another Perl hacker,;and$\="\r"and
$$=q!print${"\x27"}!;$;=qq.$0..q.v..qq!al $$!;$;=~s-\---;
/^....*(?{$|=eval$;;select($Just,$another,$Perlhacker,0.1)}).{25}/x;'
------------------------------
Date: 24 Apr 2001 10:39:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Good editor for perl
Message-Id: <9c3l4q$gvr$1@mamenchi.zrz.TU-Berlin.DE>
According to Rafael Garcia-Suarez <rgarciasuarez@free.fr>:
> Anno Siegel wrote in comp.lang.perl.misc:
> }
> } In any case, they do not really highlight syntax. Well, perhaps
> } in lisp, but not in Perl. A syntax highlighter should be able to tell
> } whether a particular "{" opens a block of code, a hash subscript, or
> } an anonymous hash. I don't expect one anytime soon.
[snip Perltidy]
> Editors use (sometimes sophisticated) heuristics to color code. This is
> intended to work for only the most common cases. When the heuristics
> fails, this produces annoying results. The same problem arises for
> editors that helps to indent code being typed.
My point. It works in simple cases (when you don't need it). When
you need it, it can't be trusted.
Anno
------------------------------
Date: Tue, 24 Apr 2001 13:53:59 +0100
From: "Matt Ross" <m-a-t-t@m-a-t-t-r-o-s-s.co.uk>
Subject: Help with a script
Message-Id: <HHeF6.5837$Ln6.814564@news2-win.server.ntlworld.com>
Hi,
Would anyone be willing to help with a script I've got to maintain a mailing
list?
Below is the code used, but it keeps returning a '500' server error - but I
can't see why. I have uploaded as ASCII.
Thanks,
Matt
matt@mattross.co.uk
Code:
#!/usr/sbin/perl
$buffer = <STDIN>;
if ($buffer eq "") { $buffer = $ENV{'QUERY_STRING'}; }
@pairs = split(/\&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
sub error {
print "Content-type: text/html\n\n";
print <<EndHTML;
<HTML>
<HEAD>
<TITLE>[ mr:uk ] - Subscribe</TITLE>
<LINK REL="stylesheet" HREF="http://www.mattross.co.uk/style.css"
TYPE="text/css">
</HEAD>
<BODY>
<FONT FACE="Tahoma" SIZE=\"3\"><STRONG>Error</STRONG><BR><HR>
<FONT FACE="Tahoma" SIZE=\"2\">
<BR>
Please enter an email address</H2>
</BODY>
</HTML>
EndHTML
;
exit;
}
#
# End additions.
#
if ($FORM{'action'} eq "add")
{
&error unless $FORM{'address'};
open (subscriberlist, ">>subscribers.txt"); # Add the new
address to the bottom of the list
print subscriberlist "$FORM{'address'}\n";
close (subscriberlist);
open (subscriberlist, "<subscribers.txt"); # Read the
contents
read (subscriberlist, $list, 10000);
close (subscriberlist);
open (SENDMAIL, "|/usr/sbin/sendmail -t"); # E-mail the
contents to list owner
print SENDMAIL "To: webmaster\@mattross.co.uk ([ mr:uk ] Webmaster)\n";
print SENDMAIL "From: webmaster\@mattross.co.uk ([ mr:uk ] Webmaster)\n";
print SENDMAIL "Reply-to: webmaster\@mattross.co.uk ([ mr:uk ]
Webmaster)\n";
print SENDMAIL "Subject: New subscription\n\n";
print SENDMAIL "New address: $FORM{'address'}\n\n";
print SENDMAIL "Complete list:\n";
print SENDMAIL "$list";
close (SENDMAIL);
#
# Matt, edit the message in the email body to what you want.
#
open (MAIL, "|/usr/sbin/sendmail -t"); # E-mail confirmation.
print MAIL "To: $FORM{'address'}\n";
print MAIL "From: webmaster\@mattross.co.uk ([ mr:uk ] Webmaster)\n";
print MAIL "Reply-to: webmaster\@mattross.co.uk ([ mr:uk ] Webmaster)\n";
print MAIL "Subject: Welcome to the [ mr:uk ] Mailing List\n\n";
print MAIL "Hi there,\n\nThis is just a confirmation email.\n\nIf you
joined this list in error, or someone added your email address without your
permission, use the link below to be removed from the list.\n\n";
print MAIL
"http://www.mattross.co.uk/cgi-bin/subscribe.pl?action=remove&address=$FORM{
'address'}\n\n";
print MAIL "Thankyou\n\n";
close (MAIL);
#
# End additions
#
# Show a confirmation page
print "Content-type: text/html\n\n";
print <<EndHTML;
<HTML>
<HEAD>
<TITLE>[ mr:uk ] - Subscribe!</TITLE>
<LINK REL="stylesheet" HREF="http://www.mattross.co.uk/style.css"
TYPE="text/css">
</HEAD>
<BODY>
<FONT FACE="Tahoma" SIZE=\"3\"><STRONG>Thank you</STRONG><BR><HR>
<FONT FACE="Tahoma" SIZE=\"2\">
<BR>
Your e-mail address, $FORM{'address'}, has been added to the [ mr:uk ]
subscription list.<BR>
Please check your mailbox to ensure you receive confirmation.<BR>
<BR>
<A HREF="javascript:window.close();">Close Window</A>
</BODY>
</HTML>
EndHTML
;
exit;
}
elsif ($FORM{'action'} eq "remove")
{
open (subscriberlist, "<subscribers.txt"); # Read the list
file and close
read (subscriberlist, $buffer, 10000);
close (subscriberlist);
@list_lines = split (/\n/, $buffer);
open (subscriberlist, ">subscribers.txt"); # Open list
file again, for output
foreach $line(@list_lines)
{
if ($line ne $FORM{'address'}) # Only re-write
the line if it's different
{ # from the one
to be removed
print subscriberlist "$line\n";
}
}
close (subscriberlist);
print "Content-type: text/html\n\n";
print <<EndHTML;
<HTML>
<HEAD>
<TITLE>[ mr:uk ] - Subscribe!</TITLE>
<LINK REL="stylesheet" HREF="http://www.mattross.co.uk/style.css"
TYPE="text/css">
</HEAD>
<BODY>
<FONT SIZE=\"3\"><STRONG>Unsubscribe Confirmation</STRONG><BR><HR>
<FONT SIZE=\"2\">
<BR>
Your e-mail address, $FORM{'address'}, has been removed from the
subscription list.
<BR><BR>
</BODY>
</HTML>
EndHTML
;
open (SENDMAIL, "|/usr/sbin/sendmail -t");
print SENDMAIL "To: Webmaster\@mattross.co.uk ([ mr:uk ] Webmaster\n";
print SENDMAIL "From: webmaster\@mattross.co.uk ([ mr:uk ] Webmaster)\n";
print SENDMAIL "Reply-to: webmaster\@mattross.co.uk ([ mr:uk ]
Webmaster)\n";
print SENDMAIL "Subject: Subscription Cancellation\n\n";
print SENDMAIL "Address: $FORM{'address'}\n\n";
print SENDMAIL "Complete list:\n";
print SENDMAIL "$buffer";
close (SENDMAIL);
exit;
}
elsif ($FORM{'action'} eq "concrete")
{
open (subscriberlist, "<subscribers.txt"); # Read the list
file and close
read (subscriberlist, $buffer, 10000);
close (subscriberlist);
@subscribers = split (/\n/, $buffer);
foreach $subscriber (@subscribers)
{
open (SENDMAIL, "|/usr/sbin/sendmail -t");
print SENDMAIL "To: $subscriber\n";
print SENDMAIL "From: webmaster\@mattross.co.uk ([ mr:uk ]
Webmaster)\n";
print SENDMAIL "Reply-to: webmaster\@mattross.co.uk ([ mr:uk ]
Webmaster)\n";
print SENDMAIL "Subject: Website Update Notification\n\n";
# Matt, i've added these 3 lines that takes the message from the form and
does stuff to it :)
# I borrowed it from a script i use to email myself so it does work (crosses
fingers ;)
$FORM{'message'} =~ s/\cM\n/<br>\n/g;
$message = $FORM{'message'};
$message =~ s/<br>//g;
print SENDMAIL "$message\n\n\n";
print SENDMAIL "To unsubscribe from [ mr:uk ] updates, use this URL:\n";
print SENDMAIL
"http://www.mattross.co.uk/cgi-bin/subscribe.pl?action=remove&address=$subsc
riber\n\n";
print SENDMAIL "If there are any problems with this service then contact
the webmaster by replying to this e-mail.\n";
close (SENDMAIL);
}
print "Content-type: text/html\n\n";
print <<EndHTML;
<HTML>
<HEAD>
<TITLE>Confirmation</TITLE>
<LINK REL="stylesheet" HREF="http://www.mattross.co.uk/style.css"
TYPE="text/css">
</HEAD>
<BODY>
<FONT SIZE=\"3\"><STRONG>Confirmation</STRONG><BR><HR>
<FONT SIZE=\"2\">
<BR>
The following message has been sent to the subscribers.
<BR>
<PRE>$FORM{'message'}</PRE>
<BR>
<A HREF=\"http://www.mattross.co.uk/admin\">Return to admin page</A>
</BODY>
</HTML>
EndHTML
;
exit;
}
exit;
------------------------------
Date: Tue, 24 Apr 2001 13:58:20 +0100
From: "errol brown" <errolbrown@hotmail.com>
Subject: Re: How secure is this....
Message-Id: <OLeF6.133488$HR6.14895000@nnrp4.clara.net>
> I understand that 'crypt' is pretty much unbreakable
Forgive me sir. Are you on drugs?
This isn't 1024-bit public key cryptography we are talking about here.
It's an encryption routine with a two-character salt, designed to be
compatible with UNIXy style encrypted passwords.
> - assuming the
> password is suitably random. E.g. If a user chooses a password of
> "rabbits" then a dictionary attack could break the password. On the
> otherhand, a password of "djEU37d:kdcm/ekE048G467hFbf" might be hard to
> crack.
A brute force attack on a password would eventually do one of these in,
without a great deal of hassle.
> HOWEVER, the real weakness will be in how it is used, THEREFORE I can't
> say that in your application this will be safe, or whether there is
> something better.
Ah, the first semi-sensible thing in your post. Quite correct. These
encrypted passwords are reasonably safe in /etc/shadow because very few
users have the rights to read that file.
Once these babies are being passed around they get dangerously easy to
break. Golden rule: if someone has it, they can break it.
errol
------------------------------
Date: 24 Apr 2001 10:23:31 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Idiom: the expression of a copied & substituted string
Message-Id: <988107202.13105@itz.pp.sci.fi>
In article <9c00ma$97a@netnews.hinet.net>, John Lin wrote:
>
>Is there an idiomatic expression (shorter, cleaner) to say
>"The string that is made from replacing $original's '.pl' and end with '.bak'"
>(The do{} here is cumbersome.)
map() and grep() get closest, but don't quite match what you want.
Writing your own subroutine to do it is trivial, however:
sub apply (&$) {
local $_ = $_[1];
$_[0]->();
return $_;
}
rename $original, apply {s/\.pl$/.bak/} $original;
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: 24 Apr 2001 10:10:20 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <988106688.12575@itz.pp.sci.fi>
In article <3AE3728D.3481AC3D@ttsg.com>, Tuc wrote:
>
>Well, I then set up another system with 5.6.1 and the new Filter. Doesn't give the
>errors anymore. GREAT! Well, not really. Now my call to CGI.pm doesn't seem to
>be working.... When I'd run something from command line, it'd go into "offline
>mode". Now it just breezes past it. I tried to email Lincoln@CSHL but he did
>something VERY BAD in his .forward it seems.
I think this is a feature. You get the same behavior if you upgrade
CGI.pm from the CPAN. There is really no need for the "offline mode"
prompt, since you can just pass the parameters on the command line:
perl foobar.cgi foo=bar war=peace freedom=slavery ignorance=bliss
and it makes it easier to test the case where no parameters are given:
perl foobar.cgi
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: Tue, 24 Apr 2001 12:39:48 +0200
From: "Ivo Bronsveld" <ivob@euronet.nl>
Subject: Re: Loading images to Oracle using DBI
Message-Id: <20010424.123944.561717988.1671@wacky.euronet.nl>
Hi,
"penpendisarapen"<penpendisarapen@mailandnews.com> wrote:
> I desperatley need to find out how to load images into an Oracle 8.1.6
> long raw field ASAP. Can this be done using DBI? Are there code samples
> I can view
> somewhere? I have limited experience with DBI and need to find out fast.
>
> Hope someone can help me. TIA.
>
> Victor
Well, I would suggest something like this (if Oracle is already set for
the use of the large amount of data you want to inject ;-)))
use DBI; # Database Interfacing
my $Sdbh = ""; # Database handler
my $sth =""; # handle
# Connect to the database
$Sdbh = DBI->connect("dbi:Oracle:host=$ORACLE_HOST;sid=$ORACLE_SID",
$ORACLE_USER,$ORACLE_PASS);
$sth = $Sdbh->prepare("INSERT INTO table_name (column_for_picture) VALUES
(value_meaning_data_from_image)");
$sth->execute();
$sth->finish;
# Don't forget to commit the changes to the database
$sth = $Sdbh->prepare("COMMIT")
$sth->execute();
$sth->finish;
# disconnect database
$Sdbh->disconnect;
for more information try:
www.perl.com
and perldoc DBI
Good luck!
Ivo Bronsveld
------------------------------
Date: Tue, 24 Apr 2001 13:04:34 +0200
From: matthias@jaekle.net
Subject: Re: Problems with module PlPRC
Message-Id: <3AE55DC2.70A3E4A@jaekle.net>
Hi,
I ignored the error message and made a "make install" and everything was
working fine.
Matthias
"Mathias-H. Weber" wrote:
>
> I tried to install Bundle::PlRPC. Everything went fine up to "make test"
> of module "PlRPC-0.2015". The error message is not very valuable ("Use
> of uninitialized value in concatenation (.)") - the problem is deeper
> and may have something to do with incorrect usage of Sys::Syslog.
>
> I tried to create an own server and client and got them running. But I
> had to explicitly include "require Sys::Syslog;" in my server.
>
> I have tried hard to find the problem with "make test" but did not
> succeed. Has anybody used/installed this module recently and give some
> hints?
>
> Thanks in advance
> (Perl is 5.6.0)
> --
> Mathias-H.Weber mailto:weber.m@gmx.de
------------------------------
Date: 24 Apr 2001 11:33:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: removing the \n from the data obtained from a text area in a form
Message-Id: <9c3o9d$jn3$1@mamenchi.zrz.TU-Berlin.DE>
According to Walter Hafner <hafner-usenet@ze.tu-muenchen.de>:
> Occasionaly I have to process files of unknown origin. I.e., the files
> were written by my coworkers, some under Windows, some under Unix - no
> Macs. My scripts have to work on all of them. Since I can't tell the
> format, I use constructs like
>
> while (<>) {
> s/\r//;
> chomp;
> # process one line after the other
> }
>
> to remove all the line delimiters. Is this the most effective way or
Looks fine to me, except it may destroy literal carriage return
characters that may be embedded without being part of a newline
sequence.
> should I use constructs like
>
> while (<>) {
> $/ = '\r\n' if /\r\n/;
You want double quotes: "\r\n".
> chomp;
> # process one line after the other
> }
>
> Very messy, because of the comparison in every single line. But if I
> pull the $/ line out of the loop, i loose the first line.
This approach looks better, not so much for efficiency reasons but
because it avoids the slight risc above.
Since you are reading from <>, you should not rely on the file being
seekable or even to be able to re-open it. (This would be the
simplest approach to re-reading the first line.) So just reorganize
the read loop to use a buffer:
$_ = <>;
$/ = "\r\n" if defined $_ and substr( $_, -2) eq "\r\n";
while ( defined $_ ) {
chomp;
# process one line after the other
$_ = <>;
}
Anno
------------------------------
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 752
**************************************