[8039] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1664 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 18 03:06:38 1998

Date: Sun, 18 Jan 98 00:00:55 -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           Sun, 18 Jan 1998     Volume: 8 Number: 1664

Today's topics:
    Re: Apache and PerlIS: How to get together? <manri_o@hotmail.com>
    Re: Create file <rootbeer@teleport.com>
    Re: Enumeration under perl (Abigail)
    Re: get machine name from IP? <rootbeer@teleport.com>
    Re: Give me reasons to use Perl for CGI (Steve Linberg)
        Hello... I need HELP!!! <warchie@att.net.hk>
    Re: HELP: Efficient *Wait*ing for file to appear. <rootbeer@teleport.com>
    Re: HELP: Efficient *Wait*ing for file to appear. <phousto@cse.dnd.ca>
    Re: Helpful people (Steve Linberg)
    Re: How to do random pornography in Perl. <phousto@cse.dnd.ca>
    Re: How to search for duplicate elements (Tad McClellan)
        Installing modules on NT server <corky@ultranet.com>
    Re: Logical 'and' in regex? (Abigail)
        Parsing HTML tag parameters (Ben Glazer)
    Re: Perl 5.0040x and FreeBSD-2.2.x (Lutz Albers)
        Sample Perl code for NT Eventlog lookup <angyny@interport.net>
    Re: Sort question <rootbeer@teleport.com>
    Re: source into binary code (John Stanley)
    Re: source into binary code <dformosa@st.nepean.uws.edu.au>
    Re: source into binary code <danboo@negia.net>
    Re: source into binary code <danboo@negia.net>
    Re: source into binary code <danboo@negia.net>
    Re: source into binary code <danboo@negia.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 18 Jan 1998 04:41:16 -0000
From: "Manri Offermann" <manri_o@hotmail.com>
Subject: Re: Apache and PerlIS: How to get together?
Message-Id: <69rta4$684$1@news.cs.tu-berlin.de>

Hallo Heiko!

make sure you have the following lines in access.conf:

<Directory /document_root_path/cgi-bin>
AllowOverride None
Options None
</Directory>

If your Document Root is in C:\web\html and your cgi directory cgi-bin then
you would specify document_root_path as:
/web/html/cgi-bin

and point perl to the perl binary in your perlscript, eg.:

#!/usr/local/bin/perl
#

or if it is in /programme/perl:

#!/programme/perl
#

If perl and the perl script is on a different partition you have to specify
the drive like:

#!c:/path/to/perl.exe
#

More information can be found onApache's homepage or you can
download the manual for Apache.

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

Manri Offermann
Department of Computer Science
Technical University of Berlin
Mailto: Meinen_Vornamen@cs.tu-berlin.de




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

Date: Sat, 17 Jan 1998 18:57:07 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jerry Davis <gedavis3@vt.edu>
Subject: Re: Create file
Message-Id: <Pine.GSO.3.96.980117185644.1296W-100000@user2.teleport.com>

On Sat, 17 Jan 1998, Jerry Davis wrote:

> open(FILE, "file.txt");

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.
Thanks!

-- 
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: 18 Jan 1998 03:55:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Enumeration under perl
Message-Id: <69rufe$hgp$1@client3.news.psi.net>

Randal Schwartz (merlyn@stonehenge.com) wrote on 1601 September 1993 in
<URL: news:8cra66k169.fsf@gadget.cscaper.com>:
++ >>>>> "Ralph" == Ralph J Smith <rjsmith@ilnds.com> writes:
++ 
++ Ralph> Does Perl have a way to do enumeration.
++ 
++ Ralph> 	enum{RED,WHITE,BLUE,GREEN};
++ 
++     {
++ 	my $i = 0;
++ 	use constant
++ 	    RED => $i++,
++ 	    WHITE => $i++,
++ 	    BLUE => $i++,
++ 	    GREEN => $i++,
++ 	    ;
++     }

But that doesn't work!

$ perl -wl
{my $i = 0;
 use constant RED => $i++, WHITE => $i++, BLUE => $i++, GREEN => $i++, ;
}
$foo = RED;
$bar = BLUE;
print $foo, " ", $bar;
__END__
7 BLUE

++ Or, if you don't mind a little more magic :-),
++ 
++     BEGIN {
++ 	no strict refs;

That should be:

        no strict 'refs';

++ 	my $i = 0;
++ 	for (qw(RED WHITE BLUE GREEN)) {
++ 	    *$_ = do { my $j = $i++; sub () { $j } };
++ 	}
++     }



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


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

Date: Sat, 17 Jan 1998 18:55:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jerry Davis <gedavis3@vt.edu>
Subject: Re: get machine name from IP?
Message-Id: <Pine.GSO.3.96.980117185521.1296V-100000@user2.teleport.com>

On Sat, 17 Jan 1998, Jerry Davis wrote:

> one can track the IP of the user who activates a perl script with the
> $ENV('REMOTE_ADDR') variable.  Is there a perl command to either get or
> convert that to the machine name.

Do you know about gethostbyaddr? 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: Sat, 17 Jan 1998 22:26:56 -0500
From: see@my-sig.com (Steve Linberg)
Subject: Re: Give me reasons to use Perl for CGI
Message-Id: <see-1701982226560001@pri03-051.oldcity.dca.net>

In article <34BEC365.B734D7F8@voyager.atc.fhda.edu>, Hann SO
<hso@voyager.atc.fhda.edu> wrote:

> Hi everybody:
> 
> I'm teaching CGI at a community College. Would you please give me
> reasons why I should use Perl and not C, C++ or TCL?

Perl is much easier to learn.
Perl handles text phenomenally well, and much of CGI involves manipulating text.
Perl is portable (mostly) and does not need hardware-specific precompilation.
Etc.

-- 
slinberg        .com
        @crocker

Try that one, spambots!


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

Date: Sun, 18 Jan 1998 12:20:24 +0800
From: Walter Archie <warchie@att.net.hk>
Subject: Hello... I need HELP!!!
Message-Id: <34C18308.F5E013C2@att.net.hk>

I have made this script. And I am positive that it should work I have
gone through every bit of line and coding trying to figure out what is
wrong. I have gone through the debugger process and all adn it seems
fine. But when I run the script it just keep loading up the error sub.
Could someone else help me test it? I would be very grateful. PS-Take
the script and change it around in anyway you like... Thank you...

<!---Program Starts Here---!>
#! use/perl/bin
#Search Engine Beta Version
#$linktitle, $linkdescrip, $linkwords, $linkdir, $linkurl
#define some variables

$fields= 5; #Number of records
$filename= "search.dat"; #Database File
$filetemp= "temp.dat";   #Temporary Database File
$results= 1000; #Max
&parse_form;
$searchstring=$FORM{'searchstring'};
&add_record if ($searchstring eq "**ADD RECORD**");
########
#Search#
########

 &open_file("FILE1","",$filename);
 print "Content-type: text/html\n\n";
 print " <HTML><HEAD><TITLE>Search Results</TITLE></HEAD>\n";
 print "<body TEXT=\"#808080\" BGCOLOR=\"#000000\" LINK=\"#008080\"
VLINK=\"#008080\" ALINK=\"#808080\">\n";
 print "<!--All code is done by TheAlien on January 1st, 1998-->\n";
 print "<font SIZE=\"-1\" FACE=\"Arial\"><div align=\"right\">\n";

 print "<table COLS=\"2\" WIDTH=\"100%\">\n";
 print "<tr>\n";
 print "<td><strong><font face=\"Arial\" size=\"-1\"
Color=\"#FFFFFF\">)1998 TheAlien WebDesign</font></strong></td>\n";
 print "<td><a HREF=\"http://www.thealien.com\"
OnMouseOver=\"window.status='TheAlien.Com';return true\"
onMouseOut=\"window.status='This is TheAlien.Com';return true\"
target=\"_top\"><img SRC=\"/img/titlesm.jpg\" BORDER=\"0\" HEIGHT=\"30\"
WIDTH=\"150\" ALIGN=\"RIGHT\"></a></td>\n";
 print "</tr>\n";
 print "</table>\n";
 print "</div>\n";
 print "<CENTER><IMG SRC=\"/img/title4.gif\" ALT=\"Search
Results\"><br><IMG SRC=\"/img/title1.gif\"
ALT=\"TheAlien.Com\"><BR><FONT SIZE=\"\" COLOR=\"#FFFFFF\"
FACE=\"Arial\">Search Keywords: $FORM('searchstring')</FONT><BR><BR>\n";

 print "These are results of the search:<BR>\n";


 $counter =0;
 while (($line = &read_file("FILE1")) && ($counter < $results)){
  @tabledata= split(/\s*\|\s*/,$line,$fields);
  &check_record;
  if ($found == 1){
    $counter++;
    &print_record;
  }
 }
 close(FILE1);
 if ($counter == 0) {
  print "<CENTER><H4>Sorry, I failed to find the keywords.</H4><BR>\n";
  print "Go Back to the <a href=\"index.html\"
onMouseOver=\"window.status='Try Again at The Search';return true\"
onMouseOut=\"window.status='Sorry unable to find The Search
Results...';retrun true\">SearchEngine</a></CENTER><br><br>\n";
 }
 print "<BR><BR><BR><HR><BR><FONT COLOR=\"#808080\">Thank for using the
PaRaNoRMaL Search. If there are any troubles let us know by <A
HREF=\"mailto:errors\@thealien.com?Subject=Search Engine Errors\"
onMouseOver=\"window.status='Search Engine Errors';return true\"
onMouseOut=\"window.status='TheAlien.Com Search Results';return
true\">E-Mail</a></FONT>.\n";
 print "</FONT></BODY></HTML>";
 exit;


#######
#Error#
#######
sub error {
 print "Location: http://www.thealien.com/search/error.html";
 exit;
}

###############
#Print Results#
###############
sub print_record {
 print "<BR><BR>\n";
 print "<TABLE BORDER COLS=2 WIDTH=\"100%\"
BGCOLOR=\"#008080\"><TR><TD><FONT SIZE=\"-1\"
FACE=\"Arial\"><B>".$linkdir."</B></FONT></TD><TD><FONT SIZE=\"-1\"
FACE=\"Arial\"><B><A HREF=".$linkurl."
onMouseOver=\"window.status='".$linktitle."';return true\"
onMouseOut=\"window.status='TheAlien.Com Search Results';return
true\">".$linktitle."</A></B></FONT></TD></TR><TR><TD
colspan=\"3\"><FONT FACE=\"Arial\" Size=\"-1\"
COLOR=\"#FFFFFF\">".$linkdescrip. "</FACE></TD></TR></TABLE>\n";
}
##############
#Check Record#
##############
sub check_record {
    # get the data from the record read from the file. $tabledata

   $linktitle = $tabledata[0];
   $linkdescrip = $tabledata[1];
   $linkwords = $tabledata[2];
   $linkdir   = $tabledata[3];
   $linkurl   = $tabledata[4];
   chop($linkurl);

    #build the search line with all fields we want to search in
    $searchline = $linktitle . " " . $linkdescrip . " " . $linkwords;


   #search by keywords
   # only perform the keyword search if the length of the search string
is greater than 2
   # don't think we want people to search for and  or or etc.
   $sfound = 0;
   $found = 0;
   $notfound = 1;

   $stlen = length($searchstring);
   if ($stlen > 1) {
       @words = split(/ +/,$searchstring);
        foreach $aword (@words) {
           if ($searchline =~ /\b$aword/i) {
                  $sfound = 1;
           }
           else {
                  $notfound = 0;
            }
         }
     }
    if ($sfound == 1 && $notfound == 1) {
        $found = 1;
     }

    # if search string is too small .. set found to 1
    if ($stlen <= 1) {
        $found = 1;
    }
    #if page doesn't have a title then return not found
    $tlen = length($linktitle);
    if ($tlen < 1) {
        $found = 0;
    }
}

############
#Parse Form#
############
sub parse_form {
 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
 if (length($buffer) < 5) {
  $buffer=$ENV{'QUERY_STRING'};
 }

 @pairs = split(/&/, $buffer);
  foreach $pair (@pairs) {
  ($name, $value) = split(/=/, $pair);
  $value =~ tr/+/ /;
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
  $FORM{$name} = $value;
 }
}

############
#Add Record#
############
sub add_record {
 $linktitle = $FORM{'linktitle'};
 $linkdescrip = $FORM{'linkdescrip'};
 $linkwords = $FORM{'linkwords'};
 $linkdir = $FORM{'linkdir'};
 $linkurl = $FORM{'linkurl'};

 &open_file("FILE1",">>",$filetemp)
 &write_file("FILE1",$linktitle. "|". $linkdescrip. "|" .$linkwords. "|"
 .$linkdir. "|" .$linkurl. "\n");
 close(FILE1);
 print "Location: http://www.thealien.com/search/add.html";
 exit;
}

###########
#Open File#
###########
sub open_file{
 local ($filevar, $filemode, $filename) =@_;
 open ($filevar, $filemode . $filename) || die (&error);
}

###########
#Read File#
###########
sub read_file{
 local ($filevar) =@_;
 <$filevar>;
}

############
#Write File#
############
sub write_file{
 local ($filevar, $line) =@_;
 print $filevar ($line);
}





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

Date: Sat, 17 Jan 1998 19:04:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Greaves <david@telekinesys.co.uk>
Subject: Re: HELP: Efficient *Wait*ing for file to appear.
Message-Id: <Pine.GSO.3.96.980117185942.1296Y-100000@user2.teleport.com>

On Sat, 17 Jan 1998, David Greaves wrote:

> I'm writing a script that needs to wait for a file to appear.
> 
> Any ideas how I can do this efficiently and responsively?
> 
> Ideally not:
>   while !(-e $file) {sleep $for_a_bit} ;

Unless your OS (or something installed upon it) has some way of notifying
you of a new file, there's no significantly better way than what you
offer. And could it happen that the file will be only partially-written
when you check for it? Watch out for 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: Sun, 18 Jan 1998 03:53:43 GMT
From: Phil Houstoun <phousto@cse.dnd.ca>
Subject: Re: HELP: Efficient *Wait*ing for file to appear.
Message-Id: <34C17C00.3E6E707E@cse.dnd.ca>

Tom Phoenix wrote:
> 
> On Sat, 17 Jan 1998, David Greaves wrote:
> 
> > I'm writing a script that needs to wait for a file to appear.
> >
> > Any ideas how I can do this efficiently and responsively?
> >
> > Ideally not:
> >   while !(-e $file) {sleep $for_a_bit} ;
> 
> Unless your OS (or something installed upon it) has some way of notifying
> you of a new file, there's no significantly better way than what you
> offer. And could it happen that the file will be only partially-written
> when you check for it? Watch out for that. Good luck!
> 

A common idiom to avoid the 'partially-written file' syndrome is to
write the file with a name that is 'invisible' to your application 
(i.e. a 'dotted' file in Unix) and then move/copy it to a name that
is visible.

-- 

Phil Houstoun            Voice: (613) 991-7173 
Email: remove the 'j' in pjhousto@cse.dnd.ca
-----------------------------------------------------------------------


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

Date: Sat, 17 Jan 1998 22:27:57 -0500
From: see@my-sig.com (Steve Linberg)
Subject: Re: Helpful people
Message-Id: <see-1701982227570001@pri03-051.oldcity.dca.net>

In article <69nhda$dn5$1@droppa.tpgi.com.au>, "Brett" <brett@moggy.com> wrote:

> Can anyone here help me solve a problem that is too difficult to explain in
> one posting?

Try us.

- Your northern neighbors

-- 
slinberg        .com
        @crocker

Try that one, spambots!


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

Date: Sun, 18 Jan 1998 03:49:32 GMT
From: Phil Houstoun <phousto@cse.dnd.ca>
Subject: Re: How to do random pornography in Perl.
Message-Id: <34C17B05.19C51D86@cse.dnd.ca>

Fred Tunalu wrote:
> 
> Need random pornography in Perl?
> 
> My newsletter, "The Tiny Lobster" shows you how.
> 
> http://www.jbum.com/jbum/tl/
> 
> --
> --
> Fred Tunalu
> Institute of Druidic Technology
> http://www.geocities.com/Athens/Acropolis/5997/

Does this mean a random assemblage of all the 'naughty' bits?
Inquiring minds want to know!!!
-- 

Phil Houstoun            Voice: (613) 991-7173 
Email: remove the 'j' in pjhousto@cse.dnd.ca
-----------------------------------------------------------------------


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

Date: Sat, 17 Jan 1998 23:27:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to search for duplicate elements
Message-Id: <8s3s96.5cb.ln@localhost>

J1T1W1 (j1t1w1@aol.com) wrote:
: All,
:   is there a trivial script to search for duplicate elements in an array and
                                            ^^^^^^^^^

When you find yourself using that word (or 'unique'), you
should think "hash".


: print their totals. If so can someone provide me with an answer. Thanks in
: advance.

--------------
#!/usr/bin/perl -w

@ra = qw(zero one two three four one two two one four);

foreach (@ra) {
   $cnt{$_}++;
}

foreach (keys %cnt) {
   print "$_: $cnt{$_}\n";
}
--------------


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


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

Date: Sat, 17 Jan 1998 22:51:57 -0500
From: Bob Trieger <corky@ultranet.com>
Subject: Installing modules on NT server
Message-Id: <34C17C5D.2133@ultranet.com>

How do I install modules from CPAN on an NT server with no C compiler?
A couple of the module have instructions that didn't work when I
followed them to a T.

If this is in a FAQ anywhere, I'll be damned because I couldn't find it.


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

Date: 18 Jan 1998 03:37:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Logical 'and' in regex?
Message-Id: <69rtej$ggv$4@client3.news.psi.net>

Randal Schwartz (merlyn@stonehenge.com) wrote on 1600 September 1993 in
<URL: news:8coh1bknmy.fsf@gadget.cscaper.com>:
++ >>>>> "Kenneth" == Kenneth Herron <kherron@campus.mci.net> writes:
++ 
++ Kenneth> Something like
++ Kenneth> 	@list = ($breakfast =~ /bacon|eggs|hashbrowns|juice/);
++ 
++ Kenneth> will extract all of the matching, non-overlapping substrings into
++ Kenneth> @list.  All that remains is to uniquify @list--the FAQ describes
++ Kenneth> three methods--and check how many values you have.  For example:
++ 
++ Kenneth> 	undef %hash;
++ Kenneth> 	@hash{($breakfast =~ /bacon|eggs|hashbrowns|juice/)} = ();
++ Kenneth> 	if ((scalar keys %hash) == 4) {
++ Kenneth> 		...
++ Kenneth> 	}
++ 
++ That looks a bit clumsy.  How about this:
++ 
++     {
++ 	local $_ = $breakfast;
++ 	# eat 'em up as we go... :-)
++ 	$good = s/bacon// && s/eggs// && s/hashbrowns// && s/juice//;
++     }


Won't do. Consider looking for 'juice' and 'cereal', with $breakfast eq
'juicereal and juice'. Your solution will give a right or wrong answer
depending on the order of the substitutes.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Sat, 17 Jan 1998 11:24:52 GMT
From: ben.glazer@mail.utexas.edu (Ben Glazer)
Subject: Parsing HTML tag parameters
Message-Id: <34c092cb.93214615@newshost.cc.utexas.edu>

I have a problem which seems to me like it should be relatively
simple, but I've spent more time working on it than I care to admit.

All I want to do is split the parameter list of an HTML tag into an
array.  So, for example, starting off with input of

	 <img src="pish.gif" alt="hello kitty" width=100>

my program sets

	$params = "src=\"pish.gif\" alt=\"hello kitty\" width=100";

which is all well and good.  Now all I want to do is find some way to
set

	@params = (
		"src=\"pish.gif\",
		"alt=\"hello kitty\",
		"width=100")

Working from that point is easy.  Any suggestions?


tia,
Ben


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

Date: 17 Jan 1998 11:26:02 GMT
From: lutz@muc.de (Lutz Albers)
Subject: Re: Perl 5.0040x and FreeBSD-2.2.x
Message-Id: <69q4ga$lvc@morranon.tavari.muc.de>

In article <slrn6bvpbv.2hm.soulsmit@vader.deepsky.com>,
	soulsmit@vader.deepsky.com (Soulsmith) writes:
> This is what I perceive when I run perl5.00401 and perl5.00404 on a 
> FreeBSD-2.2.1 box:
> 
(deleted)
> 
> When I run it on an UPGRADED FreeBSD-2.2.1 box to 2.2.5:
> 	- Same as above
> 
> When I run it on a box which has had a fresh 2.2.5 install:
> 	- No problems.
> 
> 
> Can anybody explain this or offer suggestions as to what I can do to fix this? 
> It is perplexing and making things useless for me.  Thanks in advance!

This smells like problems with old (outdated) libaries. I've never
seen this problem (and I've updated my machine all the way from
2.0.5 via the diverse 2.1.* releases to 2.2.5 :-)

ciao
  lutz
--
Lutz Albers, lutz@muc.de         
Do not take life too seriously, you will never get out of it alive.


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

Date: Sat, 17 Jan 1998 23:50:07 +0800
From: Angy <angyny@interport.net>
Subject: Sample Perl code for NT Eventlog lookup
Message-Id: <34C0D32F.F71@aol>

Does anyone have a sample Perl code for NT 4.0 Eventlog lookup?


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

Date: Sat, 17 Jan 1998 18:58:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Andrew Spiers <andrew.spiers@virgin.net>
Subject: Re: Sort question
Message-Id: <Pine.GSO.3.96.980117185807.1296X-100000@user2.teleport.com>

On Sat, 17 Jan 1998, Andrew Spiers wrote:

> I have two fields : one contains a URL and the other contains the number
> of hits on this URL. I want to sort them so that the most visited
> appears at the top. 

Determine which of the two is the most visited. If it's the second, use
code like this.

    ($one, $two) = ($two, $one);

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: 18 Jan 1998 03:12:29 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <69rrut$lun$1@news.orst.edu>

In article <Pine.GSO.3.96.980117174340.1296G-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@teleport.com> wrote:
>On 16 Jan 1998, John Stanley wrote:
>
>> If writing perl code were the way I wanted to make a living, I guess I
>> couldn't do very well at it by giving it away, now could I? 
>
>You can make a good living by giving away the source while retaining or
>selling the rights to use it. This is true not only for software but for
>most other kinds of authoring as well. 

Once you can solve the problem of people using the source without
paying for the rights to use it, yes, I agree, and if you recall, that
was the impetus behind the start of this thread. This requires one of
two things to be true: 1) the value of the source to be high enough to
justify an active legal staff doing nothing but finding and suing those
who don't pay (or the threat/presence of such a staff coercing
compliance), or 2) a means of license management to control the use.

>For example, Randal's magazine
>columns are "given away" on the web for free, but the publisher retains
>the copyrights on the articles. 

If Randal were not selling the articles to the publisher, he could make
absolutely no living at all by writing them and putting them up on the
web for free. He makes his living by selling the articles and teaching
classes and whatever other things he does that he doesn't give away for
free. It is silly to say that he makes a living by giving away code.
It's great that he does it, but if that were all he did, he would
starve.

Why do people keep trying to prove to me that giving code away for free
is such a great way to make a living by using examples where the author
is making a living by selling something? Before you can say that someone
makes a living doing something, you have to show that he actually makes
a living doing that and not by doing something else.



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

Date: 18 Jan 1998 02:34:03 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: source into binary code
Message-Id: <885090818.394799@cabal>

In <34BF7B26.BBA971D6@ixl.com> Dan Boorstein <dboorstein@ixl.com> writes:

>? the platypus {aka David Formosa} wrote:

[...]

>> Obscure implies that with work that you could uncerstand the work with
>> effort.  Obscure things can be turned up with resurch and or effort.

>yes, like searching a keyspace. doesn't that require effort?

A great amount off effort.  Good cryptosystems require more computer to
search then there are atoms in the universe.  Myself I would considere
this beond effort.  

>> 
>> > isn't key based cryptography security through obscurity?
>> 
>> The effort in decoding a key based document [1] requires a great amount of
>> time.  This is not obscure, this is opaic.
>> [1] Given that it is a good system and not ROT13
>> --

>i would hardly refer to something that is possible to decode as opaque.
>and why the exception for ROT-13? again i submit that advanced key
>cryptography (e.g., PGP) and ROT-13 are on different ends of a wide
>spectrum of "security through obscurity".

>> 
>> [...]
>> 
>> >i believe perl's own crypt is just obscuring, though irreversibly.
>> 
>> If its obsured irreversibly, its not obsure.
>> 

>huh? if "crypt"ed data is not obscure, and you will allow me to use
>the above definition, which you have just negated, then "crypt"ed
>data is "readily understood or clearly expressed". o.k., here you go.
>what was this string before i ran it through crypt?

>20RJX/7.cDuwg

>certainly you don't believe this and i doubt it was your intent. do
>you have a different definition of obscure? i have provided mine
>above. what is yours?

>cheers,

>dan
--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Sun, 18 Jan 1998 01:35:33 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: source into binary code
Message-Id: <34C1A2B5.A0534CA4@negia.net>

brian d foy wrote:
> 
> In article <34BCD4B1.833924F3@ixl.com>, Dan Boorstein <dboorstein@ixl.com> posted:
> 
> >Tom Christiansen wrote:
> 
> >> Compiling produces no security.  Read the FAQ.
> 
> >i have to disagree with this statement. i can't read compiled
> >code just by opening a file. in order to understand just
> >what's going on internally i would have to disassemble the code.
> >as it just so happens, i don't know how to do that.
> 
> security is not defined in terms of your personal limitations.

nor by an individuals abilities. it's an attempt to thwart
potential violations.

> 
> i hope you aren't neglecting all the other things that you
> don't know how to do (but that crackers do).

since when is compiling neglect? whoever mentioned neglect? if
you're implying that i recommended compiling over air-tight
code, you should re-read my posts.


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

Date: Sun, 18 Jan 1998 02:01:33 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: source into binary code
Message-Id: <34C1A8CD.66D55A3E@negia.net>

Andrew Johnson wrote:
> 
> Dan Boorstein wrote:
> !
> ! Andrew Johnson wrote:
> ! >
> ! > b) only hides it from people who know as little about such
> ! >    things as you
> !
> ! exactly my point. it is a barrier in gaining knowledge. that is
> ! security. not foolproof, not even good, but still security. key
> 
> not even good, but still security? I think this just underlines
> the meaning Tom C's statement:
> 
>     Tom Christiansen wrote:
>     > Security through obscurity is a terribly dangerous miscarriage
>     > of truth.
> 

tom's statement indicates that all forms of security through obcsurity
are a "miscarriage of the truth". i was speaking particularly of
compiling
above. i think advanced key cryptography is excellent "security through
obscurity".

if tom had written:

>     > Security through *compiling* is a terribly dangerous miscarriage
>     > of truth.

i would have taken no issue with this. in fact if you review my posts
you
will find that i have indicated as such my self.

just as if his original response had been:

    > Compiling produces "very poor" security.
    > Compiling produces "terrible" security.

or some other extremely limiting variant that did not purport to be
absolute, then i would again have made no issue of it.

> But, if my hypothetical bank vault happens to have a gaping
> hole in one wall and I cover it with a large poster advertising
> lower banking rates then you would consider this to be
> at least some measure of security because well, no one can see
> the hole so the danger is lessened? sure its not good security,
> but its still security?  I would disagree... its a security
> compromise waiting to happen --- had you left the hole open you'd
> be forced to take active steps like hiring another armed guard or
> rebuilding the vault---covering it up only means you won't be
> prepared if someone happens to lean on that part of the vault
> wall.

all security is a "compromise waiting to happen". you can't be sure
who your attacker will be or what methods will be used. people break
out of high security federal prisons, which claim to be escape-proof.
even the idea which has been mentioned here about simply not making
your code available is not fail safe. talk to steve jackson
(http://www.sjgames.com/). and yes, i honestly believe that the
poster of the hole into the vault is very poor security, but
security nonetheless.

> 
> compilation of source has its uses, obviously,...but I would not
> count hiding security problems (real or potential) among them, nor
> would I recommend it as even a minimalist step in that direction.

i would not use it as such either, but i still feel it can help.

> 
> we are, of course, free to disagree.

yes, and your well supported responses are both appreciated
and enlightening.

thanks,

dan


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

Date: Sun, 18 Jan 1998 02:11:51 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: source into binary code
Message-Id: <34C1AB37.2F7675C0@negia.net>

Abigail wrote:
> 
> Dan Boorstein (dboorstein@ixl.com) wrote on 1597 September 1993 in
> <URL: news:34BCD4B1.833924F3@ixl.com>:
> ++ Tom Christiansen wrote:
> ++ >
> ++ >  [courtesy cc of this posting sent to cited author via email]
> ++ >
> ++ > In comp.lang.perl.misc,
> ++ > :Hi, I would like to know how to turn the perl source code
> ++ > :into binary/executable code due to security.
> ++ >
> ++ > Compiling produces no security.  Read the FAQ.
> ++ >
> ++
> ++ i have to disagree with this statement. i can't read compiled
> ++ code just by opening a file. in order to understand just
> ++ what's going on internally i would have to disassemble the code.
> ++ as it just so happens, i don't know how to do that. so, if
> ++ the original poster can compile his code, it keeps me from
> ++ exploiting his mistakes through explicit knowledge of what they
> ++ are. instead i would have to make assumptions about "typical"
> ++ mistakes. that sounds like added security to me. furthermore,
> ++ i'd bet that there are a lot of others like me.
> ++
> ++ sure, it's no absolute, but most security (computers and otherwise),
> ++ is simply the act of adding more or taller "hurdles". putting
> ++ a flood light outside my house doesn't stop someone from breaking
> ++ in but it might make them think twice, and try the neighbors house
> ++ instead.
> 
> Rubbish. If they want to "steal" your code, and there is an easier
> alternative available, they won't use your code at all.

am i reading this correctly? if they want to steal my code and there
is an easier alternative which they take then my security has been
successful, hasn't it? they have been thwarted.

> 
> And if you settle for "it prevents someone from who doesn't know
> how to disassemble from getting the code", I guess you don't have
> anything valuable to hide anyway.

i never said i would settle for that. i merely said it added more
security. 

> 
> What is it that the copyright laws don't give you?

i never said copyright laws were insufficient either.

perhaps i am communicating poorly, but i feel as though you are
reading between the lines and being presumptuous with regards
to my intent. can you point out where i have mad such statements?

thanks,

dan


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

Date: Sun, 18 Jan 1998 02:17:17 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: source into binary code
Message-Id: <34C1AC7D.663255F6@negia.net>

Chipmunk wrote:
> 
> Dan Boorstein wrote:
> >
> > > [compiling the Perl code...]
> > > b) only hides it from people who know as little about such
> > >    things as you
> >
> > exactly my point. it is a barrier in gaining knowledge. that is
> > security. not foolproof, not even good, but still security.
> > key cryptography works exactly as you state in 'b'. it hides information
> > from those who know less about such things (i.e., the key).
> 
> Then you agree with what everyone else has been saying, which is
> that compiling the source code is not a good way of providing
> security.

yes indeed! 100%! i've never stated otherwise.


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

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

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