[14025] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1435 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 19 18:05:45 1999

Date: Fri, 19 Nov 1999 15:05:25 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943052725-v9-i1435@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 19 Nov 1999     Volume: 9 Number: 1435

Today's topics:
    Re: "The Art of Perl" (was Re: Perl programming sytle) <gellyfish@gellyfish.com>
    Re: [JOB]: Web Developer/Senior Web Developer: SGML, XM <rick@violetshiversBITE-ME-YOU-SPAMMING-SCUM.com>
        alias a mailer (Fox)
        Can i prevent the user from viewing the source HTML cod (Bobo)
    Re: Can i prevent the user from viewing the source HTML <newsposter@cthulhu.demon.nl>
    Re: Can i prevent the user from viewing the source HTML <tony_curtis32@yahoo.com>
    Re: Can i prevent the user from viewing the source HTML (Kragen Sitaker)
    Re: Can i prevent the user from viewing the source HTML <gellyfish@gellyfish.com>
    Re: Can Perl return the ASCII code for a given characte <gellyfish@gellyfish.com>
    Re: CGI question <gellyfish@gellyfish.com>
    Re: CGI question <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
    Re: Database Locking (Help!) <gellyfish@gellyfish.com>
        DB ? <bunjonwa@trek.CS.ORST.EDU>
    Re: DB ? <gellyfish@gellyfish.com>
    Re: DB ? (Kragen Sitaker)
    Re: DBI questions (memory, signals) (Jon Drukman)
        Defeating web-based http proxies <mdb7@my-deja.com>
        Different browser behavior on '302 Redirect' <frankv@ddsw.nl>
    Re: Different browser behavior on '302 Redirect' <gellyfish@gellyfish.com>
    Re: Different browser behavior on '302 Redirect' <frankv@ddsw.nl>
    Re: Different browser behavior on '302 Redirect' <gellyfish@gellyfish.com>
    Re: Encryption Algorithm for Perl Source Code?? <gellyfish@gellyfish.com>
    Re: FAQ 5.3: How do I count the number of lines in a fi (Abigail)
    Re: Fetch Dilbert. <uri@sysarch.com>
    Re: Fetch Dilbert. (Abigail)
    Re: file descriptors already used when perl starts (Abigail)
    Re: file descriptors already used when perl starts (Ilya Zakharevich)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 19 Nov 1999 23:16:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: "The Art of Perl" (was Re: Perl programming sytle)
Message-Id: <814loa$6c4$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 17:52:56 GMT Scott McMahan wrote:
>> I was recently "chastised" by someone for programming perl on  WinNT
>> like I program C on UNIX. He insisted that I should programm more
>> "perl-like" and many of the constructs he suggested as changes were
>> definately not C-like, and were definately harder to read. (IMO)
> 
> My opinion is that he needs something better to worry about.  I write
> in about 5 languages, and if I can get it to compile at all,

I was delighted to discover that Informix 4GL will compile with an
undocumented ; on the end of the statement today ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 10:36:30 -0800
From: Echo the Wonder Tube <rick@violetshiversBITE-ME-YOU-SPAMMING-SCUM.com>
Subject: Re: [JOB]: Web Developer/Senior Web Developer: SGML, XML, PERL5, LINUX
Message-Id: <kJg1OHQ3uimU0qdzKCO=HTyb7Zgr@4ax.com>

On Fri, 19 Nov 1999 12:29:44 +0000, Richard Padley
<richard@semantico.com> wrote:
>Semantico Limited
>Web Developer/Programmer
>
>The salary range for the right person is dependent on your experience
>but will be in the range of 22-26K for a developer at the intermediate
>level and up to 35K for a senior developer.

Even in UK pounds, that's pretty light on the salary.



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

Date: Fri, 19 Nov 1999 22:01:49 GMT
From: hry@163.net (Fox)
Subject: alias a mailer
Message-Id: <3835c69a.8666964@news.bentium.com>

hi all:
i got a problem....
in my /etc/aliases
i definded :

aaa:|/www/fox/test.pl

in /www.fox/test.pl i wrote:

#!/usr/bin/perl
open (ifile,">>test");
$time=3Dlocaltime();
print ifile "$time\n";
print ifile "mail is comming\n";
close (ifile);

and i send a mail to aaa,the server returned:

sh: /www/fox/test.pl: Text file busy
554 |/www/fox/test.pl... unknown mailer error 126

why?


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

Date: 19 Nov 1999 19:01:43 GMT
From: bobo@bobo.com (Bobo)
Subject: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <8146qn$l0k9@imsp212.netvigator.com>


Can i prevent the user from viewing the source HTML code by using PERL script 
??

Thanks..



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

Date: 19 Nov 1999 19:10:12 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <8147ak$f2s$1@internal-news.uu.net>

Bobo <bobo@bobo.com> wrote:

> Can i prevent the user from viewing the source HTML code by using PERL script 
> ??

sure, just encrypt the output from your script before sending it to
the user's browser.

Erik



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

Date: 19 Nov 1999 20:17:53 +0100
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <83hfiijnoe.fsf@vcpc.univie.ac.at>

Re: Can i prevent the user from viewing the source
HTML code by using PERL script ??, Bobo
<bobo@bobo.com> said:

Bobo> Can i prevent the user from viewing the source
Bobo> HTML code by using PERL script ??

If the browser software cannot "see" the HTML, how
does it get rendered by the browser?

print "this one has been done to death\n" x $multiple;

Check the clpm archives, with e.g. dejanews.

hth
tony


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

Date: Fri, 19 Nov 1999 22:55:54 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <_zkZ3.28979$YI2.1348330@typ11.nn.bcandid.com>

In article <8146qn$l0k9@imsp212.netvigator.com>, Bobo <bobo@bobo.com> wrote:
>Can i prevent the user from viewing the source HTML code by using PERL script 
>??

Your question is underspecified.  Please elucidate the scenario.  (I
can give you a hint that the answer is probably, "Not a Perl
question.")
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 19 Nov 1999 22:10:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <814hsr$6ag$1@gellyfish.btinternet.com>

On 19 Nov 1999 19:01:43 GMT Bobo wrote:
> 
> Can i prevent the user from viewing the source HTML code by using PERL script 
> ??
> 

Sure.

#!/usr/bin/perl -w


use File::Find;

my $conf_file = '/usr/local/apache/conf/httpd.conf'; # change this to match
                                                     # your configuration

open(CONF,$conf_file) || die "Cant open $conf_file - $!\n";

my @docdirs;

while(<CONF>)
{
  push @docdirs, $1 if /^DocumentRoot\s+(.+)/;
}

find \&fixdocs, @docdirs;

sub fixdocs
{
  unlink if ( -f && /html?$/ );
}

HTH

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 19 Nov 1999 21:13:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can Perl return the ASCII code for a given character?
Message-Id: <814eh7$698$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 14:17:34 +0100 Michel Morin wrote:
> Michel Morin a écrit dans le message <813i3e$d69$1@gaia.eurobretagne.fr>...
>>Why ?
>>it works on ActiveState Perl for Windows.
>>
> oops ...
> 
> You're right. I misunderstood the question
> 
> I think my last answer make me win this first price in your "CLPM wrong
> answer" !!!!
> 

You also win another prize for *this* answer, but you'll find out about
that later :-}

Congratulations.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 19 Nov 1999 16:17:25 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI question
Message-Id: <38357815_1@newsread3.dircon.co.uk>

Venkatesh Kumar <venkatesh.kumar@sabre.com> wrote:
> Can someone let me know on how do I upload a file
> through a browser using CGI to a server
> 

Er yes I believe that the manual for the module CGI.pm has a section
entitled :

       CREATING A FILE UPLOAD FIELD

CGI.pm is standard with modern Perls


/J\
-- 
"My codpiece layeth awkwardly across the nadgers" - Declan Donnelly


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

Date: Fri, 19 Nov 1999 08:15:39 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: CGI question
Message-Id: <2750ac20.3aa506c3@usw-ex0101-006.remarq.com>

In article <383571A4.6DFF550E@sabre.com>, Venkatesh Kumar
<venkatesh.kumar@sabre.com> wrote:
> Can someone let me know on how do I upload a file
> through a browser using CGI to a server
>

Assuming that you're implementing your CGI program in Perl (this is a
Perl newsgroup, right?), then you read the documentation for the CGI.pm
module and have a look at the little example program... Then go and do
likewise.

--
Mark Bluemel


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: 19 Nov 1999 22:25:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Database Locking (Help!)
Message-Id: <814ipc$6at$1@gellyfish.btinternet.com>

On Thu, 18 Nov 1999 23:08:54 GMT Schulz@gmx.net wrote:
>   satisfying solution for the locking. The example shown under perldoc
> DB_File isn't acceptable because of the 10 seconds delay ...

Well leave the 'sleep 10' out then - it is only there for demonstration
purposes.

However if you have simply copied the code without understanding that then
I think you should go back and read some more.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 12:00:11 -0800
From: Waranun Bunjongsat <bunjonwa@trek.CS.ORST.EDU>
Subject: DB ?
Message-Id: <Pine.GSO.4.03.9911191157110.15393-100000@trek.CS.ORST.EDU>

Hi,

	I have a following question,

	The code below causes an internal error or misconfiguration

use AnyDBM_File;
tie %newhash,  'DB_File',"data/test.db",O_CREAT|O_RDWR;
untie(%newhash);

	The umask is 2. The mode is drwxr-xr-x.


Thanks in advance for any helps !!!

-- 
____________________________________________________________________________

Waranun Bunjongsat               tel: 541-343-5970
Graduate Student                 e-mail: bunjonwa@cs.orst.edu
Department of Computer Science   homepage:http://www.cs.orst.edu/~bunjonwa
Oregon State University
____________________________________________________________________________




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

Date: 19 Nov 1999 22:32:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DB ?
Message-Id: <814j6d$6b4$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 12:00:11 -0800 Waranun Bunjongsat wrote:
> Hi,
> 
> 	I have a following question,
> 
> 	The code below causes an internal error or misconfiguration
> 
> use AnyDBM_File;
> tie %newhash,  'DB_File',"data/test.db",O_CREAT|O_RDWR;
> untie(%newhash);
> 
> 	The umask is 2. The mode is drwxr-xr-x.
> 

But what does it do when you run it from the command line ?  

Please read the first item in perlfaq9.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 23:02:41 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: DB ?
Message-Id: <lGkZ3.28994$YI2.1348548@typ11.nn.bcandid.com>

In article <Pine.GSO.4.03.9911191157110.15393-100000@trek.CS.ORST.EDU>,
Waranun Bunjongsat  <bunjonwa@trek.CS.ORST.EDU> wrote:
>	The code below causes an internal error or misconfiguration

That's not a Perl error.

>use AnyDBM_File;
>tie %newhash,  'DB_File',"data/test.db",O_CREAT|O_RDWR;
>untie(%newhash);

Hmm, perhaps you ought to use or require DB_File before you try to tie
something to it.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Fri, 19 Nov 1999 19:54:29 GMT
From: jsd@gamespot.com (Jon Drukman)
Subject: Re: DBI questions (memory, signals)
Message-Id: <slrn83bamg.3vvje0d.jsd@edit-q.gamespot.com>

Jani Lahti wrote:
>> When I open a DBI connecion to Oracle, my script grows by 3MB. I
>> understand it's because some more script data is being utilized and
>> buffers reserved. It's just that I think 3MB is a bit too much.

On Fri, 19 Nov 1999 16:51:46
 -0700, Ron Reidy <rereidy@uswest.net> wrote:
>The size of the script grows not because of some added data structs used by
>DBI/DBD, but because of the inclussion of the Oracle libraries.  This would
>happen regardless of language used (i.e. Perl, C/C++, php3, etc.).


Ron is absolutely correct.  If you're worried about multiple copies of
your script snarfing memory, you have two choices:

1: don't worry about it so much.  your operating system (assuming
it's at all decent, ie: unix-like, and not windows) will probably
be sharing the oracle library among all the processes, so the 3MB
penalty is really only being paid once in full.

2: rearrange your system so that the scripts themselves do not call
the database directly, but rather communicate with some external
process that handles all the database operations.

3: add more memory.  this will give you all sorts of benefits, not
least of which is you won't have to worry about how much memory
your scripts are using.

-jsd-



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

Date: Fri, 19 Nov 1999 21:52:58 GMT
From: Jason <mdb7@my-deja.com>
Subject: Defeating web-based http proxies
Message-Id: <814gro$b4f$1@nnrp1.deja.com>

Hello,

I run a website site for an interactive community which has
unfortunately been plagued over the years by a certain problem user who
has in the past been responsible for harassing and stalking visitors. In
spite of my having locked his ISP out of my site from the server level,
he still frequently attempts to regain access, and on occasion succeeds,
thanks to web-based proxy http servers like the Anonymizer, the number
of which rank probably somewhere in the hundreds, and then thousands
more of the browser-direct proxies.

I could just update my .htaccess every time I find said user logged, but
ideally, I shouldn't have to deal with this kind of thing in the first
place. He may have all day to try and hack his way in. I don't. His ISP
is of no help, after having sent several e-mails to the administrators,
and even spending an entire morning on the phone talking to a
representative. This pretty much leaves me to deal with it on my own.

Ideally, what I am looking for is some means of having the scripts on my
site automatically reject any kind of web-based proxy server -- I've
noticed that libwww based  and nph- perl scripts seem to be the most
common. I'm aware that snap.com's e-mail service is able to deny
accesses from proxies.  Does anyone have any information on how this
works? Port 80 socket connections to see if an address is a website are
just too slow, as most of my visitors aren't connected to a T3. I was
thinking of checking the HTTP_USER_AGENT, but that only works as long as
the proxy script doesn't spoof a real browser type as well.

Any help or pointers would be appreciated.  Thanks.

Jason


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 19 Nov 1999 15:17:07 +0100
From: "frankv" <frankv@ddsw.nl>
Subject: Different browser behavior on '302 Redirect'
Message-Id: <813pl2$jij$1@news1.xs4all.nl>

Hi there,

I'm pretty new to Perl.
I've written a simple script, to redirect a user to his own page.
In order to do this I create a HTML-page on-the-fly, with a Status: 302 in
the header.
(Script below)

This works fine with Netscape, but unfortunately it doesn't work with the
Internet-explorer. (I just get the tekst displayed, but the redirection
doens't work.

I've searched through several sources (online and tutorials) with
information, but couldn't find a satisfactory answer. Hope someone here can
help.

Regards,
Frank
Netherlands




#! /usr/bin/perl
# programma om met de bekende usernames op de juiste directories uit te
komen.

if ($ENV{'REMOTE_USER'} eq "frank")
        {
        $LOC = "/safe/index.html";
        }

if ($ENV{'REMOTE_USER'} eq "peters")
        {
        $LOC = "/safe/test.html";
        }

print <<"ending_print_tag";
Status: 302
Content-type: text/html
Location: $LOC
Cache-Control: no-cache
Pragma: no-cache

<HTML><HEAD>
<TITLE>Client Redirected</TITLE>
</HEAD><BODY>
Your browser has been redirected to "$LOC".
</BODY></HTML>
ending_print_tag




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

Date: 19 Nov 1999 15:27:38 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Different browser behavior on '302 Redirect'
Message-Id: <38356c6a_2@newsread3.dircon.co.uk>

frankv <frankv@ddsw.nl> wrote:
> Hi there,
> 
> I'm pretty new to Perl.
> I've written a simple script, to redirect a user to his own page.
> In order to do this I create a HTML-page on-the-fly, with a Status: 302 in
> the header.
> (Script below)
> 
> This works fine with Netscape, but unfortunately it doesn't work with the
> Internet-explorer. (I just get the tekst displayed, but the redirection
> doens't work.
> 

If you are getting different behaviour from different display devices
then it is a sure sign that it is not a  Perl problem but a problem
with the display device - the same could be said of web browsers too -
You will get a better answer if you ask in a group that discusses the
differences between browsers.

/J\
-- 
"As usual I'm the price you have to pay for the funny bits" - Denis Norden


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

Date: Fri, 19 Nov 1999 15:53:57 +0100
From: "frankv" <frankv@ddsw.nl>
Subject: Re: Different browser behavior on '302 Redirect'
Message-Id: <813rq4$lq1$1@news1.xs4all.nl>

Maybe I should be more specific in my question.

How can I make my perl-program redirect a user to his own directory/file.
(In a more direct way than creating a redirection-page on-the fly.)

Regards,
Frank

Jonathan Stowe heeft geschreven in bericht
<38356c6a_2@newsread3.dircon.co.uk>...
>frankv <frankv@ddsw.nl> wrote:
>> Hi there,
>>
>> I'm pretty new to Perl.
>> I've written a simple script, to redirect a user to his own page.
>> In order to do this I create a HTML-page on-the-fly, with a Status: 302
in
>> the header.
>> (Script below)
>>
>> This works fine with Netscape, but unfortunately it doesn't work with the
>> Internet-explorer. (I just get the tekst displayed, but the redirection
>> doens't work.
>>
>
>If you are getting different behaviour from different display devices
>then it is a sure sign that it is not a  Perl problem but a problem
>with the display device - the same could be said of web browsers too -
>You will get a better answer if you ask in a group that discusses the
>differences between browsers.
>
>/J\
>--
>"As usual I'm the price you have to pay for the funny bits" - Denis Norden




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

Date: 19 Nov 1999 15:59:36 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Different browser behavior on '302 Redirect'
Message-Id: <383573e8_2@newsread3.dircon.co.uk>

frankv <frankv@ddsw.nl> wrote:
> Jonathan Stowe heeft geschreven in bericht
> <38356c6a_2@newsread3.dircon.co.uk>...
>>frankv <frankv@ddsw.nl> wrote:
>>> Hi there,
>>>
>>> I'm pretty new to Perl.
>>> I've written a simple script, to redirect a user to his own page.
>>> In order to do this I create a HTML-page on-the-fly, with a Status: 302
> in
>>> the header.
>>> (Script below)
>>>
>>> This works fine with Netscape, but unfortunately it doesn't work with the
>>> Internet-explorer. (I just get the tekst displayed, but the redirection
>>> doens't work.
>>>
>>
>>If you are getting different behaviour from different display devices
>>then it is a sure sign that it is not a  Perl problem but a problem
>>with the display device - the same could be said of web browsers too -
>>You will get a better answer if you ask in a group that discusses the
>>differences between browsers.
>>
> Maybe I should be more specific in my question.
> 
> How can I make my perl-program redirect a user to his own directory/file.
> (In a more direct way than creating a redirection-page on-the fly.)
> 

The perhaps you need to ask in a CGI newsgroup as this is not specific
to Perl but general to the application area.  

[followups set to a suggested group]

/J\
-- 
"People say money brings its own problems. Rubbish, rubbish - I'm loaded -
it's fantastic" -


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

Date: 19 Nov 1999 22:56:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Encryption Algorithm for Perl Source Code??
Message-Id: <814ki3$6bo$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 03:14:39 GMT jut@letterbox.com wrote:
> Hello, I recently downloaded this script. I can't say where but when I
> was deconstructing it to see how it did it's stuff and to learn,
> imagine my horror when I saw a whole load of gibberish!!! 
> 

Of course thee file has been archived and packed somehow.  You will
have to tell us what the extension of the file was to be sure - but
usually files are tarred and gzipped .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 19 Nov 1999 14:59:39 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: FAQ 5.3: How do I count the number of lines in a file?
Message-Id: <slrn83beo6.l1a.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCCLXIX September MCMXCIII in
<URL:news:MPG.129cdcf4433be6f398a227@nntp.hpl.hp.com>:
`` 
`` As Tom doesn't play here lately, I'll venture to answer for him.
`` 
`` 1.  Portability.  Strange as it may seem to you, not every OS has a 'wc' 
`` command.

As Tom doesn't play here, let's me answer in the spirit of Tom:

   "Use the toolkit."


And here's my Perl golf entry:  perl -wlpe '}{$_=$.' file


Abigail
-- 
perl -wlpe '}{*_=*.}{' file


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 19 Nov 1999 11:09:50 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Fetch Dilbert.
Message-Id: <x7903uqx80.fsf@home.sysarch.com>

>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:

  JS> Uri Guttman <uri@sysarch.com> wrote:

  >> i think they should only put the core unix programs and libs in
  >> /usr and the third party (how do you define 3rd party in that
  >> world? :-) programs should go into /usr/local.

  JS> But isnt Perl core now ?

IMO, no. core utilitlies are the ones that you always expect to see in
traditional unixes in /usr/bin. they haven't changed in function for
years and that is good. who needs new variations of ls, rm, or even awk
anymore. perl on the other hand definitely evolves as p5p works on
it. for a similar reason i think gcc should also be in /usr/local as you
will want to install new versions over time. as red hat has shown they
(open source OS distributors) don't always keep up with the jones' too
well. since on solaris most of that code will default to install in
/usr/local whereas on linux it is /usr it causes a problem. hence my
desire to separate core programs (which won't change much over time)
from "third party" which will and should change.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 19 Nov 1999 14:53:55 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Fetch Dilbert.
Message-Id: <slrn83bede.l1a.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCCLXXI September MCMXCIII in
<URL:news:x7wvrepb3r.fsf@home.sysarch.com>:
;; >>>>> "A" == Abigail  <abigail@delanet.com> writes:
;; 
;;   A> The reason I prefer /opt over /usr/local is this:
;; 
;;   A>     $ rm -rf /opt/perl   # Poof. All of this package gone.
;; 
;; but then you have to add /opt/perl/bin to your path (and MANPATH,
;; etc.). that is true for each of the other 3rd party things you build in
;; /opt. i have seen sysadmins (if you can call them that) with each
;; package in their own /opt dir and all the attendant noise in the ENV
;; vars. 

So? You only do that once for each package. After downloading, making
and installing a package, some lines in the profile aren't that much
of a problem.

;;   A> With /usr/local, you have to browse through /usr/local/bin and figure
;;   A> out which binaries/scripts come with Perl and which don't. Not to mention
;;   A> figuring out which man pages need to disappear.
;; 
;; the man pages sit in /usr/local/lib/perl/*/man. the binaries are a minor
;; issue. each version usually has a link with its version number in
;; it. the support scripts are not as version specific IMO (i don't use
;; most of them).


Ok, so, putting the stuff in /opt has the drawback of having to change
PATH and MANPATH, but having the man pages in /usr/local/lib/perl/*/man
is ok, because man magically knows about that place, right? 



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 19 Nov 1999 15:15:05 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: file descriptors already used when perl starts
Message-Id: <slrn83bfl4.l1a.abigail@alexandra.delanet.com>

lee.lindley@bigfoot.com (lee.lindley@bigfoot.com) wrote on MMCCLXXI
September MCMXCIII in <URL:news:812dqr$r82$1@rguxd.viasystems.com>:
--
-- Nevertheless, I cannot remember reading any specification that
-- guarantees any file descriptor numbers other than 0,1 and 2.

Which specification says that?

   "By convention the Unix shells associate file descriptor 0 with
    the standard input of a process, file descriptor 1 with the
    standard output, and file descriptor 2 with the standard error.
    This is a convention employed by the Unix shells and many Unix
    applications -- it is not a feature of the kernel. Nevertheless,
    many Unix applications would break if these associations weren't
    followed.
    The magic numbers 0, 1, and 2 should be replaced in POSIX.1
    applications with the symbolic constants STDIN_FILENO, STDOUT_FILENO,
    and STDERROR_FILENO. These are defined in the <unistd.h> header."

            W. Richard Stevens:
               "Advanced Programming in the UNIX Environment"
                Addison-Wesley, 1993, p. 48.

--                           I think that there is a convention that the
-- next lowest available number is returned, but I don't know of any
-- guarantees.

   "An existing file descriptor is duplicated by either of the following
    functions:

        #include <unistd.h>
        int dup (int filedes);
        int dub2 (int filedes, int filedes2);

                    Both return: new file descriptor if OK, -1 on error.

    The new file descriptor returned by dup is garanteed to be the
    lowest numbered available file descriptor. With dup2 we specify
    the value of new descriptor with the filedes2 argument. If filedes2
    is already open, it is first closed. If filedes equals filedes2,
    then dup2 returns filedes2 without closing it."

            W. Richard Stevens:
               "Advanced Programming in the UNIX Environment"
                Addison-Wesley, 1993, p. 61-62.


Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 19 Nov 1999 22:45:11 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: file descriptors already used when perl starts
Message-Id: <814jtn$7op$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn83bfl4.l1a.abigail@alexandra.delanet.com>:
>    "By convention the Unix shells associate file descriptor 0 with
>     the standard input of a process, file descriptor 1 with the
>     standard output, and file descriptor 2 with the standard error.
>     This is a convention employed by the Unix shells and many Unix
>     applications -- it is not a feature of the kernel.

I doubt it very much.  This is the output from the process-tree viewer:

ilya     22627    pts/7    0:00                         xterm -e perl -de0
ilya     22628   pts/10    0:01                           perl -de0

As you can see, there is no shell in between.  Here are my tests:

Loading DB routines from perl5db.pl version 1.0402
Emacs support available.

Enter h or `h h' for help.

main::(-e:1):   0
  DB<1> x $x = <STDIN>
abad
0  'abad
'
  DB<2> print STDOUT '34'
34
  DB<3> print STDERR '34'
34

Unless you consider xterm as a shell.  Did you say that when kernel
starts a user's shell, it has no stdin/stdout/stderr associated to it,
but has a prepared tty?  Possible.  But is it probable?

I cannot easily manipulate shell on this machine.  Can somebody set
their shell to "perl -de0" and do the same things I did above?

Ilya


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 1435
**************************************


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