three suggestions for perl 
Author Message
 three suggestions for perl

1) Since hex escapes are now allowed in "" strings, I think they should
be allowed in regular expressions as well.  All the other "" string
escapes appear to be allowed in regular expressions.  I think it would
be much better to be able to say

        print "match\n"       if /^\x7F/;

than having to use eval:

        print "match\n"       if eval "/^\x7F/";

2) I suggest perl honor the TMPDIR environment variable.  As it is,
perl always uses /tmp, which is not always a good thing for me.
Why TMPDIR?  Lots of other programs honor it, so why be gratuitously
incompatible?

3) I suggest a new environment variable, PERLINC.  PERLINC would be a
colon-separated list of directories which perl would either (a) use

don't care which, though I think (b) would be friendlier.  Of course,

is to help out people like me who have a private perl library directory
and don't want to (or can't) write in the directory of libraries
distributed with perl.

I know I could implement it myself with a splice() as part of the
prologue to each of my scripts (indeed, the "magic" script I recently
posted does this), but it's already enough of a pain to customize the
header on each of my perl scripts.



Wed, 19 Jan 1994 02:59:31 GMT  
 three suggestions for perl

 > 3) I suggest a new environment variable, PERLINC.  PERLINC would be a
 > colon-separated list of directories which perl would either (a) use

 > don't care which, though I think (b) would be friendlier.  Of course,

 > is to help out people like me who have a private perl library directory
 > and don't want to (or can't) write in the directory of libraries
 > distributed with perl.

It's already there.. but it's called the PERLLIB environment variable.  It

Enjoy...                -jeff

Jeff Kellem



Fri, 21 Jan 1994 11:47:01 GMT  
 three suggestions for perl

Quote:

> 3) I suggest a new environment variable, PERLINC.


Quote:
>It's already there.. but it's called the PERLLIB environment variable.


Why, so it is.  However, it isn't mentioned in either the perl man page
or the index to the camel book.  For that matter, PERLDB isn't
mentioned in the man page.  Documented in the next patch, perhaps?

So now I'm down to two suggestions: allowing hex escapes in regular
expressions, and honoring TMPDIR.
--



Sat, 22 Jan 1994 03:22:30 GMT  
 three suggestions for perl

:So now I'm down to two suggestions: allowing hex escapes in regular
:expressions, and honoring TMPDIR.

When octal works, why do you need hex?  Of course, I asked this before and
people looked at me like I was from another era.  I think all these \x, \a,
and \c things are a real shame, because they steal potential user-defined
character classes from the name space and add nothing in functionality.

As for TMPDIR, isn't this only for perl -e?  If so, that can't be much
space, so what's the problem.

You could always look into implementing these yourself if you want them
badly enough and submitting them to Larry as a suggested patch.

--tom



Sat, 22 Jan 1994 04:12:25 GMT  
 three suggestions for perl

Quote:
>When octal works, why do you need hex?

Grace Murray Hopper, in the keynote address to the 1978 ACM SIGPLAN
History of Programming Languages conference:

  They were building BINAC, a binary computer.  We programmed it in
  octal.  Thinking I was still a mathematician, I taught myself to
  add, subtract, and multiply, and even divide in octal.  I was really
  good, until the end of the month, and then my checkbook didn't
  balance!  It stayed out of balance for three months until I got hold
  of my brother who's a banker.  After several evenings of work he
  informed me that at intervals I had subtracted in octal.  And I
  faced the major problem of living in two different worlds.  That may
  have been one of the things that sent me to get rid of octal as far
  as possible.

Personally, I grew up on Z-80 assembler, where hex is more natural
than octal.  I chunk 4 bits a time, not 3, so octal tends to boggle
me.  And you can't divide a 16-bit octal word into two 8-bit octal
bytes without shifting bits in your head.
--



Sat, 22 Jan 1994 06:44:25 GMT  
 three suggestions for perl
|
|When octal works, why do you need hex?  Of course, I asked this before and
|people looked at me like I was from another era.  I think all these \x, \a,
|and \c things are a real shame, because they steal potential user-defined
|character classes from the name space and add nothing in functionality.

When you compare hex and octal, there are some arguments for each.
Hex is more compact and more often aligns well with the byte structure
within numbers (hex for 8-bit byte machines, octal for 6- and 9-bit
byte machines; Honeywell makes machines which are simultaneously 6-
and 9-bits, most other manufaturers don't).  Octal aligns well with
PDP-11 instruction set internal opcode unit boundaries (this advantage,
originally one of the strongest motivations for octal within Unix
systems has lost much of its important over the last two decades).
Each form has a generation of people who consider it to be "natural"
and "obvious" and the other to be "awkward" and "annoying".  You can
probably guess which camp I live in by the choice of arguments I gave
to support each form above.  Certainly, from *my* choice of arguments
above there is one obviously better form...
--
Usenet is [like] the group of people who visit the  | John Macdonald

the people are staying on the paths and not pissing |
on the flowers - Gene Spafford



Sun, 23 Jan 1994 04:00:58 GMT  
 three suggestions for perl

:
: 1) Since hex escapes are now allowed in "" strings, I think they should
: be allowed in regular expressions as well.  All the other "" string
: escapes appear to be allowed in regular expressions.  I think it would
: be much better to be able to say
:
:       print "match\n"       if /^\x7F/;
:
: than having to use eval:
:
:       print "match\n"       if eval "/^\x7F/";

Fixed in 11.  The code was in there to do it, but an optimization was
preventing the regexp code from ever seeing it.

: 2) I suggest perl honor the TMPDIR environment variable.  As it is,
: perl always uses /tmp, which is not always a good thing for me.
: Why TMPDIR?  Lots of other programs honor it, so why be gratuitously
: incompatible?

It only uses /tmp to store the -e program, so it doesn't seem like that
big a deal.  It has some security implications as well, on systems
where /tmp has a sticky bit and TMPDIR doesn't.  It'd also be bad for
setuid scripts.  Do you have some particular reason for wanting to
store -e programs elsewhere than in /tmp?

Besides, I never heard of TMPDIR before this, that I can recall.  Can't
be that ubiquitous...

Or is my memory that bad already?  No doubt 17 people will now followup
and say that they already suggested TMPDIR to me...

: 3) I suggest a new environment variable, PERLINC.  PERLINC would be a
: colon-separated list of directories which perl would either (a) use

: don't care which, though I think (b) would be friendlier.  Of course,

: is to help out people like me who have a private perl library directory
: and don't want to (or can't) write in the directory of libraries
: distributed with perl.

It's already there, but it's called PERLLIB.

: I know I could implement it myself with a splice() as part of the
: prologue to each of my scripts (indeed, the "magic" script I recently
: posted does this), but it's already enough of a pain to customize the
: header on each of my perl scripts.

What, you don't have a perl script to do that?          :-)

Larry



Sat, 22 Jan 1994 01:53:26 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. The FAQ problem and three suggestions

2. How do I sort a 2D-array by three different columns with perl

3. three perl questions for the experts

4. how to init three dimentional array using perl

5. "cat"-ing three files into three files.

6. Median of Three

7. Three-argument form of open() and I/O disciplines

8. A Three Ring Circus: multi-window perldb

9. Parse a word into three strings

10. three quick questions

11. Three Operand Conditional Operator

12. three-part form submission using CGI.pm

 

 
Powered by phpBB® Forum Software