Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Re: using HTML::Template effectively

Reply
Thread Tools

Re: using HTML::Template effectively

 
 
Rainer Weikusat
Guest
Posts: n/a
 
      06-27-2012
Ben Morrow <(E-Mail Removed)> writes:

[...]

>> It's too much work cleaning up after the nasal demons when they get on
>> your keyboard.

>
> 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).


It is generally impossible to 'do something undefined' (although
certain people who frequent C-related newsgroups apparently can't ever
get the meaning of this adjective into their head). When the C
standard states that 'in such-and-such a case, the behaviour is
undefined', this is defined as 'the C standard imposes no requirements
for this situation', or, in other words, it contains no specific
information regarding it. Insofar such information is desired, it can
usually be obtained in some other way. A C implementation which would
cause a computer to turn into a dancing icebear in some situation where
the C standard 'leaves the behaviour undefined' would not be
considered non-compliant because of this. But this doesn't mean it
such an implementation is possible and completely wild speculations
of this kind belong in the realm of fiction.

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.
 
Reply With Quote
 
 
 
 
Justin C
Guest
Posts: n/a
 
      06-29-2012
On 2012-06-29, Cal Dershowitz <(E-Mail Removed)> wrote:
>
> What is FUD?


http://lmgtfy.com/?q=fud&l=1


Justin.

--
Justin C, by the sea.
 
Reply With Quote
 
 
 
 
Randal L. Schwartz
Guest
Posts: n/a
 
      06-29-2012
>>>>> "Ben" == Ben Morrow <(E-Mail Removed)> writes:

Ben> In this case, I presume there was an idea at some point that sort in
Ben> scalar (void?) context could be used to sort an array in place, and
Ben> rather than explain that properly someone thought it would be better
Ben> just to throw some 'undefined's around. In fact, I very much doubt this
Ben> will ever happen, given that

Ben> @ary = sort @ary;

Ben> is already optimised to sort in place.

There was also a patch submitted at one time (tongue-in-cheek) to have
sort in a scalar context invoke "nethack", based on a sentence in one of
the early editions of Learning Perl.

print "Just another Perl hacker,"; # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<(E-Mail Removed)> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
 
Reply With Quote
 
Randal L. Schwartz
Guest
Posts: n/a
 
      07-04-2012
>>>>> "Cal" == Cal Dershowitz <(E-Mail Removed)> 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
<(E-Mail Removed)> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
 
Reply With Quote
 
Ivan Shmakov
Guest
Posts: n/a
 
      07-07-2012
>>>>> Cal Dershowitz <(E-Mail Removed)> writes:

[...]

> 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.


Depending on the task, I'd generate a wide enough random number
(or a UUID), and encode it with a Base32 variant, such as the
Crockford's one. Like, e. g.:

#!/usr/bin/perl

use strict;
use warnings;

require Convert::Base32::Crockford;
require UUID;

UUID::generate (my $uuid);
UUID::unparse ($uuid, my $s);
my $fn
= Convert::Base32::Crockford::encode_base32 ($uuid);
print ($fn, "\n");

Then, when looking the file up by the user's supplied name, I'd
convert the latter into upper case, and replace [oO] with 0 and
[iIlL] with 1.

Alternatively, the RFC 4648 Base32 variant may be used, which
includes B but not 8 (which could be confused with the former.)

http://en.wikipedia.org/wiki/Base32

[...]

--
FSF associate member #7257
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: using cpan effectively Rainer Weikusat Perl Misc 1 09-04-2012 02:36 PM
Re: using cpan effectively Mart van de Wege Perl Misc 6 08-26-2012 10:29 AM
Re: using HTML::Template effectively Peter Makholm Perl Misc 0 06-27-2012 07:25 AM
Re: using HTML::Template effectively J. Gleixner Perl Misc 0 06-26-2012 08:25 PM
Effectively using Magic and Range in Runescape virgolds_comrsgold Computer Support 0 06-11-2007 08:20 AM



Advertisments