[32464] in Perl-Users-Digest
Perl-Users Digest, Issue: 3730 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 4 21:09:17 2012
Date: Wed, 4 Jul 2012 18:09:05 -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 Wed, 4 Jul 2012 Volume: 11 Number: 3730
Today's topics:
Re: sort in scalar context; undefined behaviour in Perl <cal@example.invalid>
Re: sort in scalar context; undefined behaviour in Perl (Randal L. Schwartz)
Re: sort in scalar context; undefined behaviour in Perl <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Jul 2012 00:35:52 -0600
From: Cal Dershowitz <cal@example.invalid>
Subject: Re: sort in scalar context; undefined behaviour in Perl
Message-Id: <msOdncqeq-_UeW7SnZ2dnUVZ_hmdnZ2d@supernews.com>
On 06/29/2012 09:16 AM, Rainer Weikusat wrote:
> Ben Morrow<ben@morrow.me.uk> writes:
>> Quoth Rainer Weikusat<rweikusat@mssgmbh.com>:
>>> Ben Morrow<ben@morrow.me.uk> writes:
>>>
>>>> In principle there are no nasal demons in Perl. If perl ever does
>>>> something undefined, that's a bug in perl (or possibly in an XS module
>>>> you've loaded).
>>>
>>> That said, there's at least one case where the behaviour of perl
>>> (5.10.1) is not defined. The documentation of the sort operator states
>>> that
>>>
>>> In list context, this sorts the LIST and returns the sorted
>>> list value.In scalar context, the behaviour of "sort()" is
>>> undefined.
>>
>> sort in scalar context returns undef (and does no sorting), and has done
>> since at least 5.000 (I just checked).
>>
>> There are a small number of people in the p5p community who seem to
>> think that putting 'undefined' in the Perl documentation, rather than
>> actually documenting current and potential future behaviour, is helpful.
>> This is what you would probably call 'FUD', and in this instance I would
>> agree with you.
>
> In this instance, I wouldn't, because I never subscribed to the
> opinion that "undefined" means "some kind of nameless evil man should
> shy away from for fear for his immortal soul". In the given case, I
> would paraphrase "undefined" as "The actual behaviour is arguably not
> useful and there is no consensus regarding what kind of behaviour
> could be useful instead. Therefore, the issue is left officially
> undecided until future developments". And that seems a very
> common-sense driven approach to me.
Are things that are "illegal" in C grandfathered into perl in some
fashion? Let me ask a specific question from my misadventures in perl
autodidactics tonight.
I created such beauties tonight in what I can only call regressing:
Net::FTP=GLOB(0x83871cc)<<< 226 Transfer complete
. .. logs index.html wsb6121022001 energy green2.m4v Video 151.wmv
false.wmv vids images zen rev1.html luther1.html lh_1.html lh_17.html
lh_18.html lh_19.html ceiling_2.html ceiling_2_files {word}_2.html
{la_veta}_2.html
I seem not to have been able to find my latest working script and need
to move to different tools to get a page up that I need to do tonight.
I think Filezilla is wonderful.
Are there illegal filenames in perl? What is the character class of
legal characters in a filename?
Also, if you were going to design a character class such that it was to
be used in randomly-generating prefixes for files, which would you use?
As for me, o O 0 ~ ` < > i 1 I { } [ ] | wouldn't make the first cut.
I certainly wouldn't start a random file with an underscore. It's been
a while since I read Plauger's _The Standard C Library_, highly
recommended. Such a nice guy, he'll send you the source.
My problems with interpolation seem to continue. I have _Learning perl"
and will have plenty of time to read up there.
The monsoon began yesterday in the SW, which is very good news for
firefighting efforts. Cheers,
--
Cal
------------------------------
Date: Tue, 03 Jul 2012 23:55:03 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: sort in scalar context; undefined behaviour in Perl
Message-Id: <86ipe4dni0.fsf@red.stonehenge.com>
>>>>> "Cal" == Cal Dershowitz <cal@example.invalid> writes:
Cal> Are there illegal filenames in perl? What is the character class of legal
Cal> characters in a filename?
Perl defers those choices to the underlying operating system.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
------------------------------
Date: Wed, 4 Jul 2012 08:08:07 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: sort in scalar context; undefined behaviour in Perl
Message-Id: <nn6dc9-s07.ln1@anubis.morrow.me.uk>
Quoth Cal Dershowitz <cal@example.invalid>:
>
> I seem not to have been able to find my latest working script and need
> to move to different tools to get a page up that I need to do tonight.
> I think Filezilla is wonderful.
I found lftp useful for this sort of thing when I still did anything
over FTP.
> Are there illegal filenames in perl? What is the character class of
> legal characters in a filename?
That is entirely at the discretion of your OS. Perl just passes the
strings you give it off to the OS filesystem APIs, and passes back the
results.
On Unix systems, all 8-bit bytes are allowed in filenames except for "/"
and "\0".
> Also, if you were going to design a character class such that it was to
> be used in randomly-generating prefixes for files, which would you use?
[a-zA-Z0-9] unless I had some reason to do otherwise.
> As for me, o O 0 ~ ` < > i 1 I { } [ ] | wouldn't make the first cut.
If you're excluding lookalikes you probably want 'l' as well.
[a-hjkmnp-zA-HJKMNP-Z2-9] ought to be OK.
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 3730
***************************************