[32524] in Perl-Users-Digest
Perl-Users Digest, Issue: 3788 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 1 09:09:40 2012
Date: Mon, 1 Oct 2012 06:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 1 Oct 2012 Volume: 11 Number: 3788
Today's topics:
Re: Database usage best practices <rweikusat@mssgmbh.com>
Why "Wide character in print"? <tomeuari@gmail.com>
Re: Why "Wide character in print"? <rweikusat@mssgmbh.com>
Re: Why "Wide character in print"? (Alan Curry)
Re: Why "Wide character in print"? <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 Sep 2012 16:12:35 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Database usage best practices
Message-Id: <87pq53ee8s.fsf@sapphire.mobileactivedefense.com>
Mladen Gogala <gogala.mladen@gmail.com> writes:
> On Fri, 28 Sep 2012 11:50:37 +0100, Rainer Weikusat wrote:
>
>> This is simply not true: Over the lifetime of a program, the amortized
>> impplementation cost of every infrastructure facility contained in it is
>> zero provided that it actually works and works as it would need to work.
>
> Rainer, I agree with you about the DB usage, I disagree about the
> ORM,
I didn't write anything about my opinion of object-relational
mapping developer support software, I just stated the fact that
'database interaction' is a relatively tiny and ancilliary part of
almost all programs which include database interactions I've either
written or encountered so far. The same happens to be true for all
other kinds of problem-independent infrastructure code: It's always
there and it is always just an insignificant amount compared with the
problem specific code and further, it is not only the smaller part but
also the part which is a lot easier to implement and get
right (I'm actually fairly convinced that such an ungodly amount of
'generalized infrastructure code' exists on the internet because
this is code dealing with inherently simple problems. Simple enough,
to be precise, that horrendously complicated ways of dealing with them
don't just collapse under their own weight, as they would if the
problem was complicated, meaning, getting half of the corner cases
which shouldn't have been lumped together to begin with more or less
subtly wrong would render the thing itself completely unusuable).
In Perl, I've so far been able to get by with using a slowly expanding
subset of the DBI functionality and the reason why I employ relational
database management systems is because the nature of a given problem
is such that doing so provides an advantage. Consequently, I don't
quite understand why I would want to use some middlewhere whose sole
purpose is to hide the RDBMS behind a simpler (and thus, less
flexible) abstraction: If 'simpler but less flexible' seems a viable
option, I can simply not use a database.
In any case, I'm convinced that learning how to employ a database
engine is well worth the effort. Eg, something Hibernate is very fond
of are n:m mapping tables linking different kinds of 'objects'
together: Since I'm not fond of dealing with this explicitly at all,
I'm always accessing the data with the help of suitably defined views
so that the database pulls the different parts together for me. I
would go so far as to say that using joins in application code is
usually a mistake: The database should be worrying about that, not
the guy who tries to make sense of the code.
------------------------------
Date: Sun, 30 Sep 2012 10:57:37 -0700 (PDT)
From: tcgo <tomeuari@gmail.com>
Subject: Why "Wide character in print"?
Message-Id: <48fb2f65-86d4-428b-b3ea-194f6cbf4d0c@googlegroups.com>
Hi!
I just made a test code with Perl, using the Pi symbol with Unicode/UTF-8. =
That's the code:
#!/usr/bin/perl
use utf8;
my $cosa =3D "Here is my =E2=98=BA r=C3=A9s=C3=BAm=C3=A9 \x{2639}!";
print "$cosa\n";
And it gives me a "warning" message: "Wide character in print at ./unicode =
line 4". After adding "binmode(STDOUT, ":utf8");" the warning disappears, b=
ut why was it showing before of adding the binmode?
Thanks!
~tcgo~
------------------------------
Date: Sun, 30 Sep 2012 20:37:49 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Why "Wide character in print"?
Message-Id: <87bognwbci.fsf@sapphire.mobileactivedefense.com>
tcgo <tomeuari@gmail.com> writes:
> I just made a test code with Perl, using the Pi symbol with
> Unicode/UTF-8. That's the code:
>
> #!/usr/bin/perl
> use utf8;
> my $cosa = "Here is my ☺ résúmé \x{2639}!";
> print "$cosa\n";
>
> And it gives me a "warning" message: "Wide character in print at
> ./unicode line 4". After adding "binmode(STDOUT, ":utf8");" the
> warning disappears, but why was it showing before of adding the
> binmode?
Because the people who nowadays work on perl unicode support have
decided that it should behave as if the encoding used by it was some
super secret sauce shrouded in eternal mystery: All data flowing into
a Perl program is supposed to be converted to this super secret
internal mystery encoding before being used and all data flowing out
of a Perl program is supposed to be converted to something software
other than perl understands beforehand. De facto, the situation is
such that everything is fine when perl is used in an environment where
UTF-8 is the 'native' method for supporting wide characters because
this is also what perl uses itself, and anyone using something
else is essentially fucked. De jure, perl is supposed to be nasty to
everyone, or at least try as hard as possible without breaking
backwards compatibility.
------------------------------
Date: Sun, 30 Sep 2012 20:00:23 +0000 (UTC)
From: pacman@kosh.dhis.org (Alan Curry)
Subject: Re: Why "Wide character in print"?
Message-Id: <k4a8cn$rk$1@speranza.aioe.org>
In article <48fb2f65-86d4-428b-b3ea-194f6cbf4d0c@googlegroups.com>,
tcgo <tomeuari@gmail.com> wrote:
>Hi!
>I just made a test code with Perl, using the Pi symbol with
>Unicode/UTF-8. That's the code:
>
>#!/usr/bin/perl
>use utf8;
>my $cosa = "Here is my ☺ résúmé \x{2639}!";
>print "$cosa\n";
>
>And it gives me a "warning" message: "Wide character in print at
>./unicode line 4". After adding "binmode(STDOUT, ":utf8");" the warning
>disappears, but why was it showing before of adding the binmode?
The binmode documents your assumption that nobody will ever run your program
on a non-UTF8-mode terminal.
--
Alan Curry
------------------------------
Date: Sun, 30 Sep 2012 22:25:38 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Why "Wide character in print"?
Message-Id: <slrnk6ham2.pj1.hjp-usenet2@hrunkner.hjp.at>
On 2012-09-30 17:57, tcgo <tomeuari@gmail.com> wrote:
> I just made a test code with Perl, using the Pi symbol with
> Unicode/UTF-8. That's the code:
>
> #!/usr/bin/perl
> use utf8;
> my $cosa = "Here is my ☺ résúmé \x{2639}!";
> print "$cosa\n";
>
> And it gives me a "warning" message: "Wide character in print at
> ./unicode line 4". After adding "binmode(STDOUT, ":utf8");" the
> warning disappears, but why was it showing before of adding the
> binmode?
Because, unless you tell it with binmode, Perl doesn't know what
encoding it is supposed to use. It could get the encoding from the
locale settings, but that would only work for text written to a
terminal, not for arbitrary data written to a file, so perl doesn't
make assumptions and asks you to set the encoding explicitely.
(If you want to get the encoding from the locale, use I18N::Langinfo,
unfortunately this doesn't work on all platforms (at least it didn't
work on Windows last time I looked, but that was a few years ago)
hp
--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Bill Code on asrg@irtf.org
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 3788
***************************************