[8059] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1684 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 20 15:27:10 1998

Date: Tue, 20 Jan 98 12:00:24 -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           Tue, 20 Jan 1998     Volume: 8 Number: 1684

Today's topics:
        [Help] Global variables and use of between package modu (Tarang K. Patel)
        A question. <vchandra@mail.delcoelect.com>
    Re: are there something like "Perl for Idiot" in Bookst <rootbeer@teleport.com>
    Re: automatically running a perl script (brian d foy)
    Re: automatically running a perl script (Dan Greenblatt)
    Re: automatically running a perl script <rra@stanford.edu>
    Re: can i do this? <rootbeer@teleport.com>
    Re: CGI-BIN script - parameter encryption <malunjkars@aol.com>
        FAQ too big (Was: Re: PERL forking) <rootbeer@teleport.com>
    Re: File name from descriptor <rootbeer@teleport.com>
    Re: GetOpts::Std and 'Use of Uninitialized variable' er <rootbeer@teleport.com>
    Re: Going Nuts with a simple script! Help! <rootbeer@teleport.com>
    Re: handling <input type=image> <rootbeer@teleport.com>
    Re: help - torture testing webserver? <rootbeer@teleport.com>
    Re: how do i get full path to $0 (Martin Vorlaender)
        How to convert char to ASCII value? <edwinm@cory.eecs.berkeley.edu>
    Re: I need some help pleeze (Martin Vorlaender)
    Re: Leaner and Meaner:  Is undump an answer? (brian d foy)
        Newer than New . . . :-)) <rgbelon@yahoo.com>
    Re: Reload by perl - is it possible? <NerveGas-goaway@inconnect.com>
    Re: source into binary code (John Stanley)
    Re: source into binary code <rra@stanford.edu>
    Re: space searching? <joseph@5sigma.com>
    Re: Switch statement in Perl-5??? <rootbeer@teleport.com>
        Win32::Filesecurity question. <tim@hcirisc.cs.binghamton.edu>
    Re: WWWBoard Help (Jeremy D. Zawodny)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 Jan 1998 18:53:20 GMT
From: fruitbat@nas.nasa.gov (Tarang K. Patel)
Subject: [Help] Global variables and use of between package modules.
Message-Id: <6a2rr0$f63$1@cnn.nas.nasa.gov>
Keywords: perl5, global

Hi,

 I have a problem that I run into is having GLOBALS defined in one package
 be transparent in another. I understood having the "use" statement and the
 Globals exported should have taken care of this. However I seem to be missing
 some insight in this. Here is an example that will show what I mean. As someone
 pointed out that this is due to circular nature of the example shown below.
 i.e A uses B , and B use A. But how else does one address useage of GLOBAL's
 in a module that have been defined in another package.

 when I look at why I am making packages, of code that otherwise would be in the
 single package, then I come up with the answer of managing large code files.

 I suspect that I should just use the single package spanning multiple files in
 this case.



 file A.pm
 ---------

package A;
use Exporter ();
use vars     qw(@ISA @EXPORT @EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT = qw($a func1);
@EXPORT_OK = ();
use English;
use vars qw($a);
use Vis::B;

$a="c{}"; # GLOBAL var

sub func1 {

my ($subname);

$subname = ref bless [];

print "This is module $subname in package A, and \$a= $a\n";
$d=&c();
print  "Back in package $subname and \$a = $a, returned from \&c\(\) with $d\n";
}

 File Vis/B.pm
 -------------
package Vis::B;
use Exporter ();
use vars     qw( @ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(&c);
use English;
use lib "../";
use A;
sub c {
my $module = ref bless[];
print "First attempt in module $module \$a= $a\n";
print "A Fully qualified var attempt in $module \$A::a= $A::a\n";
$a .= " $module";
return 1;
}

 RESULTS
 -------
This is module A in package A, and $a= c{}
First attempt in module Vis::B $a=
A Fully qualified var attempt in Vis::B $A::a= c{}
Back in package A and $a = c{}, returned from &c() with 1

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

 [Q] Why is $a not visible in Vis::B::func1() as the global $a
     declared in "package A" ?

  Surely the "use" and "@Export" statements take care of this so 

 [Q] Why do I have to fully qualify a package variable that has been
     exported ?

     $A::a  should not be required for exported vars right ?

 Obviously I'd rather not have a FULLY QUALIFIED GLOBAL being used in the
 code to make life easier if package names were to change for instance.

 When I look at why I am making packages, of code that otherwise would be in the
 single package, then I come up with the answer of managing large code files.

 I suspect that I should just use the single package spanning multiple files in
 this case. But only if I were clear about how to achieve this, for a while back
 there I thought I was.

 Any help is much appreciated.

    Tarang

-- 
Tarang Kumar Patel.     WWW home:http://www.nas.nasa.gov/
NASA Ames Research Center, MS 258-1, Moffett Field, CA 94035-1000
Email: maumau@nas.nasa.gov, Tel:(650) 604-4721 fax: (650) 604 2238
Stated views are my own IDEA, as I'm another I.D.E.A man "I Didn't Explain All"


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

Date: Tue, 20 Jan 1998 14:33:08 -0500
From: "V. Chandrasekhar" <vchandra@mail.delcoelect.com>
Subject: A question.
Message-Id: <34C4FBF4.4A47@mail.delcoelect.com>

1. I have data files that contain lines such as the following:

1.092565  7.906363E-02 -.4043237  1.167659  .7806026  6.076082E-02
-.6601424 1.024119  20.2  0  0  0

The above is one line consisting of 12 'words'. As may be seen, some of
the words are in exponential format and some are not.

2. I need to print the above to a file in hex, such that each word is 
two-byte. Thus, the output will look like:


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1   2   3   4   5   6   7   8   9   10  11  12

Word 1 is 1.092565 in hex
Word 6 is 6.076082E-02 in hex etc. 

3. I can read the line in and split it into the individual words and
store them in $temp1, $temp2, etc. At this point, (I think that) 
$temp1 contains the string 1.092565 etc.

4. I am lost as to what all should be done to perform the necessary
conversions and print out the four hex characters for each word. I
am struggling with pack and sprintf.

5. I would appreciate help including pointers to books. (The only
book I have is the Camel book. I am coming back to Perl after a 
three year layoff from Perl. I work for a service company and have 
very little say in what languages are employed, in general. I want 
to write very comprehendable code and find Perl terrific in this
regard.)

6. Regards.

Chandrasekhar


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

Date: Tue, 20 Jan 1998 11:39:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chat U <uchat@rocketmail.com>
Subject: Re: are there something like "Perl for Idiot" in Bookstore?
Message-Id: <Pine.GSO.3.96.980120113842.6319J-100000@user2.teleport.com>

On 20 Jan 1998, Chat U wrote:

> Any comments about Perl books for beginer?

Yes, and you'll find them in the docs and FAQs. Have fun with Perl!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 14:27:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: automatically running a perl script
Message-Id: <comdog-ya02408000R2001981427580001@news.panix.com>
Keywords: from just another new york perl hacker

In article <laP$tHA28Ox0EwFK@cydaps.co.uk>, James <James@cydaps.nospam.co.uk> posted:

>I have a script that I need to get to automatically startup at 10.00am
>GMT each day, everyday. Does anyone know how I can do this?

man cron
man at

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Tue, 20 Jan 1998 11:23:00 -0800
From: danielg@ea.com (Dan Greenblatt)
Subject: Re: automatically running a perl script
Message-Id: <danielg-ya02408000R2001981123000001@newshost.ea.com>

In article <laP$tHA28Ox0EwFK@cydaps.co.uk>, James
<James@cydaps.nospam.co.uk> wrote:

> Hi,
> 
> I have a script that I need to get to automatically startup at 10.00am
> GMT each day, everyday. Does anyone know how I can do this?

This isn't related to Perl, but...

Type "man crontab" at your UN*X shell prompt and see what pops up.

> James

-- 
Dan Greenblatt                               danielg@ea.com
Lord of the Snow Monkeys                     Electronic Arts
These are MY opinions, not my employer's.  Capiche?


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

Date: 20 Jan 1998 11:25:03 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: automatically running a perl script
Message-Id: <m3hg6z7xtc.fsf@windlord.Stanford.EDU>

James <James@cydaps.nospam.co.uk> writes:

> I have a script that I need to get to automatically startup at 10.00am
> GMT each day, everyday. Does anyone know how I can do this?

man crontab.

(This is not a Perl question.  This answer is Unix-specific.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 20 Jan 1998 11:14:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Richard Remington <richard.remington@gateway2000.com>
Subject: Re: can i do this?
Message-Id: <Pine.GSO.3.96.980120111404.6319C-100000@user2.teleport.com>

On Mon, 19 Jan 1998, Richard Remington wrote:

> open (TEMP, $FileToOpen);

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> i have some undefined reservations, especially for hi-load situations.
> maybe because i am keeping the file open for longer then if i slurp it
> in @in = <TEMP>??

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 11:12:03 -0800
From: Sanjay <malunjkars@aol.com>
To: Mike Haberfield <mikeh@summitfs.demon.co.uk>
Subject: Re: CGI-BIN script - parameter encryption
Message-Id: <34C4F703.59B0@aol.com>

Mike Haberfield wrote:
> Is there any way to either encrypt the parameters before they're sent to
> my cgi-bin script, or prevent the parameters from being displayed as
> part of the URL in the Location field when the result screen is
> displayed.

Have you tried using method="post" in your form tag of the HTML form
with userid/password fields ? this usually doesn't show fields in the
url.

hope it helps.

-sanjay


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

Date: Tue, 20 Jan 1998 11:30:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: ARCO Chemical Company <cbpkxh@arcochem.com>
Subject: FAQ too big (Was: Re: PERL forking)
Message-Id: <Pine.GSO.3.96.980120112716.6319F-100000@user2.teleport.com>

On Mon, 19 Jan 1998, ARCO Chemical Company wrote:

>    P.S. The Perl FAQ is TOO big!!

If everybody would only read it before posting, none of the questions
would be frequently asked any longer, and then we could virtually
eliminate the FAQ, couldn't we? Oh, wait...

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 11:32:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Stashower <rc0230@email.mot.com>
Subject: Re: File name from descriptor
Message-Id: <Pine.GSO.3.96.980120113058.6319G-100000@user2.teleport.com>

On Mon, 19 Jan 1998, David Stashower wrote:

> Is there a way to retrieve the file name (relative, full pathname,
> whatever) from an "open" file-descriptor ?  

Not generally, since the file in question may have zero, one, two, or any
number of names. If you'll be needing the filename later, you should
generally save the name around the time you open the file. (You could use
an array indexed by the fileno() value, perhaps.) Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 11:04:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Hazen <mhazen@franklin.uga.edu>
Subject: Re: GetOpts::Std and 'Use of Uninitialized variable' errors?
Message-Id: <Pine.GSO.3.96.980120105255.6319B-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Mark Hazen wrote:

> Ah, but I get errors if I try to do a File::Find in a directory that
> isn't in ENV{'PATH'} if I've got taint checks on.... :(

I think you're mistaken; in my experience, you needn't have any entry in
your PATH except for a directory which contains a program you'll be
needing to locate. In this case, File::Find needs pwd, and there's
'/bin/pwd' on my machine, so I include '/bin' in the PATH. (The command
'which pwd' may help you to find it on your machine.)

>  #!/usr/bin/perl -Tw
>  use File::Find;  
>  &find('./');
>  exit;
>  sub wanted {
>      (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
>      (int(-M _) == 2) &&  -f _;}

I got that to work on my machine by adding this line. Maybe something
similar will work for you.

    BEGIN { $ENV{PATH} = '/bin'; $ENV{CDPATH} = $ENV{ENV} = '' }

> I'm just trying to be *overly* paranoid. :)

For good security, you can't be too paranoid. :-)

Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: Tue, 20 Jan 1998 11:49:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John <nospam43423123@hotmail.com>
Subject: Re: Going Nuts with a simple script! Help!
Message-Id: <Pine.GSO.3.96.980120114629.6319L-100000@user2.teleport.com>

On Tue, 20 Jan 1998, John wrote:

> I want to open a file called http://something

That's not a file; that's a (placeholder) URL. (It may point to a file, of
course.)

> Then I want to take the guts of that file, and stick
> it inside another web page.  

You could fetch the remote page with LWP. You can find LWP on CPAN.

> And I want to run it using an SSI call.

SSI calls are features of servers, not of Perl. The people in a newsgroup
about servers should be able to give you a better and more-complete answer
than we can here. Good luck! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 11:24:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: adam <none@nowhere.net>
Subject: Re: handling <input type=image>
Message-Id: <Pine.GSO.3.96.980120112010.6319E-100000@user2.teleport.com>

On Mon, 19 Jan 1998, adam wrote:

> Subject: handling <input type=image>
> 
> what is the easiest way to handle this in perl? 

Use a script.    (Ask a vague question, get an answer of some type... :-)

> i have a few on a page that each trigger different events.  but, the
> input image returns a number as value. so i have to give each image a
> different name and check for the name. it seems like there must be an
> easier way to handle this. i have seen any examples of handling multiple
> <input type=image> anywhere on the net. 
> 	does anybody have any suggestions?

I'm not sure what you want. Maybe you're trying to make a script which can
name images with unique names. In that case, the -e filetest operator may
be useful. If you need something else that's not covered in the Perl docs,
you may need to ask again. 

Of course, if your question isn't Perl-specific (that is, if you're
looking for a solution which could be implemented in any programming
language, not just in Perl) then you may need to ask in a newsgroup about
HTML or CGI or something like that. Good luck! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 11:35:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ken Gaugler <keng@hybrid.com>
Subject: Re: help - torture testing webserver?
Message-Id: <Pine.GSO.3.96.980120113336.6319H-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Ken Gaugler wrote:

> There was a program in volume 8 of The Perl Journal that could be used
> to torture test webservers. Unfortunately there are some issues with
> the Perl installation that for now prevent me from using that script.

Maybe you should fix your Perl installation. 

> Are there any good freeware/shareware/$$ware programs available for
> pounding a server, or to see if there are any configuration problems,
> security holes, etc? If my server can be broken, I would like to know
> before I turn it loose on the 'net.

This sounds like a question for a newsgroup about servers, rather than one
about Perl, doesn't it? People in an appropriate newsgroup should be able
to give you a better and more-complete answer than we can here. Good luck! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 20 Jan 1998 19:30:09 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: how do i get full path to $0
Message-Id: <34c4ed31.524144494f47414741@radiogaga.harz.de>

John <john.crawshaw@london.pgs.com> said:
: I know $0 gives me the program name and also
: File::Basename will give me something similar but how
: do I get the full path to where its called from.

Have a look at the FindBin module (in the standard distribution).

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Tue, 20 Jan 1998 11:34:56 -0800
From: Edwin M Mercado <edwinm@cory.eecs.berkeley.edu>
Subject: How to convert char to ASCII value?
Message-Id: <34C4FC60.ADC@cory.eecs.berkeley.edu>

Hi,

Does Perl have a built-in function to convert a single character
to its ASCII value, e.g.

	$asciival = some_func('A');    #$asciival = 65 (not sure,
				       #dont have ASCII table with me

Thanks in advance for any help you can offer.

-edwin mercado
edwinm@cory.eecs.berkeley.edu


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

Date: Tue, 20 Jan 1998 19:33:53 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: I need some help pleeze
Message-Id: <34c4ee11.524144494f47414741@radiogaga.harz.de>

David Waring (dwaring@nwsr.com) wrote:
: Just wondering, what is the == doing when comparing two strings?  In other
: words, why is  ($sex == "M") true when $sex = "F"?

== puts its arguments in a numerical context, so the contents of $sex
and "M" are interpreted as numbers, yielding 0 in both cases. So the
numerical comparison is true.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Tue, 20 Jan 1998 14:25:23 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Leaner and Meaner:  Is undump an answer?
Message-Id: <comdog-ya02408000R2001981425230001@news.panix.com>
Keywords: from just another new york perl hacker

In article <885321448.385286147@dejanews.com>, Gary Lawrence Murphy <garym@sympatico.ca> posted:

>My problem is having an exceptionally busy webpage which is
>generated by a perl-script; it's strangling the (Solaris) server.
>
>Is undump of a Perl core file the answer?

mod_perl is the answer.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Tue, 20 Jan 1998 14:25:56 -0500
From: "Bob" <rgbelon@yahoo.com>
Subject: Newer than New . . . :-))
Message-Id: <6a2tiq$g8s@dfw-ixnews6.ix.netcom.com>

Hello,

My name is Bob, and I am very new to the Perl scene. Yet, I have been thrust
into a situation that demands I learn and use it rather quickly. Figures
right, never needed it until I needed it, and it happens to be NOW. So
rather than burden the NG with silly questions of how this and how that, I
wonder if someone could recommend a descent book on the subject. Not an
overly technical book, as I would not want to become disheartened right from
the start. But, nor am I interested in a "******** for dummies" either. Any
recommendations would be great. And big thanks in advance...

Bob




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

Date: Tue, 20 Jan 1998 11:12:40 -0700
From: NerveGas <NerveGas-goaway@inconnect.com>
Subject: Re: Reload by perl - is it possible?
Message-Id: <34C4E918.4DD6@inconnect.com>

> > Is it possible to make a reload by a command of perl?

   Not with Perl, but you can use a META tag with a refresh. for
example, to make my cgi reload itself every 10 seconds,

print <<EOH
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh"
CONTENT="10;http://www.domain.com/path/to/cgi">
</HEAD>

etc...

steve


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

Date: 20 Jan 1998 19:02:40 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <6a2scg$j36$1@news.orst.edu>

In article <yeopvlnlols.fsf@kudu.ind.tansu.com.au>,
Stuart Cooper  <stuartc@ind.tansu.com.au> wrote:

>Binary code gets stolen more often than source code. 

Hmmm. Perhaps that's because there is more of it, and that the majority
of source that IS available is only made available if there is no value
to keeping it private? I suggest that source code of all kinds is copied
more often, but that those who make the source available realize that
there can be no control of source once it is outed, so it isn't "stolen".

>The source code of Perl you are encouraged to share. 

The source of Perl is required to be shared by the GPL. What you write
IN Perl has no such requirement. Like I have said, what, a dozen times,
it's great that people share it. What isn't great is saying that it must
be shared.

>I'm encouraged by Richard Caley who says that for security important products;
>he only uses source code stuff; and that binary-only stuff is used only
>for the toy stuff. 

I would still point to thousands of corporate IS departments who never
get the source to most of the desktop products, and would question that
their corporate reliance on those products would allow them to be called
"toys". 

I would also question a dichotomy based on security/toy. That implies
the real purpose of computers is to control who uses them, not to
perform tasks the users want done. If it isn't "security important",
then it is a toy? No, sorry. I don't accept that.

>If you think people can't do without commercial/binary-only software; talk
>to some Linux users. 

I am one, so I think I can comment. 

I have yet to see a Linux version of Word that will handle Word
documents. When people mail Word documents to my boss and he wants them
printed, what do I tell him?  "Sorry, we don't need no stinking
commercial software?"

I put systems out in remote sites with specialized hardware. That
hardware comes with code to run under MS-DOS. There is no code to run
under Linux. I would have to pay someone to write it since I don't have
the time. (I could write the device driver, but I would first have to
reverse engineer the entire library I have.) Oops, commercial software.
And paying someone to write it would cost more than simply using
MS-DOS.

I support a lab of sometimes new Unix users. I have experienced the
problems of teaching them about vi. Xedit lacks features. Don't even
suggest that I could teach them how to use [X]emacs. The only reason that
a few of the support people here use LaTeX is because they can use the 
commercial version on a Mac that is wysiwyg. 

We do field surveying. Show me the Linux code to process Trimble GPS
data. Show me the version of Aspen that is on an ftp site somewhere. Yes, 
if you want to be helpful, show me that code. If it works better than
Trimble's code, I'll use it.

>I won't buy into the "need commercial support" argument except one comment

It isn't relevant if you would buy into it or not. Some people do, and
thus that is the answer to the question "why would some people...".

How many times do I have to say this? I didn't say anything about why
YOU would do anything, only why SOME PEOPLE would spend money to pay for
something when there was a free version available. I didn't argue that
the reasons were always valid, or applied to every piece of software
ever written. I didn't say all free software is garbage, nor did I say
all commercial stuff is great. "Why would anyone pay for...".

>But as Randal Schwartz says- compiled programs would be trivially 
>reverse-engineered and it's not the business of a compiler to produce 
>watertight mystery binaries. 

Lots of people say that compiled programs are trivially reverse
engineered. For some people, that is true. For Joe Businessman, it
isn't. It's Joe Businessman that would be buying one copy of source to
a perl program and running it on 30-leven systems, or copying it from
his buddy Jim Businessman and running it for free. That is, unless
there were a way to enforce the licensing for that code. 

When it is source, it IS trivially "reverse engineered" to remove any
licensing checks. A lot easier than removing them from compiled or
encrypted code. Here, maybe an example. Find the license test:

	#!/usr/local/bin/perl

	exit unless PassLicenseTest;

	... remainder of code

or:

	oi3gjv wiuj tp0i2jpf iqwj[pf 2iju[0fjh wi;j vpsiajgo;awn g;lw
	osijdgpoij w;ig jwpoijg pejf wpiejowij vosij gopiwe jmpwij 'w
	ojiw o[if jw[iojg wpjgwe;o



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

Date: 20 Jan 1998 11:23:16 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: source into binary code
Message-Id: <m3k9bv7xwb.fsf@windlord.Stanford.EDU>

John Stanley <stanley@skyking.OCE.ORST.EDU> writes:

> It may not be an improvement from someone else's perspective, and I did
> not claim it was. I just gave a reason why SOMEONE might pay for
> software that wasn't free instead of using something else that was.
> Whether the reason stands up to the glaring light of reason is
> irrelevant. I didn't expect we would enter a drawn out fistfight over
> the validity of those reasons, because the validity doesn't matter --
> for the reason you state. It's all from "their" perspective.

Fair enough.  (Besides, I know from experience that drawn out fistfights
with you take more time and mental energy than I have to spare at the
moment.  :))

> Russ Allbery <rra@stanford.edu> writes:
>> I'm afraid this is not correct.  Cygnus feeds their mods back into the
>> gcc development tree.

> Hmmm. Then this makes the free gcc better, which 1) improves society and
> 2) means there is still no difference between the code which people pay
> for and that which they do not. Why get gcc from Cygnus when you can get
> it for free?

Often because people are in the situation described by others here; they
need to have a compiler working under a specific circumstance badly enough
that they're willing to pay for it, but as they have no infrastructure in
place to sell such things, they're not interested in control over the
final product.  A lot of Cygnus's customers are people who need compilers
for embedded systems; they pay Cygnus to port gcc for them.

This is a common type of consulting; right now, a lot of companies are a
bit more aggressive about keeping the results of outside consulting work
than I think they should be.  The results of not letting the consultant
then release the work for free tends to be that it just languishes in the
possession of the company (which is in some completely different business
and has no marketing infrastructure for such things) and the consultant
goes on to be paid for other work.  Making the code freely available
wouldn't be a loss for either.

(This is mostly just a digression, masquerading as a response to some
earlier comments on this thread.  None of these arguments generalize to an
argument against all non-source-available software, which is unsurprising
since I don't believe such an argument exists.)

>> Sure there is.  There are people who sell commercial Perl support.

> Oh my God! You mean they won't give me code for free, they will sell me
> the answer I want? Don't tell Greg. He'll call them 'greedy code
> hoarders' and think they have no altruism at all.

I think the difference that people are pointing at is between giving away
existing code for free and writing code for free.  I'll be happy to give
away my existing code; if someone wants me to solve a problem for them, I
don't have existing code to solve the problem, and I'm not otherwise in
the mood to do it for free, I would expect them to pay me.

> Perl is a poor example of this, for this discussion. There are lots of
> people who understand Perl. The example was Dan's and Betty's code, and
> for that, there are many fewer people who could support it, especially
> if it does some complicated "foo" that people would actually be willing
> to pay for.

This is true.  But similarly the commercial support for such small bits of
code, even if they are commercial products, tends to be extremely bad.  So
it's six of one and a half-dozen of another, and in neither case can one
really make a general argument for or against either side.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 20 Jan 1998 12:25:34 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: space searching?
Message-Id: <34C4F9A4.D149F2C5@5sigma.com>

$str = <DATA>;

# print the first one
print $str =~ /([^\s,]+)\@[^\s,]*bcl\.com/i;
print "\n";

# print all of them
print join " ", map /([^\s,]+)\@[^\s,]*bcl\.com/i, split /[,\s]+/, $str;
print "\n";

# an overly fancy way if you're not concerned about there being more
# than one bcl.com
print +{ reverse($str =~ /([^\s,]+)\@([^\s,]+)/g) }->{'bcl.com'};
print "\n";

__END__
To: stephen@solamnia.demon.co.uk, stephen@bcl.com, daryn@blahblah.com

	-joseph
	 http://www.effectiveperl.com

Stephen Howe wrote:
> 
> Dear guys...
> 
> I've got a desperate need to know how to do this so i'm begging for
> help..
> 
> I have a line saying
> To: stephen@solamnia.demon.co.uk, stephen@bcl.com, daryn@blahblah.com
> 
> etc..
> I need to know how to figure out the user associated with ONLY the
> bcl.com site...


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

Date: Tue, 20 Jan 1998 11:38:07 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Mohorn <david.mohorn@sourcebbs.com>
Subject: Re: Switch statement in Perl-5???
Message-Id: <Pine.GSO.3.96.980120113533.6319I-100000@user2.teleport.com>

On Mon, 19 Jan 1998, David Mohorn wrote:

> What is perlsyn?  

It's one of the documents which should have come with your copy of Perl.
If you can't find it anywhere, complain, then check it out on CPAN:

    http://www.perl.com/CPAN/doc/manual/html/perlsyn.html
    http://www.perl.com/CPAN/doc/manual/html/

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 20 Jan 1998 14:48:36 -0500
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: Win32::Filesecurity question.
Message-Id: <t0afcrudt7.fsf@hcirisc.cs.binghamton.edu>

When I checked the pod and it looks like the set subroutine needs a
hash of the complete permission set and does not support partial
changes.  Is that the case?  What I am looking for is something that I
can add or remove a single user's or group's permissions from a
directory tree without modifying other permissions.  For example


|-MyDir (foo, bar and xyzzy, change permission)
|     \-MySubDir (foo and bar, change permission)
|              \-SubSubDir (foo, change permission)

lets say I want to remove all of bar's permissions.  If from MyDir I
remove bar and check recurse subdirectories then I will end up giving
xyzzy permissions that I didn't want him to have.  I want to be able
to remove bar recursively without changing anything else.

Is there a tool out there that can do such things or does the API
prevent it?  Thanks.


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

Date: Tue, 20 Jan 1998 19:00:19 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: WWWBoard Help
Message-Id: <34c08c62.169463215@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Fri, 16 Jan 1998 15:13:05 +0100, "Jon A." <jonsa@mindless.com>
wrote:

>I am trying to get a WWWBoard running, but when i try to post i get the
>error:
>
>Method Not Allowed
>
>The requested method POST is not allowed for the URL
>/~anotherpunk/cgi-bin/wwwboard.pl.
>
>What is wrong?

You have not read and understood your server documentation, I'd guess.
Figure out how to allow POSTs to that dir/file.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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