[32838] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4103 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 29 09:09:32 2013

Date: Sun, 29 Dec 2013 06:09:05 -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           Sun, 29 Dec 2013     Volume: 11 Number: 4103

Today's topics:
    Re: Can't locate object method "new" via package <news@lawshouse.org>
    Re: How does the perl debugger find the source lines <ben@morrow.me.uk>
    Re: PDL Questions - Dec. 21, 2013 <edgrsprj@ix.netcom.com>
    Re: PDL Questions - Dec. 21, 2013 <edgrsprj@ix.netcom.com>
    Re: PDL Questions - Dec. 21, 2013 <edgrsprj@ix.netcom.com>
    Re: PDL Questions - Dec. 21, 2013 <news@lawshouse.org>
    Re: PDL Questions - Dec. 21, 2013 <rweikusat@mobileactivedefense.com>
    Re: PDL Questions - Dec. 21, 2013 <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: PDL Questions - Dec. 21, 2013 <jurgenex@hotmail.com>
    Re: PDL Questions - Dec. 21, 2013 <jurgenex@hotmail.com>
    Re: PDL Questions - Dec. 21, 2013 <vilain@NOspamcop.net>
    Re: Question about language setting <dave@invalid.invalid>
    Re: Question about language setting <martin.gieretz@web.de>
    Re: Question about language setting <dave@invalid.invalid>
    Re: Question about language setting <dave@invalid.invalid>
    Re: Syntax understanding problem <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 29 Dec 2013 11:58:35 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Can't locate object method "new" via package
Message-Id: <cImdnTd2bdL2k13PnZ2dnUVZ8oidnZ2d@giganews.com>

On 20/12/13 11:16, Henry Law wrote:
> small virtual coffee bet that this is one of the threads where the OP
> never shows up again.

What a shame nobody took me up on my bet ...

I find it strange that people could post on "a board" or "a list" as 
they might call it, and never even /acknowledge/ that people responded 
to their request in a helpful sort of way.  Or is it just me?

-- 

Henry Law            Manchester, England


------------------------------

Date: Sun, 29 Dec 2013 00:30:55 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How does the perl debugger find the source lines
Message-Id: <v274pa-g15.ln1@anubis.morrow.me.uk>


Quoth "Peter J. Holzer" <hjp-usenet3@hjp.at>:
> I'm currently writing a plugin for qpsmtpd, which means that both the
> plugin and the tests are read from a file, massaged a bit, compiled via
> eval() and finally the test framework calls the test methods. 
> 
> This seems to confuse the debugger a bit, because it looks like this:
[...]
> 
> The interesting thing is that it shows the correct source file
> ("t/plugin_tests/no_bcc") and the correct line numbers (9, 11, 12), but
> not the contents of the lines, which look like this:
> 
>   9     my ($self) = @_;
>  10 
>  11     my $qp = $self->qp;
>  12     $qp->command("rset");
> 
> So, if the debugger knows the file and the line, why can't it display
> the content?

I'll see if I can come up with a more intelligent answer later, but to
start with you might want to read perldoc perl5db.pl (particularly 'DATA
STRUCTURES MAINTAINED BY CORE'), the entry for $^P in perlvar, and
perhaps perldoc perldebguts.

Alternatively you might want to find a way to avoid using the debugger.
IME it causes more problems than it solves; for interactive debugging I
find Devel::REPL useful.

Ben



------------------------------

Date: Fri, 27 Dec 2013 13:13:42 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <toWdnRKvId3DTCDPnZ2dnUVZ_oSdnZ2d@earthlink.com>

"E.D.G." <edgrsprj@ix.netcom.com> wrote in message 
news:MKGdnZku9IpnWSjPnZ2dnUVZ_oqdnZ2d@earthlink.com...

       The PDL module did finally start running.  However, although I could 
get it to do a few simple things I could not get it to generate plots using 
commands such as "points" or "line."

       So, something is still not working correctly.

       If there are any people who are successfully using Perl with the PDL 
module on a Windows system then I would be interested in hearing from them. 
There are apparently a few steps that still need to get done for the PDL 
module to be fully operational.

       ActiveState Perl is being used.  And just to get PDL fully 
operational I can use any version.

      Windows XP and Vista (32 bit) are the most important operating systems 
for this effort.  Windows 7 and 8 are also available with 64 bit Windows.


      The following discusses the importance of this effort.

       As stated in another post, I frequently send governments and NGOs 
free advice regarding how they might develop technologies etc. that would 
enable them to save lives, improve our health, and build stronger economies. 
That advise has been used extensively over the years.

       The following is an indirect address for one of my most important 
present projects.  I use Freewebs addresses like that in an effort to keep 
Web site related spam to a minimum.  I don't try to get some type of credit 
by having people go through a Freewebs site.

http://www.freewebs.com/eq-forecasting/DSTA.html

       That is a current effort that involves attempts to get governments 
and major NGOs such as the United Nations to each develop its own 
"Department of Science and Technology" so that we have fewer of these 
Medicare Web site problems, major oil spills, and nuclear power plant 
meltdowns.

       Part of that effort will be providing governments etc. with 
recommendations regarding reliable computer programming languages.  Elected 
officials generally don't know anything about computer programming.  And in 
many cases they apparently don't even know how to ask programmers to do some 
work for them and what can and cannot be done using computers and Web site 
based programs.

       So, part of my interest in PDL is related to that effort.

       Python and Fortran look dependable and versatile enough to be 
regarded as reliable.  Perl is undoubtedly reliable for expert, professional 
Perl programmers.  But if beginning and intermediate level programmers such 
as myself can't get important parts of Perl running without a tremendous 
amount of trouble then I am not planning to recommend it to anyone as a 
"reliable" language.

       Discussions are presently being held with Julia language experts to 
see what the language offers.  It appears to be quite powerful.  It 
reportedly even has a "sleep" command built into it.  There is also a Julia 
IRC channel where questions can be asked and a GitHub Web site blog.

       But it looks like Julia might still be something of a development 
project that might not yet have all of the support that a totally reliable 
language needs.

       As I said, governments have made a lot of major decisions based on my 
advice in the past.  And I have quite a few projects I am recommending to 
them that would involve a lot of computer programmers.  It still needs to be 
determined if Perl will have a role in any of those projects.

These are personal opinions.



------------------------------

Date: Fri, 27 Dec 2013 13:18:03 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <r8adnWWK_-z_TyDPnZ2dnUVZ_rCdnZ2d@earthlink.com>

"E.D.G." <edgrsprj@ix.netcom.com> wrote in message 
news:toWdnRKvId3DTCDPnZ2dnUVZ_oSdnZ2d@earthlink.com...

The Web site address in the above note was a typo.  The correct one is:

http://www.freewebs.com/eq-forecasting/DSAT.html



------------------------------

Date: Fri, 27 Dec 2013 13:38:01 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <yoOdnUBR--ONSiDPnZ2dnUVZ_o2dnZ2d@earthlink.com>

"E.D.G." <edgrsprj@ix.netcom.com> wrote in message 
news:r8adnWWK_-z_TyDPnZ2dnUVZ_rCdnZ2d@earthlink.com...

       With humor intended, as the caveman said to the dinosaurs,

"Evolve or perish!"

       The dinosaurs are no more.

       That also applies to programming languages.  If they are not easily 
usable by all interested parties then their days might be numbered.  And I 
would remind the Gnuplot folks about that as well.

These are personal opinions.



------------------------------

Date: Fri, 27 Dec 2013 21:10:52 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <1J6dnTjwLoVBcSDPnZ2dnUVZ7vmdnZ2d@giganews.com>

Do you have the faintest clue about what you're talking about?

On 27/12/13 19:13, E.D.G. wrote:
>        If there are any people who are successfully using Perl with the
> PDL module on a Windows system then I would be interested in hearing
> from them. There are apparently a few steps that still need to get done
> for the PDL module to be fully operational.

There are lots of them; see http://pdl.perl.org/?page=users .  Did you 
find that page?  Did you even look for it?  Any PDL users here will be 
unlikely to respond to you because you've used up everyone's goodwill 
over the years.

Did you know there was a PDL mailing list? 
http://pdl.perl.org/?page=mailing-lists  Try them.

>        That is a current effort that involves attempts to get
> governments and major NGOs such as the United Nations to each develop
> its own "Department of Science and Technology"

Do you really believe that governments (at all levels) don't already 
have an organisation that does that?  Just as an example (because I know 
people who work there) go here http://www.governmenttechnology.co.uk/ to 
see what I mean.  Or http://www.whitehouse.gov/omb/e-gov .

> these Medicare Web site problems, major oil spills, and nuclear power
> plant meltdowns.

Bit of a cognitive leap there ...

>
>        Part of that effort will be providing governments etc. with
> recommendations regarding reliable computer programming languages.

Which they don't need; see above.  Where do you think ADA came from? 
Look it up.


> Elected officials generally don't know anything about computer
> programming.

Surprise!  They don't need to.  They keep cadres of professional IT 
people to do it for them.  See above.

>        Python and Fortran look dependable and versatile enough to be
> regarded as reliable.  Perl is undoubtedly reliable for expert,
> professional Perl programmers.

"Reliable" is a strange word.  What you'be been talking about so far is 
"ease of installation", by someone (i.e. you) who has displayed no 
knowledge about how computing systems work.

intermediate level
> programmers such as myself

You are not even a beginner-level.  Look in a previous post where one 
poster (really an experienced advanced-level programmer) said that your 
code would fail the entry-level examination.

  can't get important parts of Perl running
> without a tremendous amount of trouble then I am not planning to
> recommend it to anyone as a "reliable" language.
>
>        Discussions are presently being held with Julia language experts
> to see what the language offers.  It appears to be quite powerful.

You're hopelessly confused about "reliability", "power" and "ease of 
installation".

   It
> reportedly even has a "sleep" command built into it.

Sigh. http://perldoc.perl.org/functions/sleep.html  And what's with 
"reportedly"?  Have you not even bothered to look?  You remind me of one 
of the mediaeval philosophers, to whom actually looking at the real 
world to see how it worked was beneath them; instead they sat in their 
studies erecting more and more fanciful explanations for natural phenomena.

>        As I said, governments have made a lot of major decisions based
> on my advice in the past.

Really?  Since earthquake forecasting is widely held to be something as 
yet infeasible I'd be more convinced by a few examples.

I've left you off my killfile because I'm fascinated at the level of 
your self-delusion; but I think I might have had enough now.

-- 

Henry Law            Manchester, England


------------------------------

Date: Fri, 27 Dec 2013 21:31:57 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <87bo02kmk2.fsf@sable.mobileactivedefense.com>

"E.D.G." <edgrsprj@ix.netcom.com> writes:

[...]

>       Python and Fortran look dependable and versatile enough to be
> regarded as reliable.  Perl is undoubtedly reliable for expert,
> professional Perl programmers.  But if beginning and intermediate
> level programmers such as myself can't get important parts of Perl
> running without a tremendous amount of trouble

I started to use Perl around the mid-nineties, with no prior programming
experience except as a (teenage - early 20s) hobbyist using Turbo Pascal
for DOS and a little bit of C++ for Windows and OS/2[*] and while I
gladly restricted myself to the more shallow areas, I found using the
language to accomplish what I wanted to accomplish (which was not
necessarily always a sensible or even just remotely viable way to
accomplish what I should have accomplished) no great obstacle.

[*] I also implemented a few intolerably slow OO-systems using some Lisp
implementation which worked on DOS.


------------------------------

Date: Fri, 27 Dec 2013 22:13:36 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <gp62paxrr8.ln2@goaway.wombat.san-francisco.ca.us>

On 2013-12-27, E.D.G. <edgrsprj@ix.netcom.com> wrote:
> Elected officials generally don't know anything about computer
> programming.

You should run for elective office.

--keith



-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



------------------------------

Date: Fri, 27 Dec 2013 23:22:20 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <e1usb9lb2n6i75l98d6tefbatmpjvngoq1@4ax.com>

Henry Law <news@lawshouse.org> wrote:
>Do you have the faintest clue about what you're talking about?
>
>On 27/12/13 19:13, E.D.G. wrote:
>>        That is a current effort that involves attempts to get
>> governments and major NGOs such as the United Nations to each develop
>> its own "Department of Science and Technology"
>
>Do you really believe that governments (at all levels) don't already 
>have an organisation that does that?  Just as an example (because I know 
>people who work there) go here http://www.governmenttechnology.co.uk/ to 
>see what I mean.  Or http://www.whitehouse.gov/omb/e-gov .

http://en.wikipedia.org/wiki/United_Nations_University_International_Institute_for_Software_Technology
http://www.bmbf.de/en/
http://en.wikipedia.org/wiki/Department_of_Scientific_and_Industrial_Research
(very incomplete)
and many, many others

>>        Part of that effort will be providing governments etc. with
>> recommendations regarding reliable computer programming languages.

Blind man recommending colors?

>>        Python and Fortran look dependable and versatile enough to be
>> regarded as reliable.  

There's an interesting revelation. "Dependable" + "versatile" equals
"reliable". I am sure you can point to some research papers to support
this conclusion? 
And other research papers more recent than three decades old that show
Fortran as versatile? 


>You're hopelessly confused about "reliability", "power" and "ease of 
>installation".

and about many, many other things.

>>        As I said, governments have made a lot of major decisions based
>> on my advice in the past.

Well, that may finally explain why they made so many bad decisions.

jue


------------------------------

Date: Fri, 27 Dec 2013 23:23:48 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <v1vsb9p5p6fg0qd14lsl01q4gqrtiti4t3@4ax.com>

Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
>On 2013-12-27, E.D.G. <edgrsprj@ix.netcom.com> wrote:
>> Elected officials generally don't know anything about computer
>> programming.
>
>You should run for elective office.

He sure is superbly qualified: no clue, but convinced the world is
desperately waiting for him.

jue


------------------------------

Date: Sat, 28 Dec 2013 15:03:18 -0800
From: Michael Vilain <vilain@NOspamcop.net>
Subject: Re: PDL Questions - Dec. 21, 2013
Message-Id: <vilain-A3BF24.15031828122013@news.individual.net>

In article <e1usb9lb2n6i75l98d6tefbatmpjvngoq1@4ax.com>,
 J?rgen Exner <jurgenex@hotmail.com> wrote:

> Henry Law <news@lawshouse.org> wrote:
> >Do you have the faintest clue about what you're talking about?
> >
> >On 27/12/13 19:13, E.D.G. wrote:
> >>        That is a current effort that involves attempts to get
> >> governments and major NGOs such as the United Nations to each develop
> >> its own "Department of Science and Technology"
> >
> >Do you really believe that governments (at all levels) don't already 
> >have an organisation that does that?  Just as an example (because I know 
> >people who work there) go here http://www.governmenttechnology.co.uk/ to 
> >see what I mean.  Or http://www.whitehouse.gov/omb/e-gov .
> 
> http://en.wikipedia.org/wiki/United_Nations_University_International_Institute
> _for_Software_Technology
> http://www.bmbf.de/en/
> http://en.wikipedia.org/wiki/Department_of_Scientific_and_Industrial_Research
> (very incomplete)
> and many, many others
> 
> >>        Part of that effort will be providing governments etc. with
> >> recommendations regarding reliable computer programming languages.
> 
> Blind man recommending colors?
> 
> >>        Python and Fortran look dependable and versatile enough to be
> >> regarded as reliable.  
> 
> There's an interesting revelation. "Dependable" + "versatile" equals
> "reliable". I am sure you can point to some research papers to support
> this conclusion? 
> And other research papers more recent than three decades old that show
> Fortran as versatile? 
> 
> 
> >You're hopelessly confused about "reliability", "power" and "ease of 
> >installation".
> 
> and about many, many other things.
> 
> >>        As I said, governments have made a lot of major decisions based
> >> on my advice in the past.
> 
> Well, that may finally explain why they made so many bad decisions.
> 
> jue

I've held off recommending this, but I think the OP should try 
implementing this on his home systems. If he fails, we know where he 
stands.  Or in this case, sits.

http://azac.pl/cobol-on-wheelchair/

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]




------------------------------

Date: Fri, 27 Dec 2013 14:41:19 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Question about language setting
Message-Id: <fV45K0OBJxbE-pn2-qEFdJJNUdjo8@paddington.bear.den>

On Fri, 27 Dec 2013 13:58:43 UTC, Rainer Weikusat 
<rweikusat@mobileactivedefense.com> wrote:

> 
> If it doesn't, in particular, if there's a dot instead of a comma in the
> second line, setlocale doesn't work as it is supposed to and if you
> can't switch from English to German in this way, chances are very high
> that switching from German to English also won't work.
>  

It would appear we have the same or very similar problem with 
setlocale() as reported upthread. It is being looked into. FWIW I now 
have the original error in text form:

Feature bundle "5.0.0" is not supported by Perl 5.10.0 at 
D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 207
	feature::croak('Feature bundle "5.0.0" is not supported by Perl 
5.10.0') called at D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 201
	feature::unknown_feature_bundle(5.0.0) called at 
D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 152
	feature::import('feature', ':5.0.0') called at 
D:/PROGRAMS/PERL/LIB/5.10.0/Exporter.pm line 3
	Exporter::BEGIN() called at D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm 
line 0
	eval {...} called at D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 0
	require Exporter.pm called at D:/PROGRAMS/PERL/LIB/5.10.0/Carp.pm 
line 14
	require Carp.pm called at c:\progr\pmmail3\bin\pmmail_folder_check.pl
line 13
	main::BEGIN() called at D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 0
	eval {...} called at D:/PROGRAMS/PERL/LIB/5.10.0/feature.pm line 0
BEGIN failed--compilation aborted.
Compilation failed in require at D:/PROGRAMS/PERL/LIB/5.10.0/Carp.pm 
line 14.
Compilation failed in require at 
c:\progr\pmmail3\bin\pmmail_folder_check.pl line 13.
BEGIN failed--compilation aborted at 
c:\progr\pmmail3\bin\pmmail_folder_check.pl line 13.

The only difference between this and the stripped down code  I posted 
earlier is that this script starts with ten comment lines so 13 above 
is my test's 3. ie the use Carp; line.


-- 
Regards
Dave Saville


------------------------------

Date: Fri, 27 Dec 2013 15:59:11 +0100
From: Martin Gieretz <martin.gieretz@web.de>
Subject: Re: Question about language setting
Message-Id: <bi5itvFkhviU1@mid.individual.net>

Am 24.12.2013 11:39, schrieb Dave Saville:
> On Mon, 23 Dec 2013 23:14:54 UTC, "Peter J. Holzer"
> <hjp-usenet3@hjp.at> wrote:
>
>> On 2013-12-23 22:50, Rainer Weikusat <rweikusat@mobileactivedefense.com> wrote:
>>> "Peter J. Holzer" <hjp-usenet3@hjp.at> writes:
>>>> On 2013-12-23 15:39, Dave Saville <dave@invalid.invalid> wrote:
>>>>> He now says
>>>>>
>>>>> <qoute>
>>>>> the perl problem seems to be solved: it's not a problem with
>>>>> installation or version. The problem is the setting for "LANG": It has
>>>>> to be LANG=en_US.UTF-8 and not LANG=de_DE_EURO which is the standard
>>>>> for german!
>>>>> </quote>
>>>>>
>>>>> Surely (base) perl modules aren't dependent on language?
>>>>
>>>> They shouldn't be. It might be a bug in perl, in the module or in a
>>>> system library. Or it might be a bug in your script. It is impossible to
>>>> tell with the information you have given.
>>>
>>> Considering the statement from 'the user', this must be something which
>>> causes the behaviour of some perl code to change because it is using a
>>> German locale. Considering what is in a locale definition, this makes
>>> LC_NUMERIC the most likely candidate, especially considering that this
>>> is the only locale-information used as part of version checking (by
>>> Perl_upg_version in util.c).
>>
>> Yes, I know. But I couldn't reproduce it. And that's not very
>> surprising: Many people use perl with a German locale, so it can't be
>> something generic like "perl doesn't work with a German locale" or "use
>> feature doesn't work with a German locale". It has to be something more
>> specific, like a bug in the locale implementation of the user's system
>> (but Dave hasn't told us what system it is) or the way a certain feature
>> is used (but Dave hasn't told us anything about his script). But it is
>> impossible to find out what it is unless Dave volunteers more
>> information.
>
> A little difficult to post extra info from the user as I only have a
> jpeg of the errors rather than something I can cut and paste :-(
>
> The script starts:
>
> use strict;
> use warnings;
> use Carp:
> use Encode;
>
> Compilation failed in require at .... line 3 - ie the "use Carp" line.
>
> System is OS/2 his perl is 5.10.0. (Yes I know :-) )
>
> If you follow the links from the posted forum you end up with a C test
> program. I have built that on my system but as I am in the UK my
> system is defaulting to using a 'point' anyway. I have yet to persuade
> it to start up in a different locale. I know how to get a program to
> use a different language but that does not seem to help. I have posted
> this problem to an OS/2 tech group in the hope they may throw some
> light on the problem - assuming it is a similar one in that
> setlocale() is not working correctly as per the forum post.
>

i have not read the whole tread,
but how about using 'use Carp;' instead of 'use Carp:'?
                              ^

bye
    M



------------------------------

Date: Fri, 27 Dec 2013 17:51:06 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Question about language setting
Message-Id: <fV45K0OBJxbE-pn2-nJ7VsxpQQL1c@paddington.bear.den>

On Fri, 27 Dec 2013 14:59:11 UTC, Martin Gieretz 
<martin.gieretz@web.de> wrote:

<snip>
> 
> i have not read the whole tread,
> but how about using 'use Carp;' instead of 'use Carp:'?
>                               ^

Which would throw a syntax error not what we are seeing - My bad I 
just typed the three "use" lines into the mail, not copy/paste. 

-- 
Regards
Dave Saville


------------------------------

Date: Sun, 29 Dec 2013 13:00:23 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Question about language setting
Message-Id: <fV45K0OBJxbE-pn2-HCFuiddMDIhI@paddington.bear.den>

On Fri, 27 Dec 2013 13:58:43 UTC, Rainer Weikusat 
<rweikusat@mobileactivedefense.com> wrote:

> "Dave Saville" <dave@invalid.invalid> writes:
> > On Mon, 23 Dec 2013 23:14:54 UTC, "Peter J. Holzer" 
> > <hjp-usenet3@hjp.at> wrote:
> >> On 2013-12-23 22:50, Rainer Weikusat <rweikusat@mobileactivedefense.com> wrote:
> >> > "Peter J. Holzer" <hjp-usenet3@hjp.at> writes:
> >> >> On 2013-12-23 15:39, Dave Saville <dave@invalid.invalid> wrote:
> >> >>> He now says
> >> >>>
> >> >>><qoute>
> >> >>> the perl problem seems to be solved: it's not a problem with 
> >> >>> installation or version. The problem is the setting for "LANG": It has
> >> >>> to be LANG=en_US.UTF-8 and not LANG=de_DE_EURO which is the standard 
> >> >>> for german!
> >> >>></quote>
> >> >>>
> 
> [...]
> 
> >> > Considering the statement from 'the user', this must be something which
> >> > causes the behaviour of some perl code to change because it is using a
> >> > German locale. Considering what is in a locale definition, this makes
> >> > LC_NUMERIC the most likely candidate,
> 
> [...]
> 
> >> Yes, I know. But I couldn't reproduce it. And that's not very
> >> surprising: Many people use perl with a German locale, so it can't be
> >> something generic like "perl doesn't work with a German locale" or "use
> >> feature doesn't work with a German locale". It has to be something more
> >> specific, like a bug in the locale implementation of the user's system
> 
> [...]
> 
> > A little difficult to post extra info from the user as I only have a 
> > jpeg of the errors rather than something I can cut and paste :-(
> >
> > The script starts:
> >
> > use strict;
> > use warnings;
> > use Carp:
> > use Encode;
> >
> > Compilation failed in require at .... line 3 - ie the "use Carp" line.
> >
> > System is OS/2 his perl is 5.10.0. (Yes I know :-) )
> >
> > If you follow the links from the posted forum you end up with a C test
> > program. I have built that on my system but as I am in the UK my 
> > system is defaulting to using a 'point' anyway. I have yet to persuade
> > it to start up in a different locale.
> 
> According to some more searching around on the web, the OS/2 command to
> set a locale is (example)
> 
> set lang=de_DE
> [http://www.borgendale.com/locale.htm]
> 
> Results as to whether or not setlocale works on OS/2 are somewhat
> unclear. Assuming your system starts with 'English' language settings,
> you could use a modified test program,
> 
> -----------
> #include <locale.h>
> #include <stdio.h>
> 
> int main(void) {
>     printf("%f\n",2.5);
>     setlocale(LC_NUMERIC, "de_DE");
>     printf("%f\n",2.5);
>     setlocale(LC_NUMERIC, "C");
>     printf("%f\n",2.5);
> 
>     return 0;
> }
> -----------
> 
> this should print (possibly with variations in the number of trailing
> zeroes)
> 
> 2.500000
> 2,500000
> 2.500000
> 
> If it doesn't, in particular, if there's a dot instead of a comma in the
> second line, setlocale doesn't work as it is supposed to and if you
> can't switch from English to German in this way, chances are very high
> that switching from German to English also won't work.

Interestingly:

use strict;
use warnings;
use Carp;

printf("%f\n", 2.5);

Using perl 5.16.0

[T:\tmp]try.pl
Invalid version format (non-numeric data) at 
u:/perl5/lib/5.16.0/Carp.pm line 3.

BEGIN failed--compilation aborted at u:/perl5/lib/5.16.0/Carp.pm line 
3.
Compilation failed in require at try.pl line 3.
BEGIN failed--compilation aborted at try.pl line 3.

Carp line 3 says { use 5.006; }

Using perl 5.8.2

[T:\tmp]try.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "de_DE_EURO"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
2.500000

Which is a darn site more useful IMHO.

As the OS/2 setlocale() seems to suffer the same problem as the other 
OS above is there a perlish way around this one?

The problem I have is that I am comparing strings from two sources. 
One where the string is in the local code page and the other in utf8. 
I solved this by using Encode and friends but that introduces the 
requirement for Carp and the above error :-(

-- 
Regards
Dave Saville


------------------------------

Date: Sun, 29 Dec 2013 00:13:23 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Syntax understanding problem
Message-Id: <3264pa-g15.ln1@anubis.morrow.me.uk>


Quoth tmcd@panix.com:
> 
> An assignment statement returns a value:
> 
> $ perl -e 'print ($x = 23, "\n")'
> 23

This is what allows statements like

    $x = $y = 1;

to work: = is right associative, so this parses as

    $x = ($y = 1);

and $x is assigned the return value of ($y = 1), which is 1.

> So in
> 
> >/^Relayed message/ and $discard = 0, next;
> 
> the assignment gets done and $discard is set to 0.  It's just that the
> 0 return value coming out of the assignment is discarded.

Specifically, that = operator returns $discard, as a modifiable lvalue.
This is different from (say) C, where the return value of = is the RHS
(an unmodifiable rvalue). This is what makes the idiomatic construction

    (my $x = $y) =~ s/foo/bar/;

possible: first $y is copied to $x, then the = returns $x, then the =~
applies the s/// to that return value, which modifies $x but not $y. In
C an equivalent construction like

    (x = 1) = 2;

would be an error; in Perl this would set $x to 1 and then immediately
set it to 2.

[Of course, nowadays that particular idiom can be more clearly expressed
as

    my $x = $y =~ s/foo/bar/r;

which removes about the only sensible use of this feature I can think
of...]

Ben



------------------------------

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 4103
***************************************


home help back first fref pref prev next nref lref last post