[11148] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4748 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 25 22:07:16 1999

Date: Mon, 25 Jan 99 19:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 25 Jan 1999     Volume: 8 Number: 4748

Today's topics:
        Fix for compiling Perl with gcc 2.8.1 on IRIX (Jonathan I. Kamens)
    Re: HELP!! Perl Viewer?? (Nick Smith)
    Re: How long would the Unixes last without Perl? beable@my-dejanews.com
    Re: How to count match and only substitute a given numb <jdf@pobox.com>
        How to embed perl in C++ program using Microsoft Visual <colbert@nh.ultranet.com>
    Re: Installing GD Module (Randy Kobes)
    Re: Need return code reference <jdf@pobox.com>
    Re: Newbie question: writing file <chester@ma.ultranet.com>
    Re: Perl Books for Beginners (PEReynolds)
    Re: Perl Books for Beginners <jdf@pobox.com>
    Re: Printing back gif-file (counter) <staffan@ngb.se>
    Re: Printing back gif-file (counter) (Ethan H. Poole)
        Q; script error, Need the source? just return this mail <factory@factory.co.kr>
        Remove all non a-z characters? (Ken Williams)
    Re: Remove all non a-z characters? (Alastair)
    Re: Remove all non a-z characters? <ljz@asfast.com>
    Re: Remove all non a-z characters? <staffan@ngb.se>
    Re: Remove all non a-z characters? <flavell@mail.cern.ch>
    Re: Remove all non a-z characters? (Mike Stok)
    Re: Request for negative value list indexes <jdf@pobox.com>
    Re: Secuity hole with perl (suidperl) and nosuid mounts (Peter Samuelson)
    Re: Spell checking form...Win95 (Randy Kobes)
    Re: Statistics for comp.lang.perl.misc <jdf@pobox.com>
    Re: using search pattern <joe@laffeycomputer.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 26 Jan 1999 00:57:40 GMT
From: jik@kamens.brookline.ma.us (Jonathan I. Kamens)
Subject: Fix for compiling Perl with gcc 2.8.1 on IRIX
Message-Id: <78j3u4$rs6$1@jik.shore.net>

Several people have posted in this newsgroup about problems they had
compiling Perl with gcc 2.8.1 on IRIX.  They indicated that when
miniperl ran during the build process, it reported errors like this:

Use of uninitialized value at configpm line 300, <GLOS> chunk 2.
Use of uninitialized value at configpm line 300, <GLOS> chunk 3.
Use of uninitialized value at configpm line 300, <GLOS> chunk 4.
 ...

I encountered the same problem, and I believe I've found the root
cause, a bug in gcc 2.8.1, and a fix.

By default, gcc 2.8.1 compiles on IRIX in "n32" mode.  In this mode,
variables of type "long" are supposed to be 32 bits long.  While gcc
knows this and generates correct code internally, the #define being
passed to the preprocessor to indicate the maximum value for a "long"
was incorrect -- it was the correct value for n64 compiling (i.e.,
64-bit longs).

The fix is to modify gcc so that it doesn't claim an incorrect maximum
value for longs in n32 mode.  Here's the patch I came up with, to
config/mips/iris6.h:

--- iris6.h	1998/02/06 14:13:45	1.1.1.3
+++ iris6.h	1999/01/25 20:08:46	1.2
@@ -30,6 +30,10 @@
 #include "mips/iris5.h"
 #include "mips/abi64.h"
 
+#undef LONG_MAX_SPEC
+#define LONG_MAX_SPEC "%{mlong64:-D__LONG_MAX__=9223372036854775807L} \
+%{mabi=64:-D__LONG_MAX__=9223372036854775807L}"
+
 /* For Irix 6, -mabi=64 implies TARGET_LONG64.  */
 /* This is handled in override_options.  */
 

If you have the SGI gcc package installed and you don't want to
recompile gcc, I believe that you can also fix this bug by applying
this patch as root:

--- /usr/freeware/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/specs.orig	Mon Jan 25 19:48:22 1999
+++ /usr/freeware/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/specs	Mon Jan 25 19:55:06 1999
@@ -65,7 +65,7 @@
 %{mabi=32: -D__SIZE_TYPE__=unsigned\ int -D__PTRDIFF_TYPE__=int} %{mabi=n32: -D__SIZE_TYPE__=unsigned\ int -D__PTRDIFF_TYPE__=int} %{mabi=64: -D__SIZE_TYPE__=long\ unsigned\ int -D__PTRDIFF_TYPE__=long\ int} %{!mabi*: -D__SIZE_TYPE__=unsigned\ int -D__PTRDIFF_TYPE__=int}
 
 *long_max_spec:
-%{!mno-long64:-D__LONG_MAX__=9223372036854775807LL}
+%{mlong64:-D__LONG_MAX__=9223372036854775807L} %{mabi=64:-D__LONG_MAX__=9223372036854775807L}
 
 *mips_as_asm_spec:
 %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} %{pipe: %e-pipe is not supported.} %{K} %(subtarget_mips_as_asm_spec)


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

Date: Tue, 26 Jan 1999 00:45:29 GMT
From: nick.smith@team.xtra.co.nz (Nick Smith)
Subject: Re: HELP!! Perl Viewer??
Message-Id: <36ad0ff8.18337245@news.xtra.co.nz>

>> Hello!
>> I have the following question - is there a perl-viewer or something
>> alike with which i can test run a perl-program without being on a server
>> that has perl installed? I badly need such a tool for a Windows95
>> plattform...
>> Thanx!!!
>> julian daniel

	There is activestate PERL which can be downloaded at
www.activestate.com - I use it and its excellent.

Cheers
Nik


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

Date: Tue, 26 Jan 1999 02:05:49 GMT
From: beable@my-dejanews.com
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <78j7tp$neh$1@nnrp1.dejanews.com>

In article <78im9s$8b6$1@nnrp1.dejanews.com>,
  dhosek@webley.com wrote:
> In article <78i4so$o5h$1@client2.news.psi.net>,
>   abigail@fnx.com wrote:
> > Kent Perrier (kperrier@blkbox.com) wrote on MCMLXXII September MCMXCIII
> > in <URL:news:ysiaez9l1o8.fsf@blkbox.com>:
> > !! abigail@fnx.com (Abigail) writes:
>
> > !! > Doesn't HP ship perl4 by default? And doesn't RedHat come with some
> > !! > form of Perl?
>
> > !! I don't have any experience with HP-UX and I don't consider RedHat a
> > !! commercial unix.
>
> > What's your definition of a commercial Unix then?
>
> I'd define a commercial Unix as one which you cannot get for free (special
> vendor deals and larceny excepted). I'm loathe to put Redhat or any of the
> other commercial Linux distributions into the same category as Ultrix, HPUX,
> et al. What you're paying for in the case of Redhat and its ilk is
> distribution rather than the OS itself.

That's what you're paying for if you buy the CDs. You can download
the same thing for free, as you know. This is a direct result of
the Gnu Public Licence. But, the Redhat company is making money
by selling and supporting Redhat Linux. That sounds pretty
commercial to me. The only difference between Redhat giving away
the OS and Micsoroft giving away Windoze, is that Redhat gives
theirs away because the licence says they have to, and Windoze
"gives" theirs away because they want to force manufacturers
to ship all new PCs with Windoze installed. Redhat is in the
business of selling and supporting linux. Redhat ships with
perl. QED.

cheers
beable van polasm
--
SORDS DO'NT EAT SOULES, MENLIBONES EAT SOULES. -- Joseph Michael Bay

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 26 Jan 1999 03:39:52 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: xiaobei@netcene.com (Bei)
Subject: Re: How to count match and only substitute a given number of match?
Message-Id: <m3g18y21vr.fsf@joshua.panix.com>

xiaobei@netcene.com (Bei) writes:

> how can I count the match /day/?

This is a FAQ: perlfaq4, "How can I count the number of occurrences of
a substring within a string?"

> and how can I only substitute the first two days

Here's one way:

my $s = 'apple pear banana pear peach peach pear apple pear gun';
$s =~ s/pear(.*?)pear/BIGPEAR$1PIGBEAR/;

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 25 Jan 1999 22:05:05 -0500
From: "Colbert Philippe" <colbert@nh.ultranet.com>
Subject: How to embed perl in C++ program using Microsoft Visual C++ as compiler?
Message-Id: <78jajg$9ur$1@ligarius.ultra.net>

Hi,

I read perlembed.html but this documentation is UNIX specific...

Where can I find similar info for Windows NT and using Microsoft compiler?

or can somebody tell me how to proceed in Windows NT environment (using
Microsoft compiler)?

Thanks!!!






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

Date: 26 Jan 1999 01:58:29 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Installing GD Module
Message-Id: <slrn7aq8sf.9em.randy@theory.uwinnipeg.ca>

On Sun, 24 Jan 1999 21:32:49 -0000, 
	Mike Watkins <mwatkins@promotion4free.com> wrote:
>I'm having some trouble installing the GD v1.18 module on my Win98
>computer.  First, I had ActiveState's version of perl installed, and
>used their PPM.  The module seemed to install fine, but when I ran a
>script which used GD, it said it couldn't find Image.al in /auto/GD/.

Hi,
   Are you using the latest ActiveState version? Perhaps you
have an older version which has a different perl directory
structure than the current ppm files on ActiveState expect.

>After a few hours of trying that, I decided to switch to the standard
>binary dist. of perl, because it contains the dmake utility.  I switched
>over, and tried to install the GD module again with no success.

Even with ActiveState you can install your own modules - you
need either nmake (available for download on Microsoft's ftp site)
or dmake, as well as a C compiler (VC++ or Borland) if you want to
install XS-based modules. You may have to edit perl's Config.pm
file to tell it what make program you're using, as well as the
relevant compiler program and paths.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: 26 Jan 1999 03:42:58 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Need return code reference
Message-Id: <m3d84221ql.fsf@joshua.panix.com>

"A@A.A.A" <A@A.A.A> writes:
^^^^^^^^^^^^^^^^^^
What is the point of this?

> Does anyone know where I can find a complete listing of codes
> returned by the SYSTEM and/or WAIT functions?

If you mean "system" and "wait", they're both documented in perlfunc,
which comes with perl.

  $ perldoc perlfunc

or even

  $ perldoc -f system
  $ perldoc -f wait

> If you know please email me directly.

You've made it rather difficult to do so.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 25 Jan 1999 19:15:55 -0600
From: "Kevin D. Chester" <chester@ma.ultranet.com>
To: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: Newbie question: writing file
Message-Id: <36AD174A.82A46481@ma.ultranet.com>

Hello Tom,

Thank you for your reply!!! This little "x" has solved the problem and it seems to be
working.

Best regards,

Kevin

Tom Briles wrote:

> Kevin D. Chester wrote:
>
> > Hello Again,
> >
> > I guess maybe I have not furnished enough info. Here is the tokens dir.
> > permissions:
> >
> > drw-rw-rw-  2 beanbag  wheel     512 Jan 23 02:36 tokens
> >
>
> You're misunderstanding how permissions work.
>
> You must have execute (x) permissions for a directory to create or modify files in
> the directory.
>
> - Tom





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

Date: 26 Jan 1999 00:31:32 GMT
From: pereynolds@aol.com (PEReynolds)
Subject: Re: Perl Books for Beginners
Message-Id: <19990125193132.27572.00002528@ng-ce1.aol.com>

For absolute beginners,  I'd like to recommend 2 books.
1.	Perl 5 for Dummies
This book is good for absolute beginners because it explains the introductory
material very well.  It also has charts and lists of terms collected together
in one place that make this book worth the price.

2.	Perl for Win32
Even though it is written for primarily Win32 systems, it explains various
basic topics such as opening files and text processing very well.  I bought the
book and installed Perl 5 on an NT 4.0 system at work because the Y2k program I
had on hand to search for Y2k-related data in source files did not work well. 
Using Perl and this book as a guide I wrote an application from scratch that
did a much better job in meeting my needs. 




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

Date: 26 Jan 1999 03:54:07 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: pereynolds@aol.com (PEReynolds)
Subject: Re: Perl Books for Beginners
Message-Id: <m3679u2180.fsf@joshua.panix.com>

pereynolds@aol.com (PEReynolds) writes:

> For absolute beginners,  I'd like to recommend 2 books.
> 1.	Perl 5 for Dummies

Ack!  See http://language.perl.com/critiques/index.html for why this
is not good advice.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 25 Jan 1999 23:01:13 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Printing back gif-file (counter)
Message-Id: <36ACE9A9.DCDFA939@ngb.se>

Marc-A. Woog wrote:
> I hope I didn't miss anything in the FAQ but I couldn't find anything
> on this one:

This is not a perl question.

> counter.cgi:
> [...]
> open (GIFFILE, "$gif") || bail ("Couldn't open gif: $!");
> binmode GIFFILE;
> while (<GIFFILE>) { print $_; }
> close(GIFFILE);
> [...]

Did you remember to output the correct header, ie saying
print "Content-Type: image/gif\n\n";
before starting to print the image?

If not -- that's where you are wrong. But if it is, this is not a perl
question.

Staffan


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

Date: Tue, 26 Jan 1999 02:22:53 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Printing back gif-file (counter)
Message-Id: <1G9r2.175$cV.3808@news12.ispnews.com>

You failed to binmode(STDOUT).  Generally, if you need to binmode the input, 
you will probably need to binmode the output as well, unless, of course, you 
intend for it to be translated to text data.

[Posted and Emailed]  In article <3731e6c9.3151578@news.datacomm.ch>, 
mwoog@pobox.ch says...
>
>Hi,
>
>I hope I didn't miss anything in the FAQ but I couldn't find anything
>on this one:
>
>HTML:
>[...]
><IMG SRC="/cgi-bin/counter.cgi" WIDTH="0" HEIGHT="0"
>[...]
>
>counter.cgi:
>[...]
>open (GIFFILE, "$gif") || bail ("Couldn't open gif: $!");
>binmode GIFFILE;
>while (<GIFFILE>) { print $_; }
>close(GIFFILE);
>[...]
>while $gif is a 1x1-picture.
>
>But this doesn't quite work (the rest of the script does: no
>"bailing") cause NS Navigator is showing the symbol for a not-existent
>picture. To be more specific: it works on my windows machine but
>doesn't on the unix server (even played around with chmod for the
>gif). I am assuming that I am printing back a non-valid picture on
>unix. How can I correct that?
>
>Thanks for any help,
>
>Marc

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
                            | http://www.interact2day.com/



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

Date: Tue, 26 Jan 1999 22:06:50 +0900
From: "Yeong Mo/Director Hana co." <factory@factory.co.kr>
Subject: Q; script error, Need the source? just return this mail to me then I will send you it
Message-Id: <78j7kl$dr$2@news.kornet.nm.kr>

Dear sir.

According to your last request for my Question about multiple selection
option, here I attach the 3 files I modified.
I solved the problem of multiple selection option and other little problems.
but still have little problem.

I got the original sorce (ezhomepg.pl) from manny juan's script page at
"inet-images.com/manny"
Originally, there were files named ezhomepg.pl, index.html, data.txt, and
the cgi makes ***.dat and ***.html files by itself.
The source only creates files which users made (***.dat and ***.html) at
just one directory.

Now, I modified the source users to save the files a directory where they
choose.
I prepared more than 100 directories on selection option which users can
select one of them, and save their file at there.
Also, I made one more file named link_en.cfg for extra. and I changed the
index.html file name to register_en.html.

There are three nain funtions on the script.
First, to creat a homepage in my server from other internet users.
Second, to modify it.
Third, to delete it.

Now, here is a question ?

when user tries to delete the file he already created, only ***.dat file
deleted and changed data.txt and register_en file normally. But the ***.html
file is still there which should be deleted with other *** files togather.

I guess the key point is at this line. ==>   $cnt=unlink
"$page_dir/dat/$editfile\.dat", "$baseurl/dat/$editfile\.html";

The data.txt is growing and growing to much big size with this modified line
"$baseurl/$categorys/$editfile\.html";
It just delete ***.dat. but ***.html is still there.

But data.txt is not growing with this modified line
"$baseurl/dat/$editfile\.html";
with this line it deletes ***.dat and changes data.txt nomally, but nothing
works for deleting ***.html

It seems doesn't recognise  categorys(drectories).

Also, look at this line  if (/$pagename.html/) { .
Mr. Manny juan ask me to change the line  if (/$pagename.html/) { . ==to==>
if (/$categorys\/$pagename.html/) {.

##############################
### The part seems a key to solve this problem and i mentioned at above.###
sub delpage {
    local ($editfile) = @_;
    $cnt=unlink "$page_dir/dat/$editfile\.dat",
"$baseurl/dat/$editfile\.html";

    # Suck the index page, and write the new entry to it
    open(FILE, "$indexpage") || die "I can't open $indexpage (indexpage)
file\n";
    flock (FILE, 1) or die "can't lock index file\n";
        @lines = <FILE>;
        close(FILE);
        $sizelines = @lines;

    # Now, re-open the links file, and comment out the page to delete
    open(FILE, ">$indexpage") || die "I can't open $indexpage (indexpage)
file\n";
    flock (FILE, 2) or die "can't lock index file to delete entry\n";

            for ($a = 0; $a <= $sizelines; $a++) {

            $_ = $lines[$a];

        if (/$pagename.html/) {
          # do nothing  (ie. don't write)
          }
        else {
          print FILE $_;
           }
        }
########################################

You can try my work at the URL "factory.co.kr/cgi/shop_en/register_en.html
And You have to select the category "Sort_02" which I only give permission
777 now.

And please understand that there are some Korean letters. you may not
recognise it. but no problem s for you. I guess.

Thank you for your help.

Yeong mo

Need the related files? just return this mail to me then I will send you it.







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

Date: Tue, 26 Jan 1999 00:06:03 GMT
From: tekkin@hotmail.com (Ken Williams)
Subject: Remove all non a-z characters?
Message-Id: <36ad06ba.0@news.cgocable.net>

I have a string that can contain anything "t4(e3*s@22t".

How do pull out only the characters a-z.  So the above example would end up 
with a string called "test", because all the garbage is scrapped.

Thanks.


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

Date: Tue, 26 Jan 1999 00:28:11 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Remove all non a-z characters?
Message-Id: <slrn7aq32e.59.alastair@calliope.demon.co.uk>

Ken Williams <tekkin@hotmail.com> wrote:
>I have a string that can contain anything "t4(e3*s@22t".
>
>How do pull out only the characters a-z.  So the above example would end up 
>with a string called "test", because all the garbage is scrapped.

What have you tried? It's quite simple if you're prepared to do a little work.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 25 Jan 1999 19:16:42 -0500
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Remove all non a-z characters?
Message-Id: <ltu2xekhw5.fsf@asfast.com>

tekkin@hotmail.com (Ken Williams) writes:

> I have a string that can contain anything "t4(e3*s@22t".
> 
> How do pull out only the characters a-z.  So the above example would end up 
> with a string called "test", because all the garbage is scrapped.

Try this:

  $string = 't4(e3*s@22t';
  $string =~ s/[^a-z]//ig;
  print "result: $string\n";

There's a lot more about this sort of thing in the `perlre' man page.
Look for the words "character class".


-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x"'


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

Date: Tue, 26 Jan 1999 02:25:56 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Remove all non a-z characters?
Message-Id: <36AD19A4.9B58C8FC@ngb.se>

Ken Williams wrote:
> I have a string that can contain anything "t4(e3*s@22t".
> How do pull out only the characters a-z.  So the above example would
> end up with a string called "test", because all the garbage is
> scrapped.

Easy:
$string =~ s/[^a-z]//g;

If you don't understand it, try perldoc perlre

Staffan


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

Date: Tue, 26 Jan 1999 02:33:35 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Remove all non a-z characters?
Message-Id: <Pine.HPP.3.95a.990126022516.4736B-100000@hpplus01.cern.ch>

On Tue, 26 Jan 1999, Ken Williams wrote:

> How do pull out only the characters a-z. 

Are you sure you've defined the problem?

Did you want to eliminate A-Z?  Did you want to eliminate accented
characters and ligatures?

> So the above example would end up 
> with a string called "test", because all the garbage is scrapped.

Examples can be illustrative, but they are potentially misleading as a
requirements specification.  If you're to make progress in the field,
you'll need to understand the difference, and specify your requirements
more precisely.  In some languages, the accented letters and ligatures
are considered to lie within the range from a to z: in other languages
some lie outside the range.  It's far from unambiguous. 



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

Date: Mon, 25 Jan 1999 20:58:21 -0600
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Remove all non a-z characters?
Message-Id: <OYam8eNS#GA.189@news1.texas.rr.com>

In article <36ad06ba.0@news.cgocable.net>,
Ken Williams <tekkin@hotmail.com> wrote:
>
>I have a string that can contain anything "t4(e3*s@22t".
>
>How do pull out only the characters a-z.  So the above example would end up 
>with a string called "test", because all the garbage is scrapped.

One thing to try might be tr, in the debugger

  DB<1> $s = 't4(e3*s@22t'

  DB<2> $s =~ tr/a-z//cd

  DB<3> X s
$s = 'test'

The perlfunc manual page describes what tr does and what the flags mean.
This is an alternative to using s, depending on your data one way may be
better than the other. The perldebug manual page explains how to start the
debugger.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
                                   |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 26 Jan 1999 03:49:35 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Ben Smith <bsmith@perf.zko.dec.com>
Subject: Re: Request for negative value list indexes
Message-Id: <m390eq21fk.fsf@joshua.panix.com>

Ben Smith <bsmith@perf.zko.dec.com> writes:

> Wouldn't it be nice to be able to reference a list element from the
> end as well as from the begining.. $array[-1] would be equivalent to
> $array[$#array] and $array[-2] would be equivalent to
> $array[$#array-1].

<grin>

Have you thought about a future (or would it be a past?) in language
design?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 25 Jan 1999 17:41:25 -0600
From: peter@nemesis.niar.twsu.edu (Peter Samuelson)
Subject: Re: Secuity hole with perl (suidperl) and nosuid mounts on Linux
Message-Id: <78ivf5$10dk$1@nemesis.niar.twsu.edu>


  [<B.A.McCauley@bham.ac.uk>]
> > It is an matter of opinion (or perhaps even religion) if the
> > user-space hack (a suid-interpreter) for supporting secure suid
> > scripts is considered more or less ugly than the kernel-space hack
> > (using /dev/fd).

> > Personally I think the kernel space hack is (slightly) more ugly.

[Ilya Zakharevich <ilya@math.ohio-state.edu>]
> I see: just fix *all* the executables instead of fixing one place.
> Then fix *all* the executable *again* when a security hole with the
> previous fix (as one with perl) is discovered.

Well, I'm sure you know the history....  Many scripting languages are
quite unsuitable for setuid things anyway (Bourne and C shells come to
mind) for many reasons beyond the symlink security hole.  Languages
such as Perl, in which it really does make more sense to program
setuid-type stuff, came about comparitively recently.  Any scripting
language that puts forth a claim of being as secure as C can just as
well provide its own suidperl-ish hack.

I don't like it, though.  I think the user-space hack *is* ugly,
possibly uglier than the kernel-space hack would be.  In any case, I
doubt it would be difficult to hack the /dev/fd (or more precisely
/proc/self/fd) feature into Linux.  If anyone wants to make the world a
better and arguably safer place, go ahead and write the patch....

> Oh, I forgot that that Linux kernel development model is as (insert
> your favorite word for fascistic) as Emacs :-(.

If you say so.  I haven't had any personal experience with the FSF
Emacs developers but I know their reputation.  Linus most of the time
seems more than reasonable and open in his development process -- for
small changes he will literally take patches from anybody, and for
large changes he discusses the issues on the mailing lists.  And he
releases the alphas / betas plenty often enough to make you feel a part
of things.

-- 
Peter Samuelson
<sampo.creighton.edu!psamuels>


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

Date: 26 Jan 1999 01:47:57 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Spell checking form...Win95
Message-Id: <slrn7aq88n.9em.randy@theory.uwinnipeg.ca>

On Mon, 25 Jan 1999 03:05:24 GMT, 
	bryf128@my-dejanews.com <bryf128@my-dejanews.com> wrote:
>I need to come up with a way to spell check a form's text area.  Something
>similar to dejanews post page.  I looked at ispell but that appears to be unix
>specific.

Hi,
    There are Win32 ports of ispell - a web search for Windows and
ispell should turn up some links. Make sure you get the latest version
possible as indicated on any up-to-date GNU archive - there are
apparently higher versions in other places, but due to a change in
the version labelling these are actually older versions.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: 26 Jan 1999 03:45:11 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <m3btjm21mw.fsf@joshua.panix.com>

Greg Bacon <gbacon@cs.uah.edu> writes:

> Top 10 Posters by Number of Posts
> =================================
[snip]
>    30    40.9 ( 24.6/ 14.1/  9.3)  Jonathan Feinberg <jdf@pobox.com>
>    28    80.9 ( 32.0/ 48.9/ 19.4)  topmind@technologist.com

I'm not sure how to feel about that.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Mon, 25 Jan 1999 18:17:33 -0600
From: Joe Laffey <joe@laffeycomputer.com>
Subject: Re: using search pattern
Message-Id: <Pine.LNX.4.05.9901251754180.16217-100000@tripe.laffeycomputer.com>

On 24 Jan 1999, Jonathan Feinberg wrote:

> Joe Laffey <joe@laffeycomputer.com> writes:
> 
> > On Sun, 24 Jan 1999, brettr wrote:
> > 
> > > How would I extract the last.html file from the string below?
> > > 
> > > /dir/dir/last.html
> > 
> > 
> > $my_string = "/dir1/dir2/last.html";
> > $my_rev_string = reverse $my_string;
> > $my_rev_string =~ m/^([\w_\.]+)\//;
> > $my_filename = reverse $1;
> 
> Is it April already?


Funny thing is with a long string for the pathname the above code
(once typos have been removed) runs faster than:

$my_string =~ m/\/([\w_\.]+)$/;
$my_filename = $1;


I tested them both with timethis... I also tested File::Basename...


Test Program:


#!/usr/bin/perl -w 

$my_string = "/really/long/filename/dir1/dir2/last.html";
#$my_string = "/dir2/last.html";

use File::Basename;
use Benchmark;


#Method One

timethis(200000,'

$my_rev_string = reverse $my_string;

$my_rev_string =~ m/^([\w_\.]+)\//;

$my_filename = reverse $1;'
);
print"\n", $my_filename,"\n";



#Method Two

timethis(200000,'

$my_string =~ m/\/([\w_\.]+)$/;

$my_filename = $1;
 
');

print "\n\n$my_filename\n";



#Using Basename

timethis(200000,'

$my_filename = basename($my_string);
 
');

print "\n\n$my_filename\n";





With the string above Method One was almost twice as fast as Method Two! 
Method One was about 20% faster with the string supplied
("/dir1/dir2/filename").
File:Basename took about 500% LONGER than Method one...

Odd, eh? I hear this has something to do with RegExps being optimized to
go forwards, not backwards...

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
http://www.laffeycomputer.com/
 ------------------------------




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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4748
**************************************

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