[12181] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5781 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 25 20:07:25 1999

Date: Tue, 25 May 99 17:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 25 May 1999     Volume: 8 Number: 5781

Today's topics:
    Re: Dereferencing a filehandle. (Charles DeRykus)
    Re: Forking and sleeping. ppith@my-dejanews.com
        forks & locking DBMs <otis@my-dejanews.com>
        help please bababozorg@aol.com
    Re: help please (Bob Trieger)
    Re: help please (Tad McClellan)
        Help with replacing of text (Code included)... <portboy@home.com>
    Re: leeches, compilers, and perl, oh my (all mine?) <tchrist@mox.perl.com>
    Re: leeches, compilers, and perl, oh my (all mine?) (I R A Aggie)
    Re: leeches, compilers, and perl, oh my (all mine?) (I R A Aggie)
    Re: leeches, compilers, and perl, oh my (all mine?) <revjack@radix.net>
    Re: Mac-specific Perl help requested - The Answer (yet  (Rodger Donaldson)
    Re: need an anti-leech script (I R A Aggie)
    Re: Open a textfile with a cgi-programm (Larry Rosler)
    Re: Open a textfile with a cgi-programm <jeromeo@atrieva.com>
        Perl and MySQL kickinapants@home.com
    Re: Perl compiler...If or when <corus@my-dejanews.com>
    Re: Perl compiler...If or when <tchrist@mox.perl.com>
    Re: Perl compiler...If or when <corus@my-dejanews.com>
    Re: Perl compiler...If or when <corus@my-dejanews.com>
    Re: Perl compiler...If or when (Larry Rosler)
    Re: PERLFUNC: tr/// - transliterate a string <uri@sysarch.com>
    Re: PERLFUNC: truncate - shorten a file <uri@sysarch.com>
        Safe.pm necessary for secure CGI? <gregm@well.com>
        simple question <pfefferz@colorado.edu>
    Re: simple question (Bob Trieger)
    Re: Sorting Problem (Larry Rosler)
        t <pfefferz@colorado.edu>
        Tcl/2k : The 7th USENIX Tcl/Tk Conference Call for Pape (Jennifer Radtke)
        Win32::OLE build 515 <a-damont@microsoft.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 25 May 1999 21:10:44 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Dereferencing a filehandle.
Message-Id: <FCB45w.A4z@news.boeing.com>

In article <7i4qhd$jnk$1@nnrp1.deja.com>, Anand  <anand@my-dejanews.com> wrote:
>In article <FC3Kqy.Eoy@news.boeing.com>,
>> ...
>>
>> my $fh = '/path/to/file';
>> open($fh, $fh) or die $!;
>
>Newbie: Can you tell how $fh acts both as a string variable and as well
>as a directory handle at the sametime?
>
>In "open($fh,$fh)" do both $fh refer to the same thing or are they in
>different namespaces?

They both refer to the same string but C<open>, finding a string 
instead of the expected typeglob, automagically creates a typeglob 
for you. 

Same thing for a bareword filehandle, e.g.,

   open  F,'/path/to/file' or die "open failed: $!";  

converts the bareword string F to a typeglob too. This happens 
under the covers and F is still a lowly string in other contexts. 

But, that means, you could also write this as:

    open(*F,'/path/to/file')  

Another, even uglier way:
  
    open(*F{IO}, '/path/to/file')

Take a look at the "Typeglobs and Symbol Tables" chapter in
"Advanced Perl Programing" for many details. 


hth,
--
Charles DeRykus


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

Date: Tue, 25 May 1999 22:45:43 GMT
From: ppith@my-dejanews.com
Subject: Re: Forking and sleeping.
Message-Id: <7if96n$kee$1@nnrp1.deja.com>

Thanks.  I ended up using the LWP UserAgent instead, but I
managed to incorporate the example of what "perldoc -f alarm"
spits out into a program I can always use later.  Thanks for all your
help...I knew I could depend on people in this newsgroup.

In article <37491697.6151874@news.skynet.be>,
  bart.lateur@skynet.be (Bart Lateur) wrote:
> ppith@my-dejanews.com wrote:
>
> >I want to time a function call that can be killed if it
> >takes too long to run.
>
> 	perldoc -f alarm
>
> It even gives a fine example on how to use it.
>
> But, seeing Jonathan Feinberg's reply, this may not be the best way to
> go for this specific application (something about "wheels"...).
>
> 	Bart.
>


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Tue, 25 May 1999 22:50:50 GMT
From: Otis Gospodnetic <otis@my-dejanews.com>
Subject: forks & locking DBMs
Message-Id: <7if9g8$kht$1@nnrp1.deja.com>

Hello,

I have a perl script that forks X number of processes.
The following code works fine when I fork only 1 process, and breaks
when I fork more than 1 process.

sub getData
{
    my (%dbData, %runData);

    # READ only from this DBM
    my $ddb = tie %dbData, "DB_File", $dataFile, O_RDWR, 0640, $DB_HASH
|| die "Cannot open file $dataFile: $!\n";
    my $fd = $ddb->fd;
    open(DDB_FH, "+<&=$fd") || die "Dup $!\n";
    unless (flock (DDB_FH, LOCK_SH | LOCK_NB))
    {
       print STDERR "$$: Waiting for read lock ($!) ...\n";
            unless (flock (DDB_FH, LOCK_SH)) { die "Flock: $!" }
    }

    # READ & WRITE to this DBM (may not exist, hence O_CREAT)
    my $rdb = tie %runData, "DB_File", $runFile, O_RDWR|O_CREAT, 0640,
$DB_HASH || die "Cannot open file $runFile: $!\n";

    # ERROR comes from the line below
    # Can't call method "fd" on an undefined value at MyScript line 271.

    my $fr = $rdb->fd;
    open(RDB_FH, "+<&=$fr") || die "Dup $!\n";
    unless (flock (RDB_FH, LOCK_EX | LOCK_NB))
    {
	print STDERR "++ $$: Waiting for write lock ($!) ...\n";
	unless (flock (RDB_FH, LOCK_EX)) { die "Flock: $!" }
    }

    # do some stuff with DBMs
    foreach my $id (1 .. 10)
    {
	if (defined $dbData{$id})
	{
	    print STDERR "++ Found ID: ", $id, "\n";
	    $runData{"cat$catid"} = "running|$id|$catid|$url";
	    $runData{$id}         = "running|$$|$catid";
	    $rdb->sync;
	    undef $rdb;
	    untie %runData;
	    flock(RDB_FH, LOCK_UN);
	    close(RDB_FH);
	    undef $ddb;
	    untie %dbData;
	    flock(DDB_FH, LOCK_UN);
	    close(DDB_FH);
	}
    }

    undef $rdb;
    untie %runData;
    flock(RDB_FH, LOCK_UN);
    close(RDB_FH);
    undef $ddb;
    untie %dbData;
    flock(DDB_FH, LOCK_UN);
    close(DDB_FH);

    print STDERR "++ No ID Found in DB?\n";
    sleep 1;
}

This subroutine is called from a forked process.
Can anyone see where the problem is?
It works fine when one process gets forked, but when two processes get
forked I get that error ...
Can't call method "fd" on an undefined value at MyScript line 271.

Thank you,

Otis


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Tue, 25 May 1999 22:08:13 GMT
From: bababozorg@aol.com
Subject: help please
Message-Id: <7if70a$ika$1@nnrp1.deja.com>

hi
i just has a problem which i never had though of this would be a
problem :)
anyway i have a string, i would like to cut or remove the "s" or "es"
at the end of this string.
how do i do that?
thanks
hamed


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Tue, 25 May 1999 23:21:59 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: help please
Message-Id: <7if9oj$cu7$1@ash.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
bababozorg@aol.com wrote:
>hi
>i just has a problem which i never had though of this would be a
>problem :)
>anyway i have a string, i would like to cut or remove the "s" or "es"
>at the end of this string.
>how do i do that?

s/e?s$//;

that will do what you asked, but as for knowing what words are plural 
and which just end with s or es is a whole other story and I ain't about 
to try that algorithm.




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

Date: Tue, 25 May 1999 13:58:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: help please
Message-Id: <qcoei7.q1l.ln@magna.metronet.com>

bababozorg@aol.com wrote:

: anyway i have a string, i would like to cut or remove the "s" or "es"
: at the end of this string.
: how do i do that?


   $string =~ s/s$//;  # so long 's'

   $string =~ s/es$//;  # so long 'es'



   $string = 'access';  # this data might cause a "problem"...



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 25 May 1999 23:10:30 GMT
From: Mitch <portboy@home.com>
Subject: Help with replacing of text (Code included)...
Message-Id: <374ABE1F.E0F0B912@home.com>

I'm trying to very simply search through a config file e.g.

foo 1234
bar 5678
etc....

and find the "bar" line.  That works fine.  Now I've written a
subroutine that should replace the "bar" line with another line.  All
that seems to be happening is that it removes the line from the file.

I've pasted in my code so you can show me the error of my ways,

Mitch



Here's the code used to replace a line....

sub switch {
        my($old,$new,$file) = @_;

        system("chmod +w $file");
        open(OUT,">$file.bak") || &show("Can't open $file!");
        open(FILE,"$file") || &show("Can't open $file!");

        while(<FILE>)
        {
                next if (/$old/);
                if (/$old/)
                {
                        if ($_ eq "$new\n")
                        {
                                print OUT;
                        }
                        else
                        {
                                print OUT "$new\n";
                        }
                        next;
                }
                print OUT;
        }

        close(FILE);
        close(OUT);
        system("/bin/mv $file.bak $file");
}

Here's a simple call to the switch subroutine....

 &switch($match, $replace, "~/foobar");

where $match = "bar 5678"
and $replace = "buwahaha you foo"



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

Date: 25 May 1999 16:01:39 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: leeches, compilers, and perl, oh my (all mine?)
Message-Id: <374b1dc3@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Greg Bartels <gbartels@xli.com> writes:
:so the guy wants to use a free tool so he can hoard his
:source code, so what?  

So I wouldn't dream of helping him, that's what.

:leech is a very charged word, by the way. 

Of course it is.  And a very apt one, as well.
You'll notice it in the subject headers, which I 
did not invent.

--tom
-- 
User, n.: "The word computer professionals use when they mean 'idiot'."
				- Dave Barry


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

Date: 25 May 1999 22:42:09 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: leeches, compilers, and perl, oh my (all mine?)
Message-Id: <slrn7km9vn.dlq.fl_aggie@thepentagon.com>

On Tue, 25 May 1999 16:55:36 -0400, Greg Bartels <gbartels@xli.com>, in
<374B0E48.7855C216@xli.com> wrote:

+ so the guy wants to use a free tool so he can hoard his
+ source code, so what?

He's not adding to the "public knowledgebase" of which you seem so fond.
Hoarding code is not the Perl way, either. This is what I said about it
a while back:

	The rich culture in the Perl community exists because
	everything is in the open.  Perl is more than _just_ a
	programming language, and far more than the sum of its parts.
	Hiding code just goes against that culture.

If you think you'll be able to protect your code thru anything but a
lawyer and contract law, you're mistaken. Obscuring your code doesn't
really hide it, you just make deciphering it more of a challenge.

+ we all take benifit from those who came before us.
+ is that leaching?

Until you give back, yes. That's not necessarily a bad thing, in the
learning stages.

+ I say we all stand on the shoulders of giants.

We are all giants, we just don't know it yet...

James


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

Date: 25 May 1999 22:44:42 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: leeches, compilers, and perl, oh my (all mine?)
Message-Id: <slrn7kma4g.dlq.fl_aggie@thepentagon.com>

On Tue, 25 May 1999 16:29:59 -0400, Greg Bartels <gbartels@xli.com>, in
<374B0847.AA8EB62B@xli.com> wrote:

+ at some point, Linux will become sophisticated enough that 
+ it will be the defacto standard. at which point, copyright
+ law or not, no company will make money trying to sell some
+ non-linux OS for desktop consumers.

If you believe that, I have a bridge over some swampland in New Jersey
that I want to sell to you.

James


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

Date: 25 May 1999 23:53:43 GMT
From: Waco Baptist <revjack@radix.net>
Subject: Re: leeches, compilers, and perl, oh my (all mine?)
Message-Id: <7ifd67$o4t$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Greg Bartels explains it all:

:Both threads have been going on for some time now,
:and everyone is dancing around the same issue.
:the issue is "how do I protect what is mine?"

A: Put it in a protected place.

-- 
  /~\  sterile treason pharmaceutic decolonize cistern chuckwalla bice
 C oo  gibbon landmark Ackerman vernier drench bellicose dystrophy Fal
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://www.radix.net/~revjack/mnj             revjack@radix.net


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

Date: Wed, 26 May 1999 11:29:12 +1200
From: rodgerd@wnl121.wnl.co.nz (Rodger Donaldson)
Subject: Re: Mac-specific Perl help requested - The Answer (yet another followup)
Message-Id: <slrn7kmci8.ckj.rodgerd@wnl121.wnl.co.nz>

On Mon, 24 May 1999 19:16:26 GMT, Josh Pointer <josh@bitwell.net> wrote:

>If nothing else, at least I now know that it's not just a case of
>overenthusiastic supporters. It's systemic.

When everyone is telling you that you are an ass, you may, in fact, be an
ass.

*plonk*

-- 
Rodger Donaldson			rodger.donaldson@wnl.co.nz
Systems Support				Direct line	: 04 474 0560
Wellington Newspapers Limited		Fax		: 04 474 0309
You are in a maze of twisty little companies, all working against each other.


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

Date: 25 May 1999 22:31:40 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: need an anti-leech script
Message-Id: <slrn7km9c2.dlq.fl_aggie@thepentagon.com>

On 25 May 1999 17:36:48 GMT, John Stanley <stanley@skyking.OCE.ORST.EDU>, in
<7ien3g$eav$1@news.NERO.NET> wrote:

+ The short answer was to create a script that checked the referrer and
+ return an image advertising ABC programs at the appropriate time. A big
+ yellow image, with the "abc" happy-face, saying "We Love TV" or "We
+ Love Drew, Wed 9PM Channel 12" on an official NBC web page was ROTFL
+ hilarious. At the time, this image was a full quarter of the main page.

Oh, gawd...that's too funny. Did they contact you, or redesign their
pages?

James


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

Date: Tue, 25 May 1999 15:27:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Open a textfile with a cgi-programm
Message-Id: <MPG.11b4c39d4e4c2ca8989af4@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <374B042D.1095908B@atrieva.com> on Tue, 25 May 1999 13:12:29 
-0700, Jerome O'Neil <jeromeo@atrieva.com> says...
+ Larry Rosler wrote:
+ 
+ > > Because you aren't asking perl to tell you.  Check the $! variable
+ > > for the answer.
+ > 
+ > Yes.  And it will probably say "no such file or directory".
+ 
+ If that is the problem, what else would you have it say?
+ 
+ >  As has been
+ > posted several times this morning alone (!), there is no assurance
+ > that your concept of the current directory and the web server's
+ > concept of the current directory are the same.
+ 
+ You can rest assured that my concept of the current working directory
+ and my web server's concept of the current working directory are one
+ and the same.

It was addressed to the original poster.  But I wish you would explain 
how you are assured that the current directory is what you think it is, 
without having set it to be that?  And how you would set it portably?  
One might locate the web root by using $ENV{PATH_TRANSLATED} which will 
be an absolute filename, but what about an arbitrary data file?

+ >  It's imperative to use an absolute
+ > pathname, or to chdir to an absolutely-named directory and go
+ > relative from there.
+ 
+ Well, I'll sort-of-disagree with that for two reasons.  Technically,
+ for maximum portability,  absolute filenames aren't always the best
+ solution, although resolution to one is certainly desirable. 

I'll repeat the question.  How does one open a file using a relative-to-
the-current-directory simple filename, when the program is being 
executed by the webserver?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 25 May 1999 15:58:44 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Open a textfile with a cgi-programm
Message-Id: <374B2B24.83B4B2B0@atrieva.com>

Larry Rosler wrote:
> -0700, Jerome O'Neil <jeromeo@atrieva.com> says...
> + You can rest assured that my concept of the current working directory
> + and my web server's concept of the current working directory are one
> + and the same.
> 
> It was addressed to the original poster.  But I wish you would explain
> how you are assured that the current directory is what you think it is,
> without having set it to be that?

Because I take pains to ensure my servers behave in a predictable
manner, and I understand the behavior and environment of the software
that they run.  

How do you do it?

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Tue, 25 May 1999 22:55:30 GMT
From: kickinapants@home.com
Subject: Perl and MySQL
Message-Id: <7if9p1$ksa$1@nnrp1.deja.com>

Hello Gang

I am about to embark on a shopping cart project. I will be interfacing
with MySQL databases that will keep track of menu items, shopping cart
contents, client history and info. The sections of the menu have sub
sections of a sort, a description of how their nachos are prepared and
then the different nachos are listed. The other tough one is pizzas,
there are lots of differnt types of pizza as well as a build your own
section. Then there is the mix and match pasta section.

I am looking for a shopping cart to do this. For 3 months now. I am
looking at writing the program myself. What I need to know is how to
connect to MYSQL databases from a Perl CGI.


Any help would be appreciated.

Ken Patenaude
www.dmatter.com


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Tue, 25 May 1999 21:47:59 GMT
From: Corus <corus@my-dejanews.com>
To: gbacon@cs.uah.edu
Subject: Re: Perl compiler...If or when
Message-Id: <7if5qf$hme$1@nnrp1.deja.com>

The day Science turns around and shoots Capitalism in the foot is the
day it points the same gun to its head and pulls the trigger.

So while you're there in the safety of your EDU domain writing
compilers, spare a thought for the rest of us in COM straggling to pay
your lecturers salaries.

sweet dreams...

In article <7ienpg$rg3$1@info2.uah.edu>,
  Greg Bacon <gbacon@cs.uah.edu> wrote:
> In article <7iekku$3v4$1@nnrp1.deja.com>,
> 	Corus <corus@my-dejanews.com> writes:
> : > The "decompiler" already exists!  I imagine people will be much
more
> : > motivated to work on the decompiler than the compiler if, for
nothing
> : > else, to thwart the efforts of evil source hoarders.
> :
> : Redefine your notion of evil.
>
> I will when I see the need.  Do you suppose there would even be an
> Internet if people had greedily hoarded their precious source and
> tried to squeeze out every last penny?
>
> : A person who without permission tries to "borrow" someone elses code
is
> : in the eyes of Science as evil as the person trying to keep it from
him.
> : In the eyes of *copyright* law, there is only one culprit.
>
> Evil breeds more evil.  Why do you suppose our hoarder was trying to
> keep his knowledge from everyone else?  Follow this river of evil to
> its source, and you'll be disappointed at what you find.
>
> : > The problem of someone depriving you of your rights to your
> : > intellectual property is a social one, not a technical one.
> :
> : So is the problem of people wanting to steal your Hi-Fi but I bet
you
> : locked your door when you left home this morning.
>
> Locks only keep honest people out.  I have windows all around my
house.
> Glass is a notoriously brittle material, and it's fairly trivial to
> break through.  In all honesty, I can do nothing to stop a
sufficiently
> motivated person from breaking into my house.  I could resort to
> building twenty-foot concrete walls and posting armed guards, but I'll
> just stick with the social solutions like locks and the police.
>
> : >Larry's giving away something of such
> : > tremendous value as perl is a fine example for us all.
> :
> : Yes I agree, in Larry Walls action, we see the notion of open source
> : software realised in all its glory.
> :
> : However as *Perl scripters* we find this notion imposed upon us
whether
> : we want to follow his example or not. At least as long as we choose
to
> : remain Perl scripters.
>
> I don't think there is a Perl programmer who would shed even a single
> tear if the door were to hit any source hoarder on the ass on his way
> out.
>
> [your pathetic excuse for a newsreader miswrapped this section.]
> : > So does gcc fail to be a compiler (standards issues aside) when I
invoke
> : > it as
> : >
> : >     % gcc -o /dev/null hello.c
> :
> : Oops. you got me there.
> : (Although I would swear the compiler spits out a binary even in this
> : case, it just gets dumped in a black hole :)
>
> How do you know?  What if gcc or some other compiler checks to see
> whether its output is going to the bitbucket and skips the code
> generation phase?  It would still be a compiler despite any ad hoc
> definitions or assumptions you may have formulated for yourself
despite
> the well established definitions of computer science.
>
> I really hate explaining this to someone and then having that person
> turn around and argue that a compiler must generate native code.
> It's like trying to convince someone that the earth really is round.
>
> : > Why must Perl help people who won't help themselves?  The people
in
> : > your scenario had legal recourse.  Still, I wonder why they would
> : > hire people they couldn't trust.
> :
> : They did when they hired them.
> : But they probably forgot to subject them to a lie detector test.
>
> It seems an absurd business practice to me for a startup that is
walking
> such a fine financial line to take a risk like hiring a total
stranger.
>
> : Not to mention that you seem to be assuming that the guilty parties
> : get caught.  Imagine a scenario where you've worked hard for a year
> : building a website only to find that 2 months after its launch a
site
> : offering identical functionallity springs up. The only difference
being
> : that this one is 3 times as fast as yours.  You know why? Because
> : they didn't have any development costs.  All their funds have gone
> : towards the building of their infrastructure.
>
> If the functionality is identical, then you'd probably have grounds
> for a lawsuit.  Look at all the books that have been pulled from the
> shelves because they stole from Perl's documentation.  I'm sure Tom
> could enumerate each and every one if you're really interested in
> knowing.
>
> : The "who stands to gain" is left as an exercise to the reader.
> : (I'll help you, advertising, telecomms, hardware manufacturers)
>
> I don't see how your conclusion follows logically.
>
> : Is this they way you see for Science to go forward?
>
> Do you claim that we'll make progress by hiding our information and
> knowledge from one another?  Part of the patent and copyright
processes
> is *disclosing* the new technology or expression.
>
> : > How many times do we have to tell you that
> : > there's already a "decompiler"?
> :
> : 'Resistance is futile' I hear you shout. The days of people taking
> : credit for their own efforts are over!
>
> Bullshit.  Dispense immediately with your FUD.  It will only harm your
> credibility here.
>
> : (And please let's keep idealism
> : at bay by recognising money its place in our society)
>
> You're heading toward a very tired and very old argument.  It *is*
> quite possible to make *lots* of money with open source software.
> Read ESR's excellent case at
<URL:http://www.opensource.org/for-suits.html>.
>
> : Long live plagiarism.
>
> More FUD.  Strike two.
>
> : Long live decompilers who allow us to obtain and
> : modify other peoples code to suit our needs.
>
> If this is honestly how you believe, then you are a hypocrite of the
> worst sort for using perl.  Stick by your convictions and delete every
> copy of perl and its source that you have obtained to suit your needs.
> Send a check to Larry for $1000.  After that, you'll cease to be a
> hypocrite and may resume using perl to suit your needs.
>
> : And before anyone else accusses me of being a hoarder let me get one
> : point accross loud and clear:
> :
> : I believe that we are all entitled to maintaining our own views
about
> : the world and in this particular case software.
>
> You're entitled to believe that the world is flat or that men never
> landed on the moon or that the next millenium begins in less than one
> year.  You're even entitled to believe that the sum of one and one is
> three.  Just don't try to participate in serious discussions with
> intelligent people.
>
> : As I mentioned in my previous post, there are certain types of
software
> : whose authors benefit from it being open source and there are other
> : types of software for which open source is just not a viable option.
>
> I know of a place inhabited by pink elephants with purple spots.
Anyone
> can make vacuous claims.  They carry no weight without examples.
>
> : Perl is more than a programming language. It's a way of life.
>
> Now you're catching on.
>
> : It stands for a world, where all people share each others
possessions,
> : be it a virtual one such as the internet.
> :
> : It *IS* intellectual communism. Are we as a global society ready for
it?
>
> Nope.  We share with each other, but we don't share ownership and
> control.  Even capitalists share with one another.
>
> Greg
> --
> Why do people give each other flowers? To celebrate various important
> occasions, they're killing living creatures? Why restrict it to
plants?
> "Sweetheart, let's make up.  Have this deceased squirrel."
>     -- Jerry Seinfeld
>


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 25 May 1999 16:11:06 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl compiler...If or when
Message-Id: <374b1ffa@cs.colorado.edu>


In comp.lang.perl.misc, Corus <corus@my-dejanews.com> writes a mere
eight lines of soi-disantcontent, followed by an unfathomable TWO HUNDRED
AND ONE lines of horridly mutilated quoted text from previous articles,
proving for the third time in fewer than that many postings that he can't
even use a newsreader.  

Sigh.  

Please go write your own newsreader next time, so you actually understand
how one works.  You also seem to have neglected to read the Netiquette
guide.  I'll send it to you, which shall be your last communication 
from me.

*plonk*

--tom
-- 
    Though I'll admit readability suffers slightly... 
                    --Larry Wall in <2969@jato.Jpl.Nasa.Gov>


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

Date: Tue, 25 May 1999 23:54:54 +0100
From: Corus <corus@my-dejanews.com>
Subject: Re: Perl compiler...If or when
Message-Id: <374B2A3E.78EC13FC@my-dejanews.com>

The day Science turns around and shoots Capitalism in the foot is the
day it points the same gun to its head and pulls the trigger.

So while you're there in the safety of your EDU domain writing
compilers, spare a thought for the rest of us in COM straggling to pay
your lecturers salaries.

sweet dreams...


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

Date: Tue, 25 May 1999 23:58:24 +0100
From: Corus <corus@my-dejanews.com>
Subject: Re: Perl compiler...If or when
Message-Id: <374B2B10.5125855D@my-dejanews.com>

> And that's hogwash.  Next time, I'll use stronger worlds.
If you're running out of arguments feel free.

> What a fine world that will be!
You can draw your picture anyway it pleases you most.
You can try misquote me and put words into my mouth, the bottom line is
that without competition there is no progress. It's one thing sharing
your scientific findings with others in your domain and it's another
expecting companies to share theirs with their competitors.
You can't invent a formula, apply it to all situations and expect to to
work. Lots of people have tried it in the past but they have failed.
Trust me.

> 
> You're using the word "communism" for its connotations, not its
> denotations.  That's dirty pool.
On the contrary I'm using the word communism with one and only one
meaning.
The attempt to impose equality to everything and everyone.

> 
> No, of course you don't have to add to the sum of human knowledge,
> whether it be pure science, computing science, or just plain > programming.
> But no one here is under any obligation to help you, and as you see,
> few are so inclined.  If we all played the sickening Game of Greed,
> we'd all be worse off for it.  Fortunately, most of us choose not to.

That which you call the sickening Game of Greed is what gave birth to
what you so much love.
Unix wouldn't exist without the greed of AT&T.
Leonardo DaVinci's aeroplane wings had Coca-Cola printed on them.

And here you are today, downcasting Greed and Capitalism at the top of
your voice, tapping away on a keyboard which is the product of that very
Greed. Doing it through a medium that is capitalism in its purest form
(or did you really think that the internet was put together by hackers).
Your words carried across the world by routers running proprietary
software and telecommunication lines whose rich owners look down on you
and laugh, for while you're shouting at the top of your voice
anathematizing them, they know that had it not been for their ideals
yours wouldn't be heard.

regards...


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

Date: Tue, 25 May 1999 16:34:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl compiler...If or when
Message-Id: <MPG.11b4d360609f8a2a989af5@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7if5jc$hc2$1@nnrp1.deja.com> on Tue, 25 May 1999 21:44:13 
GMT, Corus <corus@my-dejanews.com> says...
 ...
> Unix wouldn't exist without the greed of AT&T.

I'll step in on that one, which is diametrically opposite to the truth.

Unix wouldn't exist without the *generosity* of AT&T, which was perhaps 
motivated in part by a Consent Decree of about 1956 that restricted the 
company from making money by selling software.  Unix was developed in a 
research department of Bell Labs, and was given away to educational or 
other noncommercial users for no more than the cost of the distribution 
medium.  The recipients were free (in the Stallman sense) to use it as 
they wished.  In particular, the University of California at Berkeley 
invested many graduate students to evolve the system, which was still 
given away free (in the economic sense).

AT&T could well have kept the system internal and proprietary, and 
applied it only to the computers in the Electronic Switching Systems 
that is was needed for.  Thompson and Ritchie persuaded the company to 
give away this valuable intellectual property, which created a paradigm 
for the later Free Software movement.

Please try to keep your presentations of history closer to reality.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 25 May 1999 19:13:24 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: PERLFUNC: tr/// - transliterate a string
Message-Id: <x7k8twg2uj.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> [Posted and a courtesy copy mailed.]
  LR> In article <37497614@cs.colorado.edu> on 24 May 1999 09:53:56 -0700, Tom 
  LR> Christiansen <perlfaq-suggestions@perl.com> says...
  >> NAME
  >> tr/// - transliterate a string
  >> 
  >> SYNOPSIS
  >> tr///
  >> 
  >> DESCRIPTION
  >> The transliteration operator. Same as `y///'. See the perlop
  >> manpage.

  LR> About a month ago, I tried to defend the use of 'transliterate'
  LR> for this operator, and was persuaded by the group that 'translate'
  LR> is closer (and two syllables shorter :-).

one down, who knows how many to go!

  LR> 'Transliteration' denotes the replacement of each character of a string 
  LR> by a corresponding representation in another character set, not by a 
  LR> character in the same character set.

  LR> So one can transliterate Greek theta-epsilon-omicron-sigma to Latin 
  LR> 'theos' (not even character-for-character), but one translates Latin 
  LR> 'HAL' to Latin 'IBM'. 

that was sort of my point all along. transliterate is using a 
char set (like english/latin) to pronouce words in a different language
(like hebrew) which has no direct letter for letter mapping. i have seen
the english letters 'h', 'ch', 'kh' all for the 'ch' sound in
hebrew. none are right as english does not have that sound in its
lexicon.

translate means changing a mapping which is exactly what the tr op
does. think of it as a permuted index on a array of chars. you would
never call that transliteration. the fact that the data elements are
chars in a string does not mean the tr op is used only for
transliteration. it used for binary manipulation which doesn't come near
the human language meanings of transliteration.

the name for both historical (as i have documented in the past) and
semantically should be translate. it is a translation of bytes using a
map, not a transliteration of langauge chars from one set to another.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 25 May 1999 19:26:33 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: PERLFUNC: truncate - shorten a file
Message-Id: <x7g14kg28m.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:


  LR> Last week, someone asked how to create a file of length 10 Mbytes.  
  LR> Except for me, those who answered suggested writing 10 Mbytes to the 
  LR> file.  I verified that truncate() would *grow* a file to arbitrary 
  LR> length, on HP-UX and Windows NT at least.

is that the same as a file created with mkfile 10m? it is a not well
known unix thing that seeking and writing to a spot beyond the end of a
file will not create data in the gaps. reads from there guaranteed to
return null bytes but the inode doesn't point to any allocated blocks in
that region.

so maybe truncate is just doing some form of seek and truncating to that
spot. my test on solaris proves this:

> mkfile 1m foo
> l foo
-rw-------   1 uri      other    1048576 May 25 19:19 foo
> du foo
1032    foo

> touch foo2
> l foo2
-rw-r--r--   1 uri      other          0 May 25 19:20 foo2
> perl -e 'truncate "foo2", 1048576'
> l foo2
-rw-r--r--   1 uri      other    1048576 May 25 19:20 foo2
> du foo2
16      foo2


so it is an empty file with a far seek point. unless you want to read
only null bytes this is not to useful. the unix mkfile command builds
real files (typically they are used for swap or db disks) by copying
from /dev/zero or mmp or such.

i wonder what nt is really doing? who knows, maybe they waste their time
in truncate doing actual copies?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 25 May 1999 15:38:16 -0700
From: Greg McCann <gregm@well.com>
Subject: Safe.pm necessary for secure CGI?
Message-Id: <374B2658.A23764C8@well.com>

I just talked to an internet "security expert" who said that I should be using
Safe.pm for secure cgi programming in Perl, and that not using it would make my
system vulnerable - that Perl "as-is" is full of security holes.  Now I'm
worried.  Under what circumstances, if any, is this true?  I don't see anything
in the description of Safe.pm that relates specifically to cgi programming.

Thanks,

Greg

-- 

======================
Gregory McCann
http://www.calypteanna.com

"Be kind, for everyone you meet is fighting a great battle."  Saint Philo of
Alexandria


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

Date: Tue, 25 May 1999 16:54:56 -0600
From: pfefferz <pfefferz@colorado.edu>
Subject: simple question
Message-Id: <374B2A40.5BF2639C@colorado.edu>

Whats at work behind the expression:

$name =~ /^Randal\b/i

why does the string Randal have to be between the slashes?



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

Date: Tue, 25 May 1999 23:27:34 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: simple question
Message-Id: <7ifa32$cu7$2@ash.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
pfefferz@colorado.edu wrote:
>Whats at work behind the expression:
>
>$name =~ /^Randal\b/i
>
>why does the string Randal have to be between the slashes?

It is a regular expression and it doesn't have to be between slashes, 
you can use just about any meta character.

perldoc perlre



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

Date: Tue, 25 May 1999 16:50:33 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Sorting Problem
Message-Id: <MPG.11b4d7211bbfd18a989af6@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <m1r9o4u85u.fsf@halfdome.holdit.com> on 25 May 1999 14:54:53 
-0700, Randal L. Schwartz <merlyn@stonehenge.com> says...
> >>>>> "John" == John Porter <jdporter@min.net> writes:
> 
> John>   map  { /(\d+)/; [ $_, $1 ] }
> 
> Bad.  never use $1 unless you checked the result of the match
> that you thought set it.  Otherwise, you get a previous (or outer)
> $1.  bad.

I thought John might have used this:

          map  { [ $_, /(\d+)/ ] }

which produces undef if the match fails.  That might be dealt with in 
the sortsub, either by testing (but then why not test during the map?) 
or by arithmetic (yielding 0) under

          { local $^W = 0; $a->[1] <=> $b->[1] }

That seems less Bad, no?  This presumably is an exception in the data, 
so 0 might be reasonable, certainly better than the 'previous' value of 
$1.
 
-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 25 May 1999 16:52:44 -0600
From: pfefferz <pfefferz@colorado.edu>
Subject: t
Message-Id: <374B29BC.9C624DED@colorado.edu>





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

Date: Tue, 25 May 1999 21:50:38 GMT
From: jennifer@usenix.org (Jennifer Radtke)
Subject: Tcl/2k : The 7th USENIX Tcl/Tk Conference Call for Papers
Message-Id: <FCB60E.A5@usenix.org>
Keywords: USENIX, Tcl/TK, Tcl, TK, conference, tutorials, training,  Invited Talks, research, Refereed Papers, Unix, Cross-Platform Development, CGI Scripting, Object Oriented Programing, Mega Widgets, Database, Client/Server Applications, extension Building, SWIG, C, Debugging, testing, Packaging, Java, HTTP Tcl Daemon, CGI-BIN, mapping, embedding, applications, commands, Data Objects, Tycho Slate, WinACIF, Iclient/Iserver, Distributed, language, management, Yacc, Corba, Novell, extensions, designing, supporting, developing, portable, opensource GUI, rapid-development, extensible, X11 Windows

Tcl/2k : The 7th USENIX Tcl/Tk Conference
February 14-18, 2000
Austin, Texas, USA

Sponsored by USENIX, The Advanced Computing Systems Association
----------------------------------------------------------
Please find the Call for Papers at
http://www.usenix.org/events/tcl2k/cfp
----------------------------------------------------------
Paper submissions due: September 1, 1999
Demonstration and Panel Proposals due: September 1, 1999
Poster submissions due: December 8, 1999

The 7th USENIX Tcl/Tk Conference is a forum to:
* bring together Tcl/Tk researchers and practitioners
* publish and present current work involving Tcl/Tk
* learn about the latest developments in Tcl/Tk
* plan for future Tcl/Tk related developments

The conference program will include formal paper and panel presentations,
poster and both reviewed and informal demonstrations, works-in-progress,
Birds-of-a-Feather sessions, and two-days of high-quality tutorials.  All
forms of participation provide an opportunity to report on original Tcl/Tk
research.

Formal papers should address topics of interest to experienced Tcl/Tk
programmers; posters and informal demos may be geared to any level of user
from beginner to expert. Best Paper Awards will be given for the best
paper and best student paper at the conference.
==========================================================================
The USENIX Association's international membership includes engineers,
system administrators, and computer scientists working on the cutting edge
of  systems and software.  Our conferences are recognized for their
technical excellence and pragmatic emphases.




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

Date: Tue, 25 May 1999 00:29:55 -0700
From: "Damon Torgerson" <a-damont@microsoft.com>
Subject: Win32::OLE build 515
Message-Id: <7if99b$2je@news.dns.microsoft.com>

Okay, two quick questions. . .

1) I've installed build 515 and I still can't "use Win32::OLE;"  I have to
continue to "use OLE;"  I'm far from a Perl installation guru so any ideas?

2) I can't seem to open a connection to a database.  I've basically taken
some VB code and converted it to Perl and now it doesn't want to go.  My
main problem is opening my connection to the database

$conn->Open($connectionString) or die "This stupid thing won't connect: $!";

I'm quite confident my $connectionString is okay because it works elsewhere.
 . .any ideas?

Thanks a bunch,
Damon






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

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 5781
**************************************

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