[9530] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3124 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 10 22:07:39 1998

Date: Fri, 10 Jul 98 19:00:20 -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           Fri, 10 Jul 1998     Volume: 8 Number: 3124

Today's topics:
    Re: Arrays - here's the code (Mark-Jason Dominus)
    Re: Bizarre copy of ARRAY in aassign? justinb@ignored.cray.com
    Re: Chmod (cgi-unix) (Abigail)
    Re: extracting data out of html page (Abigail)
    Re: good research methods WAS Re: on the fly subs with  (Tye McQueen)
    Re: HELP: Internet Database Design questions... (-)
    Re: HELP: Internet Database Design questions... (-)
    Re: HELP: Internet Database Design questions... (Larry Rosler)
    Re: How can you encrypt a CGI script on a server so it  (-)
    Re: How do chang groups (Scott Anderson)
    Re: How much space left on disk? (Alan Barclay)
    Re: I am an "antispam spammer"? (Daniel E. Macks)
    Re: Installing Perl5.004_04 <pcrown@airmail.net>
    Re: Looking for the NET:telnet (Bob Trieger)
    Re: memory usage of constants versus vars (-)
    Re: number of days between two given dates using perl (Abigail)
    Re: Openin files (Abigail)
        perl system call error Jahan@PriceCut.com
        perl system call error Jahan@PriceCut.com
    Re: perl system call error <tchrist@mox.perl.com>
    Re: Putting CPAN on a CD:  good or not good? (Earl Hood)
    Re: Putting CPAN on a CD:  good or not good? <merlyn@stonehenge.com>
    Re: question about objects (Tye McQueen)
    Re: Removing the ^M character <jsjacks@primenet.com>
    Re: Trinary operator vs =~ : sometimes it doesn't pay t (Larry Rosler)
    Re: Weirdness in trying to extract year from localtime <achoy@us.oracle.com>
    Re: Weirdness in trying to extract year from localtime (Bob Trieger)
    Re: Weirdness in trying to extract year from localtime (Kelly Hirano)
    Re: Weirdness in trying to extract year from localtime <merlyn@stonehenge.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 10 Jul 1998 20:23:18 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Arrays - here's the code
Message-Id: <6o6b9m$dvp$1@monet.op.net>


In article <slrn6qct1u.op7.the_wildman_98@foobar.net>,
The Wildman <the_wildman_98@hotmail.com> wrote:
>>Now let's fix the ### (Code to set $event[$i]) ### so that it doesn't
>>look like an escaped inmate from the Pennsylvania State Prison for
>>COBOL Offenders.  Here's what you had:
>[...]
>>Now you have two problmes here:  A little one and a big one.  The
>>little one is that you used `eq' instead of `==' for comparing
>>numbers, which you must never do.  
>Really?!? All the examples in the docs I saw used eq. 

You're either mistaken, or you need to get new docs in a hurry.

>I would *never* knowingly code in COBOL. 

I wasn't referring to the ==/eq thing when I wrote that.  I was
thinking that the event selector with thirty nearly identical lines
looked to me like code written by COBOL programmers who were paid by
the line.

>That was beautifull. Someday I might understand it. How would I add in this?

One way is to special-case it.  Another is to combine your two
100-sided dice into one 10,000-sided die and just use the same table
technique.  But you'd better understand it first if you're going to do
that.

>Unimaginably. This is for my web page and I'd be more than happy to give you
>credit for improving my code. Just let me know how you'd like to be listed.

Thanks, but that's not necessary.



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

Date: 10 Jul 1998 18:00:15 -0700
From: justinb@ignored.cray.com
Subject: Re: Bizarre copy of ARRAY in aassign?
Message-Id: <kgcvhp5rylc.fsf@dervish.cray.com>

justinb@ignored.cray.com writes:

<snip>

Fine, perlbug it is ...

-justinb

-- 
Justin Banks - Silicon Graphics Inc. Eagan, MN
If you have 300 gallons of neon green flourescent ink, 
but only 220 pages to spill it on, how many ounces of 
ink per page?


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

Date: 11 Jul 1998 00:29:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Chmod (cgi-unix)
Message-Id: <6o6blt$8an$1@client3.news.psi.net>

Guillermo Garcis (ggarces@arrakis.es) wrote on MDCCLXXIV September
MCMXCIII in <URL: news:35a67fba.0@news.arrakis.es>:
++ How i can do a chmod from a cgi


The same way as normally.


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


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

Date: 11 Jul 1998 00:32:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: extracting data out of html page
Message-Id: <6o6brr$8an$2@client3.news.psi.net>

dwiesel@my-dejanews.com (dwiesel@my-dejanews.com) wrote on MDCCLXXIV
September MCMXCIII in <URL: news:6o5sln$7ij$1@nnrp1.dejanews.com>:
++ Hallo.
++ 
++ I would like to extract some data out of a html page. I know how to get the
++ information about the first title but not *every* book.
++ 
++ The result I'm looking for is a hash with the name of the book as a key and
++ and the value should be a pointer to an array with the rest of the data.

Please ask in a different group, Perl does not have pointers.

++ if (connect SOCKET, sockaddr_in(80, inet_aton("$host")))
++ {
++         select SOCKET; $| = 1; select STDOUT;
++ 	print SOCKET "GET $adress\n\n";
++ 
++ 	$text .= $rad while $rad = <SOCKET>;
++ 	close SOCKET;

Perhaps you want LWP::UserAgent?

++   # This only works on the first line... (yeah... I'm really bad at this) 
++ $text =~ /<TD VALIGN=\"TOP\">(.*)<\/TD>/;  $firsttitle = $1; }

That assumes many things about the text which probably aren't true.


Perhaps you want HTML::Parser?



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: 10 Jul 1998 18:09:03 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: good research methods WAS Re: on the fly subs with special tag markers
Message-Id: <6o66uf$o44@fohnix.metronet.com>

"Mark Stang" <mark$$$stang@ncgroup.com> writes:
) I fully expect to be flamed for this, but is there a cross referenced,
) indexed, searchable, hyperlinked version of the perl docs?  I don't mean the
) html docs that cone with the distribution.  As a newbie I find it very
) difficult to use these docs.  What I am looking for (and this is what expect
) to be flamed for) is a winhelp file with th documentation, or even better, a
) prog to create a winhelp file from the existing docs.

But Bill Gates himself has very publicly stated that HTML is
a better medium for documentation than Windows help files.  ;>

Yes, it'd be extremely handy to be able to use the Windows help
"Find" feature on the Perl documentation.  Sorry, I haven't seen
one but like the other poster said, the only reason there isn't
a pod2winhelp is that you (or anyone else) hasn't bothered to
write one and put it on CPAN.  POD is meant to make this kind
of thing easy.  I've never created a winhelp file so I don't
know how easy the other side of it would be.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Sat, 11 Jul 1998 00:26:50 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35a6b09e.97930827@nntp.idsonline.com>

John Porter <jdporter@min.net> Said this:

>Clueless wrote:
>> 
>> You can make your own database then....  simple flat text files, comma
>> seperated (or better, caret ^ seperated).
>
>Where did you get this strange idea?

>From using data that includes commas.  You can use whatever delimiter
you want, nobody is going to come knocking on your door and take you
away or anything.



>If you're really going to use an arbitary single-character delimiter,
>pick something really out of the way, like \xFE.

Fine, or I can use any other control character or non-printing
character.  Fine, use whatever suits your purposes

>But comma is good choice, because it is somewhat standard, and it's
>easy to do it right if you
>	use Text::CSV;
>Then, if you want more "real db" functionality, you can 
>	use DBD::CSV;
>

Sure, you can use those modules, but if you are doing much simpler
data manipulation, or especially if all you need is reads, why add any
unnecessary complexity?  Just  open() and while loop through, doing a
match against your search term.  Easy, and simple.




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

Date: Sat, 11 Jul 1998 00:29:22 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35a6b1cb.98231714@nntp.idsonline.com>

Catherine Skidmore <eppie@interport.net> Said this:

>Avi Goldenberg wrote:
>
>> 1)  What are the current technologies needed to achieve the minimum of
>> data storage, retrieval, and manipulation?  (I prefer to stay NT as
>> opposed to UNIX)
>
>ooh. Access and ASP. or Access and Cold Fusion.

Oh my GOD.  No.

>
>> 2)  What do I need to look for in a hosting service to allow me to
>> achieve #1?
>
>an NT Box running IIS. 
>

Argh.  New to computing?  Must be.




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

Date: Fri, 10 Jul 1998 18:36:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <MPG.101061818299a9c7989703@nntp.hpl.hp.com>

In article <35a6b09e.97930827@nntp.idsonline.com> on Sat, 11 Jul 1998 
00:26:50 GMT, root.noharvest.\@not_even\here.com (-) 
<root.noharvest.\@not_even\here.com (-)> says...
> ...  Just  open() and while loop through, doing a
> match against your search term.  Easy, and simple.

But don't forget to Always always always check the result of the open().

:-)

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 10 Jul 1998 23:00:09 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: How can you encrypt a CGI script on a server so it will not get "stolen"?
Message-Id: <35a69bca.92648931@nntp.idsonline.com>

John Layne <jpl@lanl.gov> Said this:

>Hi there,
>
>I have spent many, many hours writing a CGI script that creates a
>client's web site from a text file on the server. I am worried because
>there is nothing to prevent this client from copying the plain-text
>script, firing me as their web developer, and getting someone else to
>use the script.  I have made it clear that the scripts belong to me and
>they pay to use them. But...
>
>What would be the best way to protect my assets? I guess I could encrypt
>the script on the server and have another password-protected script that
>would decode it and then run it. Any ideas would be gratefully accepted.
>I would imagine that this is an issue others have faced.
>

I'm afraid there's really not much you can do here.  The only viable
option is to go to the CPAN and install the perl compiler.  Then,
compile the perl script and use the compiled binary and keep the
"plain text" perl source to yourself.  However, I think your best bet
is to simply operate with faith between you and your client.  

If you try to encrypt the script, and then write a script that
decrypts it, anyone who wants to "steal" your source just needs to
read the decrypting script, and alter it so it writes the decrypted
script to disc rather than execute it.

Or, if this is a script that is used in CGI implementations, you could
figure out a way to make the code "self destruct" if it is accessed
with an absolutely obscure (so nobody accidentally destroys it)
code... then if your client steals it, you just access the script from
your web browser with the self destruct code and it deletes itself.

I wouldn't suggest this last idea, as it might blow up in your face
somehow.




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

Date: 11 Jul 1998 00:31:50 GMT
From: scotan@selinc.com (Scott Anderson)
Subject: Re: How do chang groups
Message-Id: <6o6bpm$ra8$1@supernews.com>

In article <359e814d.22511835@news.btinternet.com>, Gellyfish@btinternet.com 
says...
>
>On 2 Jul 1998 23:08:27 GMT, Scott Anderson wrote :
>
>>Hi,
>>Is it possible to have perl change a users group id?
>>
>>$grp = $(;
>>$groupname = getgrgid($grp); 
>>
>>gets the current group name correctly. So, I tried
>>
>> $( = $grpnum;
>>
>>and got an error message telling me setgid was not implemented. Is there 
some
>>other way to change groups?  I haven't had much luck finding info on this 
>>topic so I would be grateful for any help.
>>
>Most usually when Perl claims that some function or other is not
>implemented on your platform you can be pretty sure that it is telling
>the truth - however if you did not compile Perl yourself and you are
>sure that the setgid() C library function is available to you (which
>is fairly certain on a SVR4 type system ) then you might want to
>rebuild Perl yourself and check that it is doing the right thing.
>
>/J\
>Jonathan Stowe
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>
Thanks for the suggestion.

I compiled perl 5.00.04 using gcc 2.8.1 on a Solaris 2.5.1 computer and 
have made some head way.

The script now works correctly if I am super user. However, if I am a normal 
user I can not change groups. I can switch groups from the command line
using newgrp so I know that I am a member of both groups. We use NIS+, but I 
haven't modified the tables. I added my test group to the local
/etc/group file.

By the way, I compiled perl as root if that makes any difference.

Thanks,
Scott



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

Date: 10 Jul 1998 22:54:29 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: How much space left on disk?
Message-Id: <900111260.493591@elaine.drink.com>

In article <6o10au$to$2@comdyn.comdyn.com.au>,
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>Maybe a call to quota and df might be easier to implement. Just as
>unportable of course.

I'm working on a module to act as a frontend for df, which hides the
unportablity:

#!/usr/bin/perl -w
use File::Disk::Free;

$handle=new File::Disk::Free;
$handle->df() or die "Cannot df $!\n";

$dir="/etc";
($mount,$avail)=$handle->mount($dir,'mount','avail');
print "$dir is on disk $mount and has $avail bytes available\n";

/etc is on disk / and has 88632320 bytes available

It has interfaces for calling a local df as above, or passing
a file handle or a scalar, both of which are expected to contain
output from df, and the format can be a 'foreign' system's df
format;

It should be ready for first release sometime next week.



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

Date: 11 Jul 1998 01:08:28 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: I am an "antispam spammer"?
Message-Id: <6o6duc$o8e$1@netnews.upenn.edu>

WD Baseley (wbaseley@mindspring.com) said:
: [comp.lang.perl.misc added to newsgroups]
: 
: In article <slrn6qcfme.nqf.the_wildman_98@foobar.net>,
: the_wildman_98@hotmail.com (The Wildman) articulated:
: 
: >However, you didn't reply to it. You saw the warning and decided to make a
: >snide remark. Exactly what is an "antispam spammer" anyway? Maybe *you*
: >are a spammer. You certainly have the mentality (i.e. you lied about
: >replying) for it.
: 
: This person: a) tried to help you;  b) doesn't like mungs and other
: stunts aimed at deflecting junk email.  There are a lot of people like
: that.  Your mentality is the one that should be questioned, for being
: so stupidly rude to someone who was attempting to assist you.

CLPM has a large contingent of "if you want a reply by email, I'd damn
well better be able to just hit reply." That's one of the
characteristics that's developed in the froup. An even stronger
contingent is "you asked by posting, so I'm gonna reply by posting"
(at one point the FAQ made this very clear). One of the premises there
is that one is coming for help, so one must do everything possible to
help folks help that person. Each additional hoop is that many more
YAPHer (possibly the only one with the answer to a tricky question)
who will say "too much trouble...I'll skip this one."

: A generous offer.  Could you point me to the RFC that allows you to
: attempt to publicly humiliate anyone who objects to jumping through
: your reply hoops?

What he said.

dan
-- 
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks



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

Date: Fri, 10 Jul 1998 20:34:06 -0500
From: "Phil Crown" <pcrown@airmail.net>
Subject: Re: Installing Perl5.004_04
Message-Id: <6o6fel$f02$1@news13.ispnews.com>

put the path to gcc/cc before /usr/ucb in your path, or rename /usr/ucb/cc
(a shell script).

This is in the Solaris FAQ.

0000-Admin(0000) wrote in message <35A5FA7D.7CA9@euv-frankfurt-o.de>...
>Hi there!
>I'm currently trying installing Perl5.004_04 and after I had written "sh
>Configure", I got the message:
>What command will force resolution on this system? [cc]
>Checking for GNU cc in disguise and/or its version number...
>*** WHOA THERE!!! ***
>    Your C compiler "cc" doesn't seem to be working!
>    You'd better start hunting for one and let me know about it.
>My gcc compiler is under /opt/FSFgcc/bin/gcc.
>Could anybody help me writing to me the right command to
>configure/compile this perl version?
>My eMail is: kwoda@euv-frankfurt-o.de




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

Date: Fri, 10 Jul 1998 23:39:49 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Looking for the NET:telnet
Message-Id: <6o68sf$f0i$1@ligarius.ultra.net>

[ posted and mailed ]

nowen@acm.org wrote:
-> Dear everybody,
-> 
-> I have PERL 5.004_02 in my system and seems like the NET::telnet module is
-> missing (the NET::ftp is here though).
-> 
-> Could you please tell me where I can obtain this telnet module.

Always start on CPAN when looking for a module. If it ain't there, it ain't 
worth installing.

http://www.perl.com/CPAN/

and it is `Net' not `NET'.

Good luck,

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: Fri, 10 Jul 1998 23:20:13 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: memory usage of constants versus vars
Message-Id: <35a6a060.93822958@nntp.idsonline.com>

"Lee Falkenhagen" <falkenl@hotmail.com> Said this:

>I have quite a few "variables" in my scripts that I initialize once and
>they are then read only.  Is it better from a performance/memory
>perspective to declare them as constants instead?  Or keep them as
>variables...

If you mean just use plain THIS instead of declaring $this = "THIS"
and using $this everywhere you would otherwise write THIS  ??

Unless you are storing HUGE bits of data in your variables, this is
not much of a memory issue.  I mean, well, consider this as a bad
example  (hehehe)

$var1 = "Supercalifragilisticexpealidocious";
$var2 = "somereallyenormousstringofcharactersbeyondsenseandreason";

Now, the script will be smaller if you repeat $var1 and $var2 a
thousand times, rather than putting those long strings of text a
thousand times...... I mean, the script itself is occupying ram when
it's compiled and run, so your code, itself, will be larger if you
repeated the actual string a thousand times versus a three or four
character variable identifier several thousand times.

Plus, I think the benefit of being able to change the string once, at
the point where it's declared is worth any memory hit you might take
for doing so.  Imagine having to hunt through your script to find 50
instances of "THIS" and changing it (although search and replace in
wordpad sure helps).






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

Date: 11 Jul 1998 00:38:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: number of days between two given dates using perl
Message-Id: <6o6c69$8an$3@client3.news.psi.net>

Vince Laurent (vlaurent@NOSPAM.ssmhc.com) wrote on MDCCLXXIV September
MCMXCIII in <URL: news:35A67FDF.DF77C5AE@NOSPAM.ssmhc.com>:
++ Here is a starter hint:  Convert your dates to Julian and then do the math....
++ there are MANY perl julian date routines floating around.


Here's another hint: visit your friendly local CPAN mirror.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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

Date: 11 Jul 1998 00:40:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Openin files
Message-Id: <6o6cab$8an$4@client3.news.psi.net>

Guillermo Garcis (ggarces@arrakis.es) wrote on MDCCLXXIV September
MCMXCIII in <URL: news:35a688a1.0@news.arrakis.es>:
++ Can i open a file that is in other server?


Perhaps.  Do you have something like NFS or Samba?



Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


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

Date: Fri, 10 Jul 1998 23:14:56 GMT
From: Jahan@PriceCut.com
Subject: perl system call error
Message-Id: <6o679g$o87$1@nnrp1.dejanews.com>

Hello.
Please help me find out what is wrong with my perl script:
system: PII 200
OS: Windows NT 4.0 and service Pack 3
perl version: perl 5.004_04 with Win32
script is called test.pl:  system ("mkdir \"c:\\mydir\" ");
execute: perl test.pl
error appears:  file name too long and cannot make dir

If I remove the 'c:' from the script:  system ("mkdir \"\\mydir\" ");
it works fine with no error.

Can please somebody tells me what is wrong with this simple script
Please send your helps to jahan@PriceCut.com

Thank you very much in advance.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 10 Jul 1998 23:14:11 GMT
From: Jahan@PriceCut.com
Subject: perl system call error
Message-Id: <6o6784$o7v$1@nnrp1.dejanews.com>

Hello.
Please help me find out what is wrong with my perl script:
system: PII 200
OS: Windows NT 4.0 and service Pack 3
perl version: perl 5.004_04 with Win32
script:  system ("mkdir \"c:\\mydir\" ");
execute: perl test.pl
error appears:  file name too long and cannot make dir

If I remove the 'c:' from the script:  system ("mkdir \"\\mydir\" ");
it works fine with no error.

Can please somebody tells me what is wrong with this simple script
Please send your helps to jahan@PriceCut.com

Thank you very much in advance.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 10 Jul 1998 23:23:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl system call error
Message-Id: <6o67pt$587$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Jahan@PriceCut.com writes:
:If I remove the 'c:' from the script:  system ("mkdir \"\\mydir\" ");
:it works fine with no error.

That's not a system call.  And my God it's disgusting.  

    mkdir($directory, 0777);

*THAT'S* a system call. (usually).

--tom
-- 
    "You can't have filenames longer than 14 chars.  
     You can't even think about them!"
        --Larry Wall in Configure from the perl distribution


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

Date: 10 Jul 1998 23:39:40 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: Putting CPAN on a CD:  good or not good?
Message-Id: <6o68ns$ljo@news.service.uci.edu>
Keywords: from just another new york perl hacker

	[mailed & posted]
In article <comdog-ya02408000R1007981305190001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:

>just got this is private email.  i realize that CPAN was put
>onto the Perl Resource Kit CD, but i also had (have :) confidence
>in the people who put that together.  i'm inclined to say no
>to this request (i have two modules on CPAN), but wanted to gauge
>the community sentiment.
>
>my thoughts:
>
>   * CPAN on CD is outdated even before the first copy is burned.
>      this is the strongest objection to the undertaking.

This may true, but not a real valid (legal) reason against CD
distribution (except for you and others).  For some, stuff on CD is
more accessible than stuff on the Internet (especially for closed
networks).


>   * they're making money off of this (yes, so was ORA - well, they
>      had the potential to make money anyway :)

Probably, but if you distributed your stuff under the Artistic
License or the GPL, there is not much you can do.  Supposedly, people
are paying for the other stuff besides the CD, but nothing prohibits
them from charging for the CD itself unless you used a license that
prohibits this without arrangements may be you and the distributor.

If you are concerned about such things, you should change the type
of license you use on future versions of your software.  Note,
I do not know if CPAN has limitations on the types of licenses
that can be used in contributed code.  For example, I would expect
resistance from the maintainers if people tried to load non-free
software.  I am personally interested on what the maintainers
think about this.


>   * i probably don't have the right to say no (or anything else ) if 
>      i used the Perl Artistic License:
>
>      1. You may make and give away verbatim copies of
>      the source form of the Standard Version of this
>      Package without restriction, provided that you
>      duplicate all of the original copyright notices
>      and associated disclaimers.

Yep.


>   * the quality of the email message's grammar and spelling really
>      make me think about the author's competence, although it
>      sounds as if the language of the magazine and book may not
>      be english (probably german).

The author appears to be a non-native English speaker.  So it
is not fair to judge him on his grammer.


>comments and such appreciated :)

I give the author of the message credit for at least sending a message
to CPAN contributers about the CD.  With the AL and GPL, he did not
have to notify anyone.  All that is required is to following the rules
spelled out by the AL or GPL (whichever one applies).

I think he is being cautious since it may be possible for some CPAN
contributers to use licenses different from the AL and GPL, and he
wants to avoid any potential conflicts.

What is the official policy about licensing of software uploaded
to CPAN?

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Sat, 11 Jul 1998 01:14:06 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Putting CPAN on a CD:  good or not good?
Message-Id: <8czpeh6vfs.fsf@gadget.cscaper.com>

>>>>> "brian" == brian d foy <comdog@computerdog.com> writes:

brian> In article <6o5rgv$bam@news1.panix.com>, dha@panix.com (David Adler) posted:
>> -- 
>> David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
>> Free Randal Schwartz!  <http://www.rahul.net/jeffrey/ovs/>

brian> Randal is free!  Rejoice!

Not free.  Just sensibly priced.

:-)

Seriously though, "not going to jail" is a long way from "no longer a
felon".  That's another two years in the making <sigh, crossing
fingers>.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 10 Jul 1998 18:01:10 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: question about objects
Message-Id: <6o66fn$mbd@fohnix.metronet.com>

) Tye McQueen wrote:
) 
) >... and write
) >
) >    {  $XyZzY= $^W;  $^W= 0;  $arg= $ARGV[0];  $^W= $XyZzY;  }
) >
) >to avoid the "uninitialized value" warning when no command-line
) >arguments are given.  It is a frustrating mindset.

bart.mediamind@tornado.be (Bart Lateur) writes:
) Here's another candidate idiom for ya.
) 
) 	{  local($^W);
) 	   $arg= $ARGV[0];
) 	}
) 
) Note that you don't need to assign undef or 0 to $^W, since local does
) that for you (undef).

It was meant as an example of bad code.   I thought it was
obvious that there were better ways to do it.  I prefer

    $arg= @ARGV ? $ARGV[0] : "";

Reminds me of a true incident:

Lab helper:  What is the problem?
Student:  When I compile this I get error messages.
Lab helper:  If that is the problem, then it is easy to fix.
    Type "set message/noerr/nofac/nosev/notext"
[This is a VMS command that turns off all error messages.]
Student:  ...Yeah, that fixed it.
[Later...]
Student:  I reprinted my output and it is still wrong...

Why turn off the warning when you can fix what it is warning about.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 10 Jul 1998 16:41:01 -0700
From: Jerald Jackson <jsjacks@primenet.com>
Subject: Re: Removing the ^M character
Message-Id: <6o68qd$j6p@nntp02.primenet.com>

: I have tried

: $line=~s/\r\n$//;
: $line=s/\r$//;
: $line=s/\n$//;

: Is there another method?

This is very dirty but it works.  I am certian many people will respond
with better methods, but as I said this does work.

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

while(<>) {
unless (/\cM\n/) {
print;
} else {
chop;chop;
$_ = "$_\n";
print;
}
}


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

Date: Fri, 10 Jul 1998 17:10:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Trinary operator vs =~ : sometimes it doesn't pay to be too cute
Message-Id: <MPG.10104d4d1f031b94989702@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6o646l$njv@netline.jpl.nasa.gov> on 10 Jul 1998 22:22:13 GMT, 
Peter Scott <psi@euclid.jpl.nasa.gov> says...
 ...
> 	$opt_t =~ /unix/i ? $doc =~ tr/\r/\n/ : $doc =~ tr/\r/\r\n/;
> 
> "That's good," said I, then stuck my foot in my mouth by saying, "of course,
> you could save a bit of typing by writing it instead as"
> 
> 	$doc =~ ($opt_t =~ /unix/i) ? tr/\r/\n/ : tr/\r/\r\n/;
> 
> Wrong!  Should have tried it first, no matter how obvious it looked.

Always!!!  If you like to factor code as much as I do, you'll like this 
way:

	$doc =~ s#\r#($opt_t !~ /unix/i && "\r") . "\n"#eg;

Fewer characters, anyone???

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 10 Jul 1998 17:22:11 -0700
From: Allen Choy <achoy@us.oracle.com>
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <35A6B033.A2BA3BDF@us.oracle.com>

Don't I get into a Y2K problem if I add 1900?

--Allen

Craig Berry wrote:

> Albert W. Dorrington (awdorrin@mail.delcoelect.com) wrote:
> : Using the code:
> :
> :       $year = localtime[5] + 1900;
>
> That actually needs to be (localtime)[5] .
>
> ---------------------------------------------------------------------
>    |   Craig Berry - cberry@cinenet.net
>  --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
>    |      Member of The HTML Writers Guild: http://www.hwg.org/
>        "Every man and every woman is a star."





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

Date: Sat, 11 Jul 1998 00:54:45 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <6o6d8u$i82$1@ligarius.ultra.net>

[ posted and mailed ]

Allen Choy <achoy@us.oracle.com> wrote:
-> Don't I get into a Y2K problem if I add 1900?

no. you solve one.

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: 10 Jul 1998 18:03:48 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <6o6dlk$md6@Xenon.Stanford.EDU>

In article <35A6B033.A2BA3BDF@us.oracle.com>,
Allen Choy  <achoy@us.oracle.com> wrote:
>Don't I get into a Y2K problem if I add 1900?

someone just posted this a few days ago. rtfm.

$ perldoc -f localtime
=item localtime EXPR

Converts a time as returned by the time function to a 9-element array
with the time analyzed for the local time zone.  Typically used as
follows:

    #  0    1    2     3     4    5     6     7     8
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
                                                localtime(time);

All array elements are numeric, and come straight out of a struct tm.
In particular this means that $mon has the range 0..11 and $wday has
the range 0..6 with sunday as day 0.  Also, $year is the number of
years since 1900, that is, $year is 123 in year 2023.

If EXPR is omitted, uses the current time (C<localtime(time)>).

In a scalar context, returns the ctime(3) value:

    $now_string = localtime;  # e.g., "Thu Oct 13 04:54:34 1994"

This scalar value is B<not> locale dependent, see L<perllocale>,
but instead a Perl builtin.
Also see the Time::Local module, and the strftime(3) and mktime(3)
function available via the POSIX module.

-- 
Kelly William Hirano	                    Stanford Athletics:
hirano@cs.stanford.edu	                 http://www.gostanford.com/
hirano@alumni.stanford.org      (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20


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

Date: Sat, 11 Jul 1998 01:12:33 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <8c4swp8a2p.fsf@gadget.cscaper.com>

>>>>> "Allen" == Allen Choy <achoy@us.oracle.com> writes:

>> : Using the code:
>> :
>> :       $year = localtime[5] + 1900;
>> 
>> That actually needs to be (localtime)[5] .

Allen> Don't I get into a Y2K problem if I add 1900?

I suppose this needs to be posted EVERY FIFTEEN MINUTES UNTIL THE
MILLENIUM, but in a word,

	N O

:-)

print "Just another Perl hacker," # wondering why "perldoc perlfaq" is so hard to type :-)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

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

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