[25556] in Perl-Users-Digest
Perl-Users Digest, Issue: 7800 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 19 18:06:10 2005
Date: Sat, 19 Feb 2005 15:05:35 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 19 Feb 2005 Volume: 10 Number: 7800
Today's topics:
Re: cperl-mode and emacs-21.4 brocken? <nospam-abuse@ilyaz.org>
Re: cperl-mode and emacs-21.4 brocken? <mike53@moocow.tu-bs.de>
Re: cperl-mode and emacs-21.4 brocken? <nospam-abuse@ilyaz.org>
cubic root subroutine <danfan46@hotmail.com>
Re: cubic root subroutine <1usa@llenroc.ude.invalid>
Re: cubic root subroutine <sbryce@scottbryce.com>
Re: cubic root subroutine <1usa@llenroc.ude.invalid>
Re: cubic root subroutine <1usa@llenroc.ude.invalid>
Re: cubic root subroutine <nospam@bigpond.com>
Re: cubic root subroutine <jurgenex@hotmail.com>
Re: cubic root subroutine (Jay Tilton)
Re: DBI not generating expected error messages <nobull@mail.com>
emacs AAAAAAAAAAAAAHHH!!! ioneabu@yahoo.com
Re: emacs AAAAAAAAAAAAAHHH!!! <mike53@moocow.tu-bs.de>
Re: exercise: partition a list by equivalence <xah@xahlee.org>
Google Groups and indentations <jl_post@hotmail.com>
Re: Google Groups and indentations <nobull@mail.com>
Re: Google Groups and indentations <tassilo.von.parseval@rwth-aachen.de>
How to NOT use utf8. <pkaluski@piotrkaluski.com>
Re: How to NOT use utf8. (Anno Siegel)
Re: How to NOT use utf8. <flavell@ph.gla.ac.uk>
Re: how to set time <yyusenet@yahoo.com>
Re: How to validate date and time? <noreply@gunnar.cc>
Mason hosting support? briansmccabe@gmail.com
Re: Mason hosting support? <nospam@bigpond.com>
Re: Mason hosting support? briansmccabe@gmail.com
Re: Need help with CGI/ DBI error (permissions?) <jwillmore@adelphia.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 18 Feb 2005 20:18:44 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <cv5ij4$ksa$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Mike Dowling
<fake@tu-bs.de>], who wrote in article <slrnd1bmnm.q7.mike53@moocow.localhost>:
> I had no problems with cperl-mode with emacs-21.3.
> With emacs-21.4, it still works, but only if started manually (M-x
> cperl-mode). Starting automaticall with
>
> (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl
> programs" t)
>
> in the .emacs file fails. Instead, I get the message:
>
> File mode specification error: (error "Autoloading failed to define
> function perl-mode")
>
> Any clues, anybody?
Maybe you are using "my" cperl-mode.el with 21.3, and "their" with
21.4? IIRC, with "their" version you need a different way to
auto-associate, since it won't overwrite perl-mode...
Hope this helps,
Ilya
------------------------------
Date: 19 Feb 2005 15:23:53 GMT
From: Mike Dowling <mike53@moocow.tu-bs.de>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <slrnd1emgu.72g.mike53@moocow.localhost>
On Fri, 18 Feb 2005 20:18:44 +0000 (UTC), Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> Mike Dowling
><fake@tu-bs.de>], who wrote in article <slrnd1bmnm.q7.mike53@moocow.localhost>:
>> I had no problems with cperl-mode with emacs-21.3.
>> With emacs-21.4, it still works, but only if started manually (M-x
>> cperl-mode). Starting automaticall with
>>
>> (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl
>> programs" t)
>>
>> in the .emacs file fails. Instead, I get the message:
>>
>> File mode specification error: (error "Autoloading failed to define
>> function perl-mode")
>
> Maybe you are using "my" cperl-mode.el with 21.3, and "their" with
> 21.4? IIRC, with "their" version you need a different way to
> auto-associate, since it won't overwrite perl-mode...
Perhaps! I used the cperl-mode that came with emacs ("theirs") but it
appeared to have been authored by you, but its probabale old. Where can
I get the latest version, could you perhaps post it here?
Here's the blurb in the commentary in the beginning:
;;; cperl-mode.el --- Perl code editing commands for Emacs
;; Copyright (C) 1985, 86, 87, 91, 92, 93, 94, 95, 96, 1997
;; Free Software Foundation, Inc.
;; Author: Ilya Zakharevich and Bob Olson
;; Maintainer: Ilya Zakharevich <ilya@math.ohio-state.edu>
;; Keywords: languages, Perl
So it looks like it's yours, but
(defvar cperl-tips 'please-ignore-this-line
"Get newest version of this package from
ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs
and/or
ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
Subdirectory `cperl-mode' may contain yet newer development releases
and/or
patches to related files.
For best results apply to an older Emacs the patches from
ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode/patches
\(this upgrades syntax-parsing abilities of RMS Emaxen v19.34 and
v20.2 up to the level of RMS Emacs v20.3 - a must for a good Perl
mode.) You will not get much from XEmacs, its syntax abilities are
too primitive.
But these FTP URLs apparently no longer exist, so I deduce the
cperl-mode distributed with emacs is ancient. A google search for more
recent sources drew a blank.
Cheers,
Mike Dowling
--
Sorry, after years of fighting spam, I've given in. I changed
my email address, and don't want to reveal it to spammers. I
understand any wrath therby incurred, but I'm no longer in any
position to continue the fight.
------------------------------
Date: Sat, 19 Feb 2005 22:28:08 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <cv8eho$1cjk$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Mike Dowling
<fake@tu-bs.de>], who wrote in article <slrnd1emgu.72g.mike53@moocow.localhost>:
> > Maybe you are using "my" cperl-mode.el with 21.3, and "their" with
> > 21.4? IIRC, with "their" version you need a different way to
> > auto-associate, since it won't overwrite perl-mode...
>
> Perhaps! I used the cperl-mode that came with emacs ("theirs") but it
> appeared to have been authored by you, but its probabale old. Where can
> I get the latest version, could you perhaps post it here?
One which comes with Emacs is a tiny bit dumbed down to be more
compatible with the "common ideology" of the Emacs package. See
ilyaz.org/software/emacs for the "point-and-shoot" version.
What do people think: is the presense of two versions hurting more
than availability of a version "which just works" no matter what
version of Emacs you are using (I use 19.33 ;-)?
Yours,
Ilya
------------------------------
Date: Sat, 19 Feb 2005 21:37:11 GMT
From: "Dan van Ginhoven" <danfan46@hotmail.com>
Subject: cubic root subroutine
Message-Id: <bkORd.17729$d5.140845@newsb.telia.net>
Hi.
I needed a cubic root subroutine but didnīt find one at a quick search.
So I wrote a simple one.
It seems pretty fast and accurate enough.
Any ideas how to improve it,
or point me to better solutions.
/dg
#---------------------------------------------------------------------------
# Windows Perl
for ($number=2; $number < 126;$number++) {
$resp = cubicroot($number);
print "3 root of $number = $resp\n";
}
exit;
#------------------------------------------------------------------
sub cubicroot{
my ($number) = @_;
my ($reply);
$number = abs($number);
my $reply = int(sqrt(sqrt($number))); #Need to start somewhere. Any
better idea ?
my ($diff,$decimal,$fraction);
# first find the nearest higher whole number
while ($reply**3 < $number ) {
$reply +=1;
}
$reply -=1;
# We start with 1.0 to catch the even cubic ( 8 27 64 125 ...)
# and then count down to the nerast lower by 0.1
$decimal = 1.0;
$fraction = 0.1;
$diff = 1;
WHILE:
while ($diff > 0) {
while ( ($reply + $decimal)**3 > $number ) {
$decimal -= $fraction;
#we need a precision check here
if ($decimal - $fraction == $decimal) {last WHILE}
}
# Now we divide fraction by ten and go up again
$fraction = $fraction / 10;
while ( ($reply + $decimal)**3 < $number ) {
$decimal +=$fraction;
#we need a precision check here
if ($decimal + $fraction == $decimal) {last WHILE}
}
# Divide fraction by ten for next loop
$fraction = $fraction / 10;
# Calculate diff before next loop
$diff = abs( ($reply + $decimal)**3 - $number);
}
return $reply+$decimal;
}
------------------------------
Date: Sat, 19 Feb 2005 21:49:08 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cubic root subroutine
Message-Id: <Xns9602AB185FD3Fasu1cornelledu@127.0.0.1>
"Dan van Ginhoven" <danfan46@hotmail.com> wrote in
news:bkORd.17729$d5.140845@newsb.telia.net:
> I needed a cubic root subroutine but didnīt find one at a quick
> search. So I wrote a simple one.
You mean "a simplistic and naive one"
> It seems pretty fast and accurate enough.
How did you test it?
> Any ideas how to improve it,
Using strict and warnings will reveal some problems but you basically have
an algorithmic problem.
D:\Home\asu1\UseNet\clpmisc> ttt
Cubic root of -1 = 1
Sinan.
------------------------------
Date: Sat, 19 Feb 2005 14:49:13 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: cubic root subroutine
Message-Id: <aYydnRA3E-_JKYrfRVn-gw@comcast.com>
Dan van Ginhoven wrote:
> Hi.
>
> I needed a cubic root subroutine but didnīt find one at a quick
> search. So I wrote a simple one. It seems pretty fast and accurate
> enough. Any ideas how to improve it, or point me to better
> solutions.
<code snipped>
If you remember back to your first year algebra class, you will recall
that the third root of a number is the same as that number raised to the
1/3 power.
use strict;
use warnings;
for my $number (2 .. 125) {
my $resp = cubicroot($number);
print "3 root of $number = $resp\n";
}
sub cubicroot {
return $_[0] ** (1/3);
}
------------------------------
Date: Sat, 19 Feb 2005 21:53:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cubic root subroutine
Message-Id: <Xns9602ABDCE2D1Easu1cornelledu@127.0.0.1>
"Dan van Ginhoven" <danfan46@hotmail.com> wrote in
news:bkORd.17729$d5.140845@newsb.telia.net:
> or point me to better solutions.
I haven't tested it myself, but I would give
http://search.cpan.org/~jonathan/Math-Calculus-NewtonRaphson-
0.1/NewtonRaphson.pm
a shot first.
Sinan
------------------------------
Date: Sat, 19 Feb 2005 21:56:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cubic root subroutine
Message-Id: <Xns9602AC42E4444asu1cornelledu@127.0.0.1>
Scott Bryce <sbryce@scottbryce.com> wrote in news:aYydnRA3E-_JKYrfRVn-
gw@comcast.com:
> If you remember back to your first year algebra class, you will recall
> that the third root of a number is the same as that number raised to the
> 1/3 power.
Oh, God! I was so mesmerized by the mish-mash the OP posted, that I missed
the very very obvious.
I have a feeling I will not be able to sleep tonight :)
Thanks
Sinan.
------------------------------
Date: Sun, 20 Feb 2005 08:23:48 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: cubic root subroutine
Message-Id: <37psjlF5g5hc6U1@individual.net>
Dan van Ginhoven wrote:
> Hi.
>
> I needed a cubic root subroutine but didnīt find one at a quick search.
> So I wrote a simple one.
Theres a trivial analytic solution
http://mathworld.wolfram.com/RootofUnity.html
gtoomey
------------------------------
Date: Sat, 19 Feb 2005 22:35:54 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: cubic root subroutine
Message-Id: <ebPRd.3875$EL5.3349@trnddc05>
Dan van Ginhoven wrote:
> I needed a cubic root subroutine but didnīt find one at a quick
> search. So I wrote a simple one.
> It seems pretty fast and accurate enough.
> Any ideas how to improve it,
> or point me to better solutions.
Is there anything wrong with just using the exponentiation operator?
$cubicroot = $foo ** (1/3);
jue
------------------------------
Date: Sat, 19 Feb 2005 22:44:45 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: cubic root subroutine
Message-Id: <4217be4a.925750298@news.erols.com>
"Dan van Ginhoven" <danfan46@hotmail.com> wrote:
: I needed a cubic root subroutine but didnīt find one at a quick search.
: So I wrote a simple one.
: It seems pretty fast and accurate enough.
: Any ideas how to improve it,
: or point me to better solutions.
A good stab at the problem, but as numeric solutions go, the algorithm
sucks.
The classic algorithm, introduced very early in numeric method courses, is
application of Newton's method. Much easier to code and
orders-of-magnitude faster.
------------------------------
Date: Sat, 19 Feb 2005 15:56:01 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: DBI not generating expected error messages
Message-Id: <cv7n8g$kf$1@sun3.bham.ac.uk>
patrickg wrote:
> Hey all - new to Perl and DBI, so just trying to get an understanding of
> things. I copied some sample code from the Perl DBI book in the error
> checking section, but I can't seem to get any of the error messages that I
> expect. Instead, the program crashes and I get the popup box stating " Perl
> Command Line Interpreter has encountered a problem and needs to close.". Can
> someone tell me why none of these error messages are are being displayed
> when I deliberately make a typo (ie. bad password, malformed SQL, etc) to
> cause an error? (I've tried all the combinations of setting the PrintError
> and RaiseError).
I read you post a couple of times looking hard at your code examples and
couldn't see why RaiseError and PrintError were not working. Then I
read your post again and realised you said Perl was crashing hard. Well
there's your reason - DBI is unable to return errors in any normal way
because Perl has already crashed. Such crashes are usually due to
library version incompatibilities.
Did you build the DBD youself from sources or download a binary? If you
got a binary it may be it's linked against a different version of the
database client library.
------------------------------
Date: 19 Feb 2005 05:16:14 -0800
From: ioneabu@yahoo.com
Subject: emacs AAAAAAAAAAAAAHHH!!!
Message-Id: <1108818974.100169.200340@f14g2000cwb.googlegroups.com>
Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.
I have now used emacs on OS X and Win XP. I have gone through the
tutorial and learned to navigate around and do the basics. I also
learned to invoke cperl-mode and even how to cut & paste some lisp code
into an .emacs file to supposedly start up with cperl-mode configured
in various ways.
All I really wanted up front was to see my Perl syntax color coded and
to compile and run my Perl program from within emacs, just to see it
work.
I did see it expand things for me, like:
while (()) {
}
which was pretty neat. It also persistantly gave me an explanation of
what #!/usr/bin/perl was for. Occasionally, it gave unhelpful advice
about unclosed {} on certain lines, which I am certain it was not
correct.
I have wasted a day and a half that could have been dedicated to
learning a new module or two or learning more core Perl or whatever.
I see that many people use and love emacs and think it is the greatest
for programming and everything else. I cannot find a decent online
tutorial for using emacs to write Perl. Everyplace I look just gives
the same few lines for the .emacs file and little else. I don't even
see a Perl/emacs book on amazon.com.
Is it worth continuing or am I just as well off without it? I like vi
and I also use a simple editor I wrote for Windows which has an ever
present directory and file list box at the left of the screen which
makes it really easy to fly through directories and files quickly.
Sometimes I just like to grab the mouse and grab a bunch of text for
copying, cutting etc... instead of thinking, 'let me mark here and mark
there, yank, jump over here now, delete, aaaaah! I just erased the
stuff in my buffer!' I grew up with Windows/Mac type editors and am
learning Unix type editing later in life.
Thanks for any advice
wana
------------------------------
Date: 19 Feb 2005 15:37:56 GMT
From: Mike Dowling <mike53@moocow.tu-bs.de>
Subject: Re: emacs AAAAAAAAAAAAAHHH!!!
Message-Id: <slrnd1enba.72g.mike53@moocow.localhost>
On 19 Feb 2005 05:16:14 -0800, ioneabu@yahoo.com <ioneabu@yahoo.com> wrote:
> Sorry for the annoying subject, but I cannot express my frustration any
> better here. I am willing to take on learning anything new that will
> help me to program better and more efficiently.
For the life of me, I cannot see your problem, unless it's a lack of
familiarity with emacs in general. It takes some getting used to, and
it's keyboard oriented as opposed to mouse oriented, but once you get
the hang of it, it's a great editor.
> I have now used emacs on OS X and Win XP.
I suffer under windows at work as well, but emacs is at its best with
UNIX.
> I see that many people use and love emacs and think it is the greatest
> for programming and everything else.
Well, I still prefer vi when no intelligence on behalf of the editor is
required. Fast, efficient, effective.
> I cannot find a decent online tutorial for using emacs to write Perl.
> Everyplace I look just gives the same few lines for the .emacs file
> and little else. I don't even see a Perl/emacs book on amazon.com.
There are books around on emacs, many of which are very worthwhile.
(Mine are very old, and refer to ancient versions, but a google search
should do the trick.) Also, take a look at the manual. I found
printing it out a look easier than the GNU info (which I dislike). Try
looking at the elisp source code of cperl-mode.el (and most other elisp
packages). A lot is usually explained there as to how to use the
package, and how to customise it. Soon you'll have a complex but
effective .emacs file that is tailored to you and your needs.
Cheers,
Mike Dowling
--
Sorry, after years of fighting spam, I've given in. I changed
my email address, and don't want to reveal it to spammers. I
understand any wrath therby incurred, but I'm no longer in any
position to continue the fight.
------------------------------
Date: 19 Feb 2005 13:37:43 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: Re: exercise: partition a list by equivalence
Message-Id: <1108849063.857663.279920@c13g2000cwb.googlegroups.com>
The GOTO statement from Perl has been messed up.
This block:
=A9 for group in interm:
=A9 for newcoup in fin:
=A9 for k in group.keys():
=A9 if newcoup.has_key(k):
=A9 for kk in group.keys(): newcoup[kk]=3D'x';
=A9 break
=A9 break
=A9 fin.append(group)
=A9
should be:
=A9 goto=3DFalse
=A9 for group in interm:
=A9 for newcoup in fin:
=A9 for k in group.keys():
=A9 if newcoup.has_key(k):
=A9 newcoup.update(group);
=A9 goto=3DTrue
=A9 break
=A9 if (goto):
=A9 goto=3DFalse
=A9 break
=A9 else:
=A9 fin.append(group)
comlete code is at:
http://xahlee.org/perl-python/partition_by_equiv.html
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: 19 Feb 2005 08:51:52 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Google Groups and indentations
Message-Id: <1108831912.937631.42410@o13g2000cwo.googlegroups.com>
I don't know if anyone cares, but it seems like Google Groups is
finally allowing indentations to be preserved.
Now I can post code with indentations intact without resorting to
having to place "| " before all my lines of code.
(I'm sure this is a change that the Python newsgroups really
appreciate, as well... :)
------------------------------
Date: Sat, 19 Feb 2005 18:47:21 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Google Groups and indentations
Message-Id: <cv819n$53o$1@sun3.bham.ac.uk>
jl_post@hotmail.com wrote:
> I don't know if anyone cares, but it seems like Google Groups is
> finally allowing indentations to be preserved.
>
> Now I can post code with indentations intact without resorting to
> having to place "| " before all my lines of code.
Yippee.
But since many of the most knowledgible people have killfiled google
there's still cause to avoid it. This is a pitty because I post via
Google about 15% of the time.
------------------------------
Date: Sat, 19 Feb 2005 20:08:56 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Google Groups and indentations
Message-Id: <slrnd1f3m8.qk.tassilo.von.parseval@localhost.localdomain>
Also sprach Brian McCauley:
> jl_post@hotmail.com wrote:
>
>> I don't know if anyone cares, but it seems like Google Groups is
>> finally allowing indentations to be preserved.
>>
>> Now I can post code with indentations intact without resorting to
>> having to place "| " before all my lines of code.
>
> Yippee.
>
> But since many of the most knowledgible people have killfiled google
> there's still cause to avoid it. This is a pitty because I post via
> Google about 15% of the time.
Yesterday I saw an article posted via google rather by accident (I only
saw the follow-up and then wanted to look up the parent, too). I did
notice the indentation but wanted to have more evidence that this has
really been fixed.
Apparently it has so I can remove the killfile entry again. Others will
follow, I am sure.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Fri, 18 Feb 2005 20:51:49 +0100
From: pkaluski <pkaluski@piotrkaluski.com>
Subject: How to NOT use utf8.
Message-Id: <cv5h1p$e46$1@atlantis.news.tpi.pl>
Hi,
I am under impression that my perl scripts crash due to some
incompatibilities with utf8.
I was looking in the documentation and I found out (correct me if I am
wrong) that perl 5.8.0 and higher use utf8 by default. I have also found
several hints on how to make unicode and non-unicode strings work together.
My question is: Is it possible (on Windows) to tell perl not to use
unicode at all. Not in the current lexical scope, in the current module.
Just not to use unicode at all. Only 8-bit character strings.
Is it possible?
--
Piotr Kaluski
"It is the commitment of the individuals to excellence,
their mastery of the tools of their crafts, and their
ability to work together that makes the product, not rules."
("Testing Computer Software" by Cem Kaner, Jack Falk, Hung Quoc Nguyen)
------------------------------
Date: 19 Feb 2005 21:39:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to NOT use utf8.
Message-Id: <cv8bn7$gi2$1@mamenchi.zrz.TU-Berlin.DE>
pkaluski <pkaluski@piotrkaluski.com> wrote in comp.lang.perl.misc:
> Hi,
> I am under impression that my perl scripts crash due to some
> incompatibilities with utf8.
> I was looking in the documentation and I found out (correct me if I am
> wrong) that perl 5.8.0 and higher use utf8 by default. I have also found
> several hints on how to make unicode and non-unicode strings work together.
> My question is: Is it possible (on Windows) to tell perl not to use
> unicode at all. Not in the current lexical scope, in the current module.
> Just not to use unicode at all. Only 8-bit character strings.
>
> Is it possible?
You can find the answer in "perldoc perlrun". See also perlunicode and
perluniintro.
Anno
------------------------------
Date: Sat, 19 Feb 2005 22:01:15 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: How to NOT use utf8.
Message-Id: <Pine.LNX.4.61.0502192153090.13941@ppepc56.ph.gla.ac.uk>
On Fri, 18 Feb 2005, pkaluski wrote:
> I am under impression that my perl scripts crash due to some
> incompatibilities with utf8.
Maybe the best move would be to discuss the problems and try to move
forward, rather than asking how to move backwards...
> I was looking in the documentation and I found out (correct me if I
> am wrong) that perl 5.8.0 and higher use utf8 by default.
A somewhat over-simplified assessment of the new features, I must say.
> I have also found several hints on how to make unicode and
> non-unicode strings work together.
They already do (work together) by and large, if you follow the
documentation and guidelines.
> My question is: Is it possible (on Windows)
Where actually does Windows come into this, specifically?
We've had some discussions here in which problems with Window's native
utf-16 storage format has caused problems. But, for the most part,
Perl aims to be platform-neutral, so maybe - if we discussed the
details clearly enough - the Windows-specific issues could be factored
out and the *real* problem (whatever it might be) could be solved.
> to tell perl not to use unicode at all. Not in the current lexical
> scope, in the current module. Just not to use unicode at all. Only
> 8-bit character strings.
>
> Is it possible?
Sure it;s "possible", though only to those who read the documentation.
But my question would be: is this the optimal approach? Since you
don't seem to know what Perl offers, and we don't know what problem
you are perceiving, it seems to me to be too soon to jump to the
conclusion that you can't use what it is that Perl is offering you.
------------------------------
Date: Sat, 19 Feb 2005 14:07:12 -0700
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: how to set time
Message-Id: <cv89pn$h69$1@news.xmission.com>
Peter wrote:
> Hello All,
> I'm a newbie and busy with a mailform.
>
> This mailform sent autoresponse mail.
> My question is if it possible to sent the autoresponse mail one or two
> days later after receiving the mail.
>
>
> I think it has to be change in this piece of code ?
[code snipped]
>
You subject and what you want to find out are nearlly irrelevant.
Please post using an appropriate title. Please check the posting
guidelines.
--
k g a b e r t (at) x m i s s i o n (dot) c o m
*Support Mozilla Firefox*!
http://www.spreadfirefox.com/?q=user/register&r=71209
------------------------------
Date: Fri, 18 Feb 2005 20:08:50 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to validate date and time?
Message-Id: <37msnnF58shanU1@individual.net>
yashgt@yahoo.com wrote:
> I have a program that deals with files with names such as
> SA_2005-01-03_01-00-00_sqf1974_1.0.0_Iub_Iu_CT.csv
> The format is SA_<date>_<time>_....
> Befor processing a file, I would like the program to validate the
> filename by checking whether the date and time parts are correct.
> I tried using mktime, hoping for perl to return an error value if the
> date and time are wrong. But for some reason even if I give plain text
> in the time part, mktime does not return an error. I use
> ActivePerl 5.8.2 on Windows 2000. This does not have the Date module.
Which Date module are you talking about? There are plenty of them, but
the standard module Time::Local should be sufficient in this case:
use Time::Local;
my @t = $filename =~ /^SA_(\d+)-(\d+)-(\d+)_(\d+)-(\d+)-(\d+)/;
eval { timelocal @t[5,4,3,2], $t[1]-1, $t[0]-1900 };
print ($@ or "Date/time is valid\n");
See "perldoc Time::Local"
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 19 Feb 2005 11:11:24 -0800
From: briansmccabe@gmail.com
Subject: Mason hosting support?
Message-Id: <1108840284.437816.118140@z14g2000cwz.googlegroups.com>
I apologize if this post is in the wrong area. It was about the most
relevant (or somewhat relevant) NG I could find.
I am wondering if anyone can make a recommendation for a reputable,
stable hosting provider that can host a site written in Mason. My
current provider charges me only 5 dollars a month, but I anticipate
having to shell out a bit more than that.
Thanks in advance -
Brian McCabe
------------------------------
Date: Sun, 20 Feb 2005 05:17:15 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Mason hosting support?
Message-Id: <37phlrF5g8j6iU2@individual.net>
briansmccabe@gmail.com wrote:
> I apologize if this post is in the wrong area. It was about the most
> relevant (or somewhat relevant) NG I could find.
>
> I am wondering if anyone can make a recommendation for a reputable,
> stable hosting provider that can host a site written in Mason. My
> current provider charges me only 5 dollars a month, but I anticipate
> having to shell out a bit more than that.
>
> Thanks in advance -
>
> Brian McCabe
A virtual private server at www.linode.com
You control everything, including what Perl modules you install.
gtoomey
------------------------------
Date: 19 Feb 2005 11:31:21 -0800
From: briansmccabe@gmail.com
Subject: Re: Mason hosting support?
Message-Id: <1108841481.204108.291270@z14g2000cwz.googlegroups.com>
Thanks very much. I will investigate this option.
Thanks again,
Brian McCabe
------------------------------
Date: Sat, 19 Feb 2005 12:27:06 -0500
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <IKadnY0Bp89664rfRVn-sw@adelphia.com>
patrickg wrote:
<snip>
>
> my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'scott', 'tiger', { RaiseError =>
> 1, PrintError => 1 } ) or print "<p>Error connecting to database: " .
> $DBI::errstr . "</p>", exit;
my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'scott', 'tiger', {
RaiseError => 1, PrintError => 1 } ) or print "Content-type:
text/html\n\n <p>Error connecting to database: " . $DBI::errstr .
"</p>", exit;
Notice that a HTTP header is issued in the 'print' statement. You could
just 'die' at this point versus using a 'print' and an 'exit' and get
the same results.
Remember, STDOUT (meaning, where the "stuff" is sent from the script) is
going through HTTP, not a console. So, you *need* to send an HTTP
header when using 'print'.
Another way to do it is to just have the following *before* any other
'print' statements:
print "Content-type: text/html\n\n";
Then, if you use any 'print' statements later on in the script, you
don't need to remember to send the HTTP header.
Or ... use the CGI module :-)
HTH,
Jim
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7800
***************************************