[28453] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9817 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 7 14:05:52 2006

Date: Sat, 7 Oct 2006 11: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)

Perl-Users Digest           Sat, 7 Oct 2006     Volume: 10 Number: 9817

Today's topics:
        [META] Usenet and charsets (was: Re: LWP and Unicode) <rvtol+news@isolution.nl>
    Re: [META] Usenet and charsets (was: Re: LWP and Unicod <flavell@physics.gla.ac.uk>
    Re: backreference oddity <notvalid@email.com>
    Re: backreference oddity <notvalid@email.com>
    Re: backreference oddity <stan@invalid.blz/hmrprint/com.com>
    Re: backreference oddity <stan@invalid.blz/hmrprint/com.com>
    Re: backreference oddity <someone@example.com>
        Command substitution in perl <kiran.r.pillai@gmail.com>
    Re: Command substitution in perl <notvalid@email.com>
    Re: Command substitution in perl <jurgenex@hotmail.com>
    Re: Command substitution in perl yankeeinexile@gmail.com
    Re: Hard or Easy? To find string, then grab criterion m <spamhole@ntp.isc.org>
    Re: If gethostbyname fails it never recovers <hjp-usenet2@hjp.at>
    Re: Merits vs costs of Structured Programming Dogma  <hjp-usenet2@hjp.at>
    Re: newbie cspan example question <tadmc@augustmail.com>
    Re: newbie cspan example question yankeeinexile@gmail.com
    Re: newbie cspan example question <tadmc@augustmail.com>
    Re: newbie structure question <tadmc@augustmail.com>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <tadmc@augustmail.com>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <jurgenex@hotmail.com>
    Re: Regarding numeric literals <tadmc@augustmail.com>
    Re: Regarding numeric literals <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 7 Oct 2006 15:36:02 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: [META] Usenet and charsets (was: Re: LWP and Unicode)
Message-Id: <eg8hh9.1l8.1@news.isolution.nl>

Ben Morrow schreef:

> It's not a question of this group's charter, it applies generally on
> Usenet. There is no header in a Usenet article that specifies a
> charset, so no way to use anything other than the default ASCII.
>
> I agree in principle: some form of charset header should be added, or
> the charset should simply be specified to be UTF8. But until it is,
> please refrain from using it.

In practice there is no problem with headers like
"Content-Type: text/plain; charset=ISO-8859-1"
because most readers deal with them as expected.

Henry Spencer once (1994) created the Son-of-RFC-1036:
http://www.chemie.fu-berlin.de/outerspace/netnews/son-of-1036.html
to document the state of that moment, and stated MIME as relevant for
news articles.

See also USEFOR, the Grandson-of-RFC-1036:
http://www.ietf.org/html.charters/usefor-charter.html
("an urgent need has been identified to formalize and document
many of the current and proposed extensions to the Usenet
Article format")

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

Date: Sat, 7 Oct 2006 15:31:11 +0100
From: "Alan J. Flavell" <flavell@physics.gla.ac.uk>
Subject: Re: [META] Usenet and charsets (was: Re: LWP and Unicode)
Message-Id: <Pine.LNX.4.64.0610071516110.21204@ppepc87.ph.gla.ac.uk>

On Sat, 7 Oct 2006, Dr.Ruud wrote:

> In practice there is no problem with headers like
> "Content-Type: text/plain; charset=ISO-8859-1"
> because most readers deal with them as expected.

That's not the whole story: such postings should also have valid
MIME headers, or else the client is required to treat it as pre-MIME 
format, which probably isn't what was intended.  And IIRC some news
clients do indeed apply that rule.

Of course this is all de-facto, but the valid RFC for usenet (1036) is 
now hopelessly out of date, so we have to live with some de-facto 
rules.  Which can be very well based a best common factor between the 
discussions for a grandson of RFC-1036, and the observed common 
practice.  (Common practice alone isn't good enough, since some 
widely-used clients by default will violate what the rules are 
expected to become).

Personal view: I wouldn't recommend using charset=utf-8 yet, except 
perhaps on groups where its use is already widespread. iso-8859-1 is 
very widely supported, and windows-1252, although proprietary and 
therefore to be deprecated, is pretty widely supported; iso-8859-15 is 
somewhat less supported, I'm disinclined to recommend it, but I note 
that some folks use it for their usenet postings.

[ Totally OT: use of iso-8859-15 for HTML is utterly pointless. ]

IMHO and YMMV.  But successful communication depends on a certain
conservatism in what one sends - not relying on the generosity of the 
recipient to interpret it liberally.


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

Date: Sat, 07 Oct 2006 15:46:20 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: backreference oddity
Message-Id: <gZPVg.10575$e66.2707@newssvr13.news.prodigy.com>

Eric Amick wrote:

> On Fri, 06 Oct 2006 22:50:13 GMT, "A. Sinan Unur"
> <1usa@llenroc.ude.invalid> wrote:
> 
> 
>>>/(.+)\s(.+)\sXX\s([0-9)+)\s(.{\3})/
>>
>>Ahem ... Did you read the error message? Without any testing, I can see 
>>that you should havve [0-9]+ rather than the [0-9)+ you used above.
> 
> 
> Maybe this is version-dependent, but that won't do what the OP wants
> even after fixing the syntax error with [0-9). Repeat counts in curly
> brackets have to be constants.

No. They can also be variables:

   % perl -le '$_ = "aaa"; $c = 2; print $& if /a{$c}/'
   aa

--Ala



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

Date: Sat, 07 Oct 2006 15:47:47 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: backreference oddity
Message-Id: <D_PVg.10576$e66.5169@newssvr13.news.prodigy.com>

Bob Walton wrote:

> Doesn't work because of the syntax error.  And because the contents of 
> the {...} construction have to be literal digits or digits,digits .

Not true. They can be variables. See my other post in this thread.

--Ala



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

Date: Sat, 7 Oct 2006 09:28:00 -0700
From: "Stan R." <stan@invalid.blz/hmrprint/com.com>
Subject: Re: backreference oddity
Message-Id: <eg8ki901dlh@news4.newsguy.com>

poncenby wrote:
> i have a file which has lines of text with fields separated by a
> space. some of the fields are prefixed with a number and a space,
> like the line below...
>
> bar1 bar2 XX 10 bar3tooten
> foo1 foo2 XX 15 foo3uptofifteen
>
> as you can see, the numbers (10 and 15) are the length of the field
> after the number.
> so i want to use these numbers as length specifier to match the field
> after the number, with a regex like either of these:
>
> /(.+)\s(.+)\sXX\s([0-9)+)\s(.{$3})/
> /(.+)\s(.+)\sXX\s([0-9)+)\s(.{\3})/
>
> both regexs will make the program fall over when attempting to print
> $4.
>
> i've figured out a solution with a regex over two lines but am curious
> why this doesn't work.
>
> thanks in advance
>
> poncenby

This'll do the trick:

/(\S+)\s(\S+)\sXX\s([0-9]+)\s((??{".{$3}"}))/

__EXAMPLE__
#!/usr/local/bin/perl

use strict;

my $s =
   qq{bar1 bar2 XX 10 bar3tooten\n}.
   qq{foo1 foo2 XX 15 foo3uptofifteen\n};

while ($s =~ /(\S+)\s(\S+)\sXX\s([0-9]+)\s((??{".{$3}"}))/g) {
   print qq{1($1) 2($2) 3($3) 4($4)\n};
}

__OUTPUT__
1(bar1) 2(bar2) 3(10) 4(bar3tooten)
1(foo1) 2(foo2) 3(15) 4(foo3uptofifteen)

-- 
Stan 




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

Date: Sat, 7 Oct 2006 09:34:23 -0700
From: "Stan R." <stan@invalid.blz/hmrprint/com.com>
Subject: Re: backreference oddity
Message-Id: <eg8kua01dv6@news4.newsguy.com>

Ala Qumsieh wrote:
> Eric Amick wrote:
>
>> On Fri, 06 Oct 2006 22:50:13 GMT, "A. Sinan Unur"
>> <1usa@llenroc.ude.invalid> wrote:
>>
>>
>>>> /(.+)\s(.+)\sXX\s([0-9)+)\s(.{\3})/
>>>
>>> Ahem ... Did you read the error message? Without any testing, I can
>>> see that you should havve [0-9]+ rather than the [0-9)+ you used
>>> above.
>>
>>
>> Maybe this is version-dependent, but that won't do what the OP wants
>> even after fixing the syntax error with [0-9). Repeat counts in curly
>> brackets have to be constants.
>
> No. They can also be variables:
>
>   % perl -le '$_ = "aaa"; $c = 2; print $& if /a{$c}/'
>   aa

Precisely, that's why this regex works:

/(\S+)\s(\S+)\sXX\s([0-9]+)\s((??{".{$3}"}))/

See my other post for working example.
<eg8ki901dlh@news4.newsguy.com>

-- 
Stan 




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

Date: Sat, 07 Oct 2006 17:46:35 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: backreference oddity
Message-Id: <%JRVg.2821$P7.2820@edtnps90>

Ala Qumsieh wrote:
> Eric Amick wrote:
> 
>> On Fri, 06 Oct 2006 22:50:13 GMT, "A. Sinan Unur"
>> <1usa@llenroc.ude.invalid> wrote:
>>
>>
>>>> /(.+)\s(.+)\sXX\s([0-9)+)\s(.{\3})/
>>>
>>> Ahem ... Did you read the error message? Without any testing, I can
>>> see that you should havve [0-9]+ rather than the [0-9)+ you used above.
>>
>>
>> Maybe this is version-dependent, but that won't do what the OP wants
>> even after fixing the syntax error with [0-9). Repeat counts in curly
>> brackets have to be constants.
> 
> No. They can also be variables:
> 
>   % perl -le '$_ = "aaa"; $c = 2; print $& if /a{$c}/'
>   aa

Variable interpolation happens first so it is a constant when the regular
expression engine sees it.   :-)



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 7 Oct 2006 08:41:40 -0700
From: "kp" <kiran.r.pillai@gmail.com>
Subject: Command substitution in perl
Message-Id: <1160235700.826206.131650@h48g2000cwc.googlegroups.com>

My perl module file includes this line:
$HOSTNAME = "/usr/bin/hostname";

I have sourced this perl module file in my perl script.

In my perl script I have an if loop :
if ( `$HOSTNAME` eq "rsd2" ) {
  print "NFS server is fsd2";
}


However, this command substitution does not seem to work.

Any clues???

-kp



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

Date: Sat, 07 Oct 2006 15:50:03 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Command substitution in perl
Message-Id: <L0QVg.10577$e66.7486@newssvr13.news.prodigy.com>

kp wrote:

> My perl module file includes this line:
> $HOSTNAME = "/usr/bin/hostname";
> 
> I have sourced this perl module file in my perl script.
> 
> In my perl script I have an if loop :
> if ( `$HOSTNAME` eq "rsd2" ) {
>   print "NFS server is fsd2";
> }
> 
> 
> However, this command substitution does not seem to work.
> 
> Any clues???

    perldoc -q host

--Ala



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

Date: Sat, 07 Oct 2006 15:51:05 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Command substitution in perl
Message-Id: <J1QVg.3520$K11.1420@trndny07>

kp wrote:
> My perl module file includes this line:
> $HOSTNAME = "/usr/bin/hostname";
>
> I have sourced this perl module file in my perl script.
>
> In my perl script I have an if loop :
> if ( `$HOSTNAME` eq "rsd2" ) {
>  print "NFS server is fsd2";
> }
>
> However, this command substitution does not seem to work.

Try printing the result of the call, most likely it is not what you think it 
is.
    print `$HOSTNAME`;
Hint: I bet there is at least a newline at the end

jue 




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

Date: 07 Oct 2006 10:56:14 -0500
From: yankeeinexile@gmail.com
Subject: Re: Command substitution in perl
Message-Id: <871wpk3ysh.fsf@gmail.com>

"kp" <kiran.r.pillai@gmail.com> writes:

> My perl module file includes this line:
> $HOSTNAME = "/usr/bin/hostname";
> 
> I have sourced this perl module file in my perl script.
> 
> In my perl script I have an if loop :
> if ( `$HOSTNAME` eq "rsd2" ) {
>   print "NFS server is fsd2";
> }
> 

if ( `$HOSTNAME` eq "rsd2\n" ) {
  print "NFS server is rsd2";
}

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
	Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer  software  consists of  only  two  components: ones  and
zeros, in roughly equal proportions.   All that is required is to
sort them into the correct order.


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

Date: Sat, 7 Oct 2006 07:58:27 -0700
From: "Steve K." <spamhole@ntp.isc.org>
Subject: Re: Hard or Easy? To find string, then grab criterion matched lines above and below?
Message-Id: <4optkoFftfcsU1@individual.net>

Tad McClellan wrote:
>Steve Kostecke <spamtrap@ntp.isc.org> wrote:
>> "Tad McClellan" <tadmc@augustmail.com> wrote in message
>> news:slrneib43v.9e3.tadmc@magna.augustmail.com...
>>> samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:
>
>>>> At first I thought to use VBScript, but then I realized that Perl
>>>> is portable, doesn't necessarily have to  be installed on the
>>>> server, and
>>>
>>>
>>> What "server"?
>>>
>>> A server is not normally required to run Perl programs.
>>>
>>> Is this a stealth CGI question?
>>
>> His question was obviously pertaining to Perl being used for a file
>> parsing solution. The question itself had nothing to do with CGI and
>> I think you knew that.
>
>
> Yes, I did.
>
> But it appeared that the OP did not. Now he does.

What made you think he did not?? Simply because he said "server" some 
how automagically translates into your min into "web server" ? Has it 
even occurred to you he could of simply meant a remote server he has 
been working on? For instance, you SSH or Remote-Desktop/VNC in and you 
work; not exactly a new concept. This can be for any number of purposes, 
and he never said one thing abut www, web, http, nor cgi.

Lets take a look at what he DID say:

samiam@mytrashmail.com wrote:
> Hello,
>
> I know this is a trivial parse / grep job for any Perl rake worth his
> salt,

Hmm, "trivial parse / grep job ", looks right up Perl's alley.

> but does anyone have guidance on how this Perl newbie might pull
> a string from one file and use this string to pull the lines in
> another file out, and also pull the first line before (matching
> criteria) and the first line after (matching criteria.)

Text parsing stuff, still very valid for Perl, don'cha think?

> I have described this in detail below.
>
> At first I thought to use VBScript,

VBScript has many applications outside of web scripting. He makes no 
mention of web, http, or cgi so no reason to go there. (See "Scripting 
Host" on Windows.)

> but then I realized that Perl is
> portable, doesn't necessarily have to  be installed on the server, and
> probably has MUCH better string processing power than VBScript.

In this context, he could of either meant a "remove server" or he could 
of been referring to any old box. Still no mention of anything web 
related.

> I also considered grep, but still thought I could reuse the Perl
> solution in more places.

So please tell me how anything he said can be seen as a CGI question, 
and how it was even remotely fair to accuse him like you did of making a 
"stealth CGI question" when everything he wrote was HOW to do some 
"trivial parse / grep job" with Perl. Even with CGI questions it's often 
been said it will go answered if the question is still _directed_ at the 
Perl side of things, so I really see no point at all as trying to paint 
him as trying to do something wrong with words like "stealth", as if 
you're just simply witch hunting. 




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

Date: Sat, 7 Oct 2006 14:55:45 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: If gethostbyname fails it never recovers
Message-Id: <slrneif8uh.b0r.hjp-usenet2@yoyo.hjp.at>

On 2006-10-07 00:21, Andrew DeFaria <Andrew@DeFaria.com> wrote:
> Mark Clements wrote:
>> Andrew DeFaria wrote:
>>> I've been having problems with my ISP. One way it seems to manifest 
>>> itself is that I can not reach or contact my ISP's DNS servers. IOW a 
>>> simply nslookup google.com will fail.
>>>
>>> So I tried writing a script that would monitor this. The script calls 
>>> gethostbyname for google.com every 15 minutes and logs the status. 
>>> When gethostbyname fails however it never comes back. My ISP and 
>>> internet connection may come back and nslookup at the command line 
>>> will work fine. But my script will report failure at the next and 
>>> following 15 minute intervals. This is very unexpected. What am I 
>>> doing wrong and is there a way to "reset" things so that it will 
>>> start working again.
>>
>> From
>>
>> perldoc - f gethostbyname
>>
>> For the gethost*() functions, if the "h_errno" variable is supported 
>> in C, it will be returned  to you via $? if the function call fails.
>>
>> It appears to be undefined as to what $? will be set to if the call 
>> *succeeds*, and thus it should not be relied upon to check for success 
>> or failure of the call.
> Well in practice it does return 0 when successful and so far 2 when not 
> successful. Once unsuccessful it keeps returning 2.

No, it doesn't. In practice, $? is not changed when gethostbyname is
successful. For example, try this:

    #!/usr/bin/perl
    use warnings;
    use strict;

    `false`;

    print "\$? after calling false: $?\n";

    my @a = gethostbyname("google.com");

    print "gethostbyname returned @{[ scalar @a - 4 ]} addresses.\n";
    print "\$? after call to gethostbyname: $?\n";

For me it prints:

    $? after calling false: 256
    gethostbyname returned 3 addresses.
    $? after call to gethostbyname: 256

256 is the expected value after invoking false. After the 
successful call to gethostbyname, $? still has the value 256.

You have to check if gethostbyname failed explicitely:

    my @a = gethostbyname("google.com");
    unless (@a) {
	handle error
    }



	hp

-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

Date: Sat, 7 Oct 2006 16:04:01 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Merits vs costs of Structured Programming Dogma 
Message-Id: <slrneifcuh.b0r.hjp-usenet2@yoyo.hjp.at>

On 2006-10-07 12:53, yankeeinexile@gmail.com <yankeeinexile@gmail.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>> On 2006-10-05 23:49, ToddAndMargo@gbis.com <ToddAndMargo@gbis.com> wrote:
>> > 1)  Under Modula2, best practice (or my practice) was from top
>> > to bottom
>> >    a) make my declarations (which variable did what, etc.),
>> >    b) write all my modules and functions, and
>> >    c) in the body, place my code.
>> >
>> > Is this also the proper structure under Perl as well?
>> 
>> I don't think so. In fact I think this is a particularly bad structure
>> and one of the reasons why I don't like Pascal-like languages is that
>> they force this structure on the programmer.
>>
>> [...snippage...]
>>
>> There are hundreds of lines of code where $some_variable could be
>> accessed and changed. When you look at the code you have no idea whether
>> you are passing the same value to do_something_with() as you received
>> from get_some_value(). $some_variable might have been changed by
>> some_code() or any function called by it. 
>
> I agree wholeheartedly with Peter's analysis.  I've recently had to do
> a major bit of coding in C after many years of full time Perl work and
> the "forced structure" grates against me - I never wrote Pascal code
> because it grated on me even when it was novel and exciting :).  

C is actually quite similar to Perl in that respect: You could always
declare variables at the start of each block, and you can declare them
in the middle of a block since C99.


> However, to play Devil's Advocate for a moment:  One of the OTHER
> dogmas of the Structured Programming Camp is:  You shouldn't have any
> block that is "hundreds of lines of code".  If you violate rule (n) of
> any set of best practices, then rule (n+1) may suddenly not make as
> much sense as it used to.  

I wasn't thinking of a single block of hundreds of lines, but of many
small subroutines. 

	hp


-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

Date: Sat, 7 Oct 2006 07:53:07 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: newbie cspan example question
Message-Id: <slrneif8pj.89h.tadmc@magna.augustmail.com>

ToddAndMargo@gbis.com <ToddAndMargo@gbis.com> wrote:

> Subject: Re: newbie cspan example question
               ^^^^^^

[ snip about 80 lines of full-quote ]


> Thank you!


Please see the Posting Guidelines that are posted here frequently.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 07 Oct 2006 09:35:23 -0500
From: yankeeinexile@gmail.com
Subject: Re: newbie cspan example question
Message-Id: <8764ew42j8.fsf@gmail.com>

Tad McClellan <tadmc@augustmail.com> writes:
> > Subject: Re: newbie cspan example question
>                ^^^^^^

I think you've hit the nail on the head :) If we all just killfile any
post with "newbie" or its variants anywhere in the header or body, the
quality of questions will rise 6dB.



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
	Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer  software  consists of  only  two  components: ones  and
zeros, in roughly equal proportions.   All that is required is to
sort them into the correct order.


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

Date: Sat, 7 Oct 2006 09:46:28 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: newbie cspan example question
Message-Id: <slrneiffe4.8kl.tadmc@magna.augustmail.com>

yankeeinexile@gmail.com <yankeeinexile@gmail.com> wrote:
> Tad McClellan <tadmc@augustmail.com> writes:
>> > Subject: Re: newbie cspan example question
>>                ^^^^^^
> 
> I think you've hit the nail on the head :) If we all just killfile any
> post with "newbie"


Many folks _do_ do that.

That is preciously why not including it in the Subject is included 
in the guidelines.

The starting point for writing the guidelines was reviewing the
killfiles of several regular posters with an aim of providing
guidelines to help avoid such a fate.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 7 Oct 2006 09:49:43 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: newbie structure question
Message-Id: <slrneiffk7.8kl.tadmc@magna.augustmail.com>

Peter J. Holzer <hjp-usenet2@hjp.at> wrote:

> I believe (and I know many other perl-programmers agree) that variables
                                   ^^^^
> should always be declared in the smallest possible scope.


I am quite sure that we needn't include that qualifier.

    Many programmers agree that variables should always be 
    declared in the smallest possible scope. 

That is just basic good Software Engineering, nothing specific
to Perl in it.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 7 Oct 2006 07:36:13 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <slrneif7pt.89h.tadmc@magna.augustmail.com>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
><tadmc@augustmail.com>], who wrote in article <45260435$0$47258$ae4e5890@news.nationwide.net>:
>>       Social faux pas to avoid
>>        - Asking a Frequently Asked Question
>>        - Asking a question easily answered by a cursory doc search
>>        - Asking for emailed answers
>>        - Beware of saying "doesn't work"
>>        - Sending a "stealth" Cc copy
> 
> This section assumes that faux pas are performed most often by
> newbies; 


I'm not seeing that, and I don't see its relevance even if true.

Asking a FAQ is bad manners whether you know that posting a FAQ
is bad manners or not.


> personally, I find this assumption unsubstantiated.


Peronally, I find your assumption regarding the assumption unsubstantiated.

:-)


> If you lurk around Usenet, you will find that people consider
> c.l.p.misc a very bad neighbornood.  I wish to disagree with them, but
> I can't.


I'd have to agree with that.


> In my optinion, the rudeness level on this newsgroup increased very
> much during the last 10 years; 


I'd have to agree with that too.


> and most of this increase is, IMO, due
> to (some) KNOWLEDGEABLE REGULARS being INTENTIONALLY rude.


IMO, most of this increase is due to the makeup of folks that
post to the newsgroup (ie. Virtual September[1]).




[1] http://www.netmeister.org/news/usenet/usenet.html
    "The September that never ended"

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 07 Oct 2006 15:25:35 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <PFPVg.1612$WD1.180@trndny04>

Tad McClellan wrote:
> Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>> In my optinion, the rudeness level on this newsgroup increased very
>> much during the last 10 years;
> I'd have to agree with that too.
>> and most of this increase is, IMO, due
>> to (some) KNOWLEDGEABLE REGULARS being INTENTIONALLY rude.
> IMO, most of this increase is due to the makeup of folks that
> post to the newsgroup (ie. Virtual September[1]).

Not to mention the purchase of DejaNews by Google and the subsequent second 
flood.
As far as Usenet is concerned  "Don't be evil." (see 
http://investor.google.com/conduct.html) most certainly does not apply.

jue 




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

Date: Sat, 7 Oct 2006 07:50:44 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regarding numeric literals
Message-Id: <slrneif8l4.89h.tadmc@magna.augustmail.com>

Peter J. Holzer <hjp-usenet2@hjp.at> wrote:

> If a numerical value is
> converted to a string and back, it should not change.


Modulo the issues of accuracy and precision.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 7 Oct 2006 19:40:17 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Regarding numeric literals
Message-Id: <slrneifpk1.kif.hjp-usenet2@yoyo.hjp.at>

On 2006-10-07 12:50, Tad McClellan <tadmc@augustmail.com> wrote:
> Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>> If a numerical value is
>> converted to a string and back, it should not change.
>
> Modulo the issues of accuracy and precision.

Well, I wrote it *should not* change, not that it *does not* change :-).

However, I believe the following statements are true:

1) It is always possible to convert a binary floating point number to a
   decimal representation, where the mathematically exact value of the
   decimal representation differs from the mathematically exact value of
   the binary number by less than 1/2 of the value of the least
   significant bit of the binary number.

2) It is always possible to convert a decimal number to a binary
   floating point number of sufficient range, so that the mathematically
   exact values of the decimal and binary numbers differ by at most
   1/2 of the value of the least significant bit of the binary number.

If both are true, than lossless conversion from binary to decimal and
back are possible. A high quality implementation of sprintf/sscanf
should get it right.

Note that neither conversion is trivial. I would not be surprised if
perl's default conversion is not lossless, especially if it depends on
routines from a platform's native library.

	hp


-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

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


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