Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Perl, Gtk2 and locale — a bit of a mess

by Khen1950fx (Canon)
on Jul 11, 2013 at 23:20 UTC ( #1043834=note: print w/ replies, xml ) Need Help??

in reply to Perl, Gtk2 and locale — a bit of a mess

It don't see it as a problem with locales. For example, try this:

#!/usr/bin/perl -l use strict; use warnings; my $num = 123.456; str($num); sub str { my ($want_num, $width) = @_; $width = '000'; $want_num =~ tr/./,/; $want_num = print "$want_num$width"; }
Does that work for you?

Comment on Re: Perl, Gtk2 and locale — a bit of a mess
Download Code
Reaped: Re^2: Perl, Gtk2 and locale — a bit of a mess
by NodeReaper (Curate) on Jul 12, 2013 at 08:04 UTC
      I'm tired of considering such posts to be reaped.

      If there is a general problem with the quality of Khen's post, than you'll certainly be able to link to some discussions proving it, without calling him names.

      Otherwise I (and others following my considerations) have to continue to treat you like a troll.

      Tolerating AnoMonks spreading insults w/o giving any context opens the door to any troll/mobbing campaign.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        The tone and attitude of the post in question aside — where I do agree that it was more ad hominem than asked for —, it seems that Khen gets into trouble fairly often. While I am not in a position to judge anyone, there probably is a good reason for it. Maybe indeed that he doesn’t pay attention to what he’s answering to or what he posts.

        If there is a general problem with the quality of Khen's post

        What do you mean if ? Sometimes your command of English grammar/vocabulary appears expert, other times...

        Just read the OP and read what Khen1950fx wrote -- the reply is essentially:

        I scan your question for at most three keywords, and I ignore your question, and I offer you copy/paste/cargocult thats irrelevant to the problem you're trying to solve, does that help?

        I first noticed Khen1950fxs wisdom in 2009, and spelling this out repeatedly is boring, and it just gets considered trolling or insults

        Linking to previous instances is dubbed metatrolling or personal attack

        Doing what Ralesk did is pointless waste of time because
        Khen1950fx doesn't much care about the copy/paste he posts; nothing changes;
        Doesn't matter how factually you refute Khen1950fxs noise, what kind of language you use, if Anonymous Monk does it, LanX will consider it "troll! personal attacks" and most recently "mobbing" -- I had to look that up -- what a brilliant propaganda

        So thanks for that. I now feel better about posting pure-insults directed only at Khen1950fxs and not his "wisdom"; no I won't go nuts and respond to every one of his nodes, but if I come accorss an obvious one, I will

Re^2: Perl, Gtk2 and locale — a bit of a mess
by Ralesk (Pilgrim) on Jul 12, 2013 at 09:46 UTC

    I'm not even sure what you're trying to achieve here.

    • Call str with one argument, but assign @_ to two arguments, thus rendering the second one undef
    • Then you assign to the second var anyway. Fine, I guess, but I would have done something like
      sub str { my ($want_num) = @_; my $width = '000'; # ...
    • Then you replace periods in the string representation of 123.456 (which could be "123,456" or even "١٢٣٫٤٥٦" by this time) with commas, resulting in not much.
    • And then print whatever the replaced result is (let’s say "123,456") concatenated with "000" (why is that even called ‘width’?), resulting in an output of 123,456000.
    • Then you put the return value of that print in $want_num for not much reason, as print returns true on a successful print, and the value doesn’t escape the subroutine anyway.
    • str and thus the whole program then returns true after printing the above value.

    Pray tell, what did you want to achieve?

      (I am not at all surprised that this never received further comments :3)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043834]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-06-03 08:34 GMT
Find Nodes?
    Voting Booth?

    What kind of chocolate gives you the most pleasure?

    Results (125 votes), past polls