[8671] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2288 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 10 03:07:20 1998

Date: Fri, 10 Apr 98 00:00:50 -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 Apr 1998     Volume: 8 Number: 2288

Today's topics:
    Re: Announce: Intro to Perl 5 document available <rjk@coos.dartmouth.edu>
    Re: Announce: Intro to Perl 5 document available (Ilya Zakharevich)
        dbmopen legacy problems <coffman@value.net>
    Re: Detect broken links? (Abigail)
        Easy package/sub-routine ? <soccer@all-soccer.com>
    Re: fork and forget <jn1@outofservice.com>
        help with delimiters <cyborg@eri.erinet.com>
    Re: help with delimiters (Craig Berry)
    Re: keys in hashs (Mark-Jason Dominus)
    Re: keys in hashs <jn1@outofservice.com>
    Re: Looking for Polling/Voting CGI/java Script <jn1@outofservice.com>
    Re: Perl state machine strategies (Mark-Jason Dominus)
        PERL SUBROUTINES.... <devjyoti@123greetings.com>
    Re: perl win 32 :  asterisk on command line (Excession)
        Random Banner Problem <hilljere@pilot.msu.edu>
    Re: RMS should be invited to O'Reilly's "Free Software  (Ilya Zakharevich)
    Re: RMS should be invited to O'Reilly's "Free Software  (Alexander Viro)
    Re: RMS should be invited to O'Reilly's "Free Software  (Kenneth P. Turvey)
        rounding and precision (Zach Bagnall)
    Re: Strange "Modification of a read-only value attempte <james.a.squire@boeing.com>
    Re: Tail-like functionality <rjk@coos.dartmouth.edu>
        Transferring 'Date/Time' Datatype from Access to Oracle <wbjones@msn.com>
    Re: URL-Encoding: is + unsafe? (Abigail)
    Re: Week of Month <gwynne@utkux.utk.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 09 Apr 1998 23:54:21 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Russell Quong <quong@shell14.ba.best.com>
Subject: Re: Announce: Intro to Perl 5 document available
Message-Id: <352D97F3.F8D8C17A@coos.dartmouth.edu>

[posted and mailed]

Russell Quong wrote:
> 
> I've written a free document available in both HTML and postscript.
>       Perl in 20 pages
> at
>       http://www.best.com/~quong/perlin20/perlin20.html
> 
> which is a concise guide for the medium-to-advance programmer to get
> them up to speed on Perl 5 quickly.

This could be useful, but I'm concerned that programmers will have to read the
standard documentation carefully to correct some of the misconceptions introduced.

Some random comments...

The language is Perl, with a capital P.  The interpreter is perl, with a
lowercase p.

There is no such thing as an "array" context.  List, scalar, void.

\bsl{} must be postscript markup or somesuch.  You should fix it in the html version.

0+1 is not 0.  (The table under String or number.)

Whether an array is empty is not equivalent to whether it is defined.  With
arrays, defined() returns true if the array has memory allocated.
(For example, @x=(1);@x=();print defined(@x), "\n";)

The inequality operator for strings is ne, not neq.

Don't italicize < and > and surrounding characters, it makes them harder to read.

local is still used in new code.  my can't be used on special variables, nor
on variables in the symbol table.  Simply telling people to use my instead of
local ignores these issues.

@bbb[$ccc] always returns a one-element array, even if $bbb[$ccc] is
undefined.  In that case, the array returned is (undef).

Don't try to espouse overall rules for the various contexts.  There are no
hard and fast rules.

You're quoting the Camel book out of context and misintepreting it.  Variable
names do always start with $, @, or %.  However, on the previous page: 
"Scalar variables are always named with an initial $, *even when referring to
a scalar that is part of an array or hash*."  [my emph]

You completely ignore the syntax my $var.  No parens = no list context.  (...)
does not force list context on its contents.

You *can* use parens around the arguments of a print statement.  Your problem
was the comma after the filehandle, not the parens.  print (STDOUT "foo\n");

The return type of a function *can* be specified.  Find out about the
wantarray function.

Don't put a space after the ^ in a character class, unless you mean it.
\s also includes \f and \r.  Read the documentation.

Don't forget the ?? non-greedy quantifier.

=~ is the 'binding operator', not the 'regex operator'.  Note that it is also
used with tr///.

$1, $2, etc. are only set after a successful match.  And they *cannot* be used
in a regex to match a previously matched group from that regex.  You must use
\1, \2, etc. instead.

It's obvious you haven't tested your brief examples.
(For example,   if ( (-x /bin/ccc) && (-r ../input/ddd) ) ... )


In summary, I think this document will be useful, but it needs editing.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 10 Apr 1998 03:57:09 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Announce: Intro to Perl 5 document available
Message-Id: <6gk5al$7lr$1@mathserv.mps.ohio-state.edu>
Keywords: perl document, introduction to perl

[A complimentary Cc of this posting was sent to Russell Quong
<quong@shell14.ba.best.com>],
who wrote in article <6gjg3a$pjo$1@shell14.ba.best.com>:
> I've written a free document available in both HTML and postscript.  
>       Perl in 20 pages
> at
>       http://www.best.com/~quong/perlin20/perlin20.html
> 
> which is a concise guide for the medium-to-advance programmer to get
> them up to speed on Perl 5 quickly.
> 
> I do not read the Perl newsgroups, so follow up via email.

Judging by the author is using 5.003, documents undef as TRUE,
references as not being scalars, thinks lists and arrays are
identical, and is writing "$infile", reading the Perl newsgroups may
help him a lot.

I do not know what group of readers is addressed by this document, but
at least the identation is clean ;-).

Ilya


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

Date: 10 Apr 1998 06:41:31 GMT
From: Coffman <coffman@value.net>
Subject: dbmopen legacy problems
Message-Id: <6gkeur$ac9$1@vnetnews.value.net>


We have a website with many dbmopen's, so it is using the standard
NDBM_File.  The system is running Linux 2.0.31, apache 1.2.5 (or 6),
and perl 5.004_01

We get many failures on the dbmopen, with $! eq "Resource temporarily
unavailable".  This does not happen all of the time, but only some of
the time.  It seems to happen most frequently at peak usage times.  
It began shortly after we upgraded (hardware, os and from perl 5.003),
so I am led to beleive that the increased server use is responsible
for the errors.

Does anyone have any idea why this might be happening?
I assume that this is some failing of NDBM, since that is what dbmopen
will use first.  I can convert the data files to use DB_File, but I'd
like to know if that would even help?


Your help would be appreciated!

Thanks in advance,
Bill Coffman


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

Date: 10 Apr 1998 03:25:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Detect broken links?
Message-Id: <6gk3fd$rp2$3@client2.news.psi.net>

bjf (ben@wallroyds.demon.co.uk) wrote on MDCLXXXII September MCMXCIII in
<URL: news:892159976.25778.0.nnrp-08.c2de5b4a@news.demon.co.uk>:
++ Umm ... What about the 404 pages? Will those pages be classified as broken
++ links or not?

Djee, that's up to you, isn't? If you want to classify them as broken,
classify them as broken, if you don't want to classify them as broken,
don't classify them as broken.



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


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

Date: Fri, 10 Apr 1998 00:06:25 -0400
From: Geoffrey Hebert <soccer@all-soccer.com>
Subject: Easy package/sub-routine ?
Message-Id: <352D9AC0.B7525F4F@all-soccer.com>

Easy package/sub-routine question.  I want to put some sub-routines in a
file to be used by several scripts.

Never having done this, I have a very basic question/problem.  How do I
do this?
My attempt is included below.

I have two perl scripts - test.pl and Testlib.pm  (included below)
Note - by moving sub-routine to test.pl and dropping use test.pl works
fine. Perl5

I get the following errors below -

Illegal character \015 (carriage return) at Testlib.pm line 2.
(Maybe you didn't strip carriage returns after a network transfer?)
BEGIN failed--compilation aborted at
/home/heberts/wwwroot/soccer-bin/test.pl line 2.
[Thu Apr 9 23:31:08 1998] access to
/home/heberts/wwwroot/soccer-bin/test.pl failed for 206.152.185.80,
reason: Premature end of script headers

Here is the subroutine library:


#!/usr/local/bin/perl
package Testlib;

#####  sub routines   ########

sub print_sub2 {
  print<<"end_part";
  <i>Sub 2</i><p>
end_part
}  # end sub



Here is calling program -

#!/usr/local/bin/perl
use Testlib;             #  |||||||  point to sub-routine library
# look for lib note w/o pl suffix
print "Content-type: text/html\n\n";

print<<"end_part";

<html>
<head>
<title>Line-up</title>
</head>
<BODY BGCOLOR="#fbfbd3" LINK="#0000ff" VLINK="#669933" ALINK="#66ff33"
TEXT="#000000" >
<A HREF="../leagues/$league\/index.html"> <b>$Ldiv_short
Home</b></a><br>
<h2>Test</h2>
end_part
&print_sub1;           #  |||||||| sub routine here in this file
&print_sub2;           #  |||||||| sub-routine in Testlib
&print_sub3;           #  |||||||| sub-routine here in this file

&print_end;
exit;

#####  sub routines   ########

sub print_sub1 {
  print<<"end_part";
  <big>Sub 1</Big><p>
end_part
}  # end sub

sub print_sub3 {
  print<<"end_part";
  <b>Sub 3</b><p>
end_part
}  # end sub


sub print_end {
print<<"end_all";
<hr>
</body>
</html>
end_all
}  # end sub-routine




--
FREE   FREE   FREE   FREE

Free site for your Soccer League

http://www.all-soccer.com

All about soccer - what else is there!




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

Date: Fri, 10 Apr 1998 02:06:11 -0400
From: Jeff <jn1@outofservice.com>
Subject: Re: fork and forget
Message-Id: <352DB6B5.79AB@outofservice.com>

You'll need to fork and close STDOUT and STDERR, since those are
inherited from the parent. (This'll work for CGI processes too, of
course... but wrong newsgroup.)

-j


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

Date: 10 Apr 1998 03:12:58 GMT
From: Nick Bradaschia <cyborg@eri.erinet.com>
Subject: help with delimiters
Message-Id: <6gk2nq$bhg@nntp1.erinet.com>

I am stuck! (and a newbie too!)
I am trying to read just a certain data from a file.
i.e.
from the string:
log:name:connect:transmit:receive:protocol
I want to obtain only the "connect" value (which happens to be bounded by 2
":"'s). I have attempted to do a split
procedure, but it does not appear to work!  
here is my code:

open (DATA, "data");
        while ($line=<DATA>) {
        ($rx)=split((':'),$line);
        print "$rx\n";
}
}
close (DATA);
print "$x\n";

this is what i think it's doing:  i open the file, set $line to read every line
from the file <DATA> set $rx to equal everything bounded before the first ":". 
right?  how can I set the delimiter so it reads the xth ":" instead of the 1st
one?  Any help is appreciated!! 
(by e-mail please)
Nick


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

Date: 10 Apr 1998 05:48:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: help with delimiters
Message-Id: <6gkbrs$t7e$1@marina.cinenet.net>

Nick Bradaschia (cyborg@eri.erinet.com) wrote:
: I am trying to read just a certain data from a file.
: i.e.
: from the string:
: log:name:connect:transmit:receive:protocol
: I want to obtain only the "connect" value (which happens to be bounded by 2
: ":"'s). I have attempted to do a split
: procedure, but it does not appear to work!  
: here is my code:
: 
: open (DATA, "data");

Always a good idea to check the result of open.

:         while ($line=<DATA>) {
:         ($rx)=split((':'),$line);

Weird indenting makes this hard to read.  First arg to split should be a 
regex.  To set $rx to the third (index 2) element in the source string, use

  $rx = (split /:/, $line)[2];

: (by e-mail please)

My mom taught me to share. :-)

---------------------------------------------------------------------
   |   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: 9 Apr 1998 23:27:14 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: keys in hashs
Message-Id: <6gk3ii$bqj$1@monet.op.net>

In article <6gjmr5$252$1@isnews.csc.calpoly.edu>,
Ali Mehdizadeh <amehdiza@joule.ee.calpoly.edu> wrote:
>What is the difference between these two:
>
>$myhash{'key'} = 12;
>$myhash{key} = 12;

Usually there is no difference.  Perl 5 added the rule that when a
hash key begins with a letter and is made of letters and digits, you
can leave out the quotation marks.

The two examples you give are identical.

The difference is in something like this:

	$myhash{'foo()'} = 12;
	$myhash{foo()} = 12;

The first example stores 12 in the hash, keyed by the literal
five-character string 'foo()'.  The second example calls the foo
function with no arguments, gets the return value, and uses the
resturn value as the key for storing the 12.

>Which one is better and why did they change it?

They changed it because people were tired of writing quotation marks
all the time and felt that it cluttered up the code.

They are both better.


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

Date: Fri, 10 Apr 1998 01:51:54 -0400
From: Jeff <jn1@outofservice.com>
Subject: Re: keys in hashs
Message-Id: <352DB35D.7243@outofservice.com>

$myhash{'key'} = 12;
$myhash{key} = 12;

first one is the better way to do it- the second one is a 
bareword, and if perl6 ever came along and claimed the literal
token key as a symbol, your script would fail.

difference between 'key' and "key": 'key' is literal, whereas "key" will
expand nicely if you have $vars, etc. (single quoted prints the literal
of everything except \'ed items, so to print a quote character you use
'"')

-j


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

Date: Fri, 10 Apr 1998 02:03:47 -0400
From: Jeff <jn1@outofservice.com>
Subject: Re: Looking for Polling/Voting CGI/java Script
Message-Id: <352DB625.3FB2@outofservice.com>

still looking?

is it REQUIRD that a user can't somehow vote twice? that's almost
impossible to do since the anonimity of the web will make hacking easy. 
what i've done (look at www.outofservice.com) is just track ip's.  sure,
someone can reconnect with a different IP and vote again... but that'd
be work.  it stops the not-so-serious ones.

-j


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

Date: 9 Apr 1998 23:16:30 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl state machine strategies
Message-Id: <6gk2ue$bnl$1@monet.op.net>

In article <6gj9ss$m1d$1@user1.teleport.com>,
>if(state == start) {
>   if(input = 'x'){
>	state = found_x;
>	//do something...
>   }
>   elsif(input == 'y'){
>        state = found_y;
>        //do something...
>   }
>}.....
>
>Has anyone out there done state machines in perl, and if so what kind of
>strategies have been developed?

A much more Perlish strategy is to use a hash whose keys are states,
and whose values are transition tables for the states.  Each
transition table is, in turn, a hash whose keys are input symbols and
whose values are new states, or actions, or something like that.

Then your state table looks like

  %state_table = ( start => { 'x' => [ found_x, \&do_something ],
                              'y' => [ found_y, \&do_something_else ],
	                    },

                   found_x => { ... },

                   found_y => { ... },
	        );

The code to run the state machine is particularly simple:

$state = 'start';
while (! $STOP) {
  $sym = read input symbol;
  ($new_state, $action) = @{$state_table{$state}{$sym}};
  &$action();                  # Execute action
  $state = $new_state;
}

That's all!

You might want to look at my `Regex.pm' module.  It implements
regular-expression pattern matching in Perl using state machines.
(This is obviously useless, since Perl already has regular expression
pattern matching, but the point here is to see how pattern matching is
actually done.)  The state machines are dynamically constructed and
have the form I just described.

	http://www.plover.com/~mjd/perl/Regex/




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

Date: Fri, 10 Apr 1998 10:48:41 +0530
From: Devjyoti Mookerjee <devjyoti@123greetings.com>
Subject: PERL SUBROUTINES....
Message-Id: <352DABB1.60E9@123greetings.com>

Hello,
 Can you please tell me if there is any way a subroutine can be called
directly from outside a script, as from the prompt, or as an URL?

Thank you,
Devjyoti


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

Date: Fri, 10 Apr 1998 02:01:46 GMT
From: daclay@NOSPAMzip.com.au (Excession)
Subject: Re: perl win 32 :  asterisk on command line
Message-Id: <352d72dd.1185429@news.zip.com.au>

drummj@mail.mmc.org (Jeffrey R. Drumm) erupted:

>daclay@zip.com.au (Excession) wrote
>>drummj@mail.mmc.org (Jeffrey R. Drumm) wrote:
>>><WS010@dvvlap.be> wrote:
>>[regarding perl -xxx blah blah * blah]

>>>>Who knows why this feature has been deliberately added to Perl for Win32?
>>>Remember that Perl's roots are in the Unix world; there, the command line is
>>Same thing happens with Windows NT command processor.
>
>Think so? Explain the following:
>C:\>echo *
>*
>Do you understand the significance of this? In the future, I would suggest you
>do your homework before you post.

Try using * as an argument to a CMD file, and see what happens, Mr Perfect.

>>>Perl is merely attempting to duplicate this behaviour in the somewhat
>>>brain-addling environment of NT. :-)

>>Which brings me to the point

<RANT elided>

>I use NT every single day. I am consistenly amazed at what DOESN'T work in the
>NT world that is trivial to implement on Unix.  If you'd like, I can list what
>sucks about NT. I can list lots and lots of things.

Do you get paid to enumerate 'what sucks about x' ?  

Are you familiar with the term ' it's easy to criticise, it's difficult to
create'?   Do you whine and moan and carp about hardware?  Application
software? Automobiles?  Public Transport?  Government decisions?
Multinational expansionist policies?   Does any of your, er, ``considered''
output do anyone any good whatsoever?

>Anyway, it's irrelevant. I posted an opinion about an operating system. I
>followed that opinion with a smiley, which even most humor-challenged
>individuals such as yourself recognize as an indication of frivolity.
>Apparently, you're more humor-bereft than most.

Ah, the old 'didn't ya see the smilie' line.  Perhaps the thought that I
was speaking to the audience as well as yourself, crossed your heated brow
as you composed your reply, hmm?

>>This operating system *bigotry* really gets up my nose.  Sure, Windows NT
>>has some problems, and Windows 95 has more, but the amount of oleaginous
>>self congratulation by the various Unix-centred BIGOTS on this group,
>>whenever 'NT' and 'Problem' come into scope, is just over-the-top pathetic.

>If a simple opinion followed by a smiley gets under your skin this badly, I
>might suggest that your suggestion to 'Grow up' is, ahem, misdirected.

The 'simple opinion' was merely another example of the wider motif; "if
someone mentions NT then denigrate, denigrate, denigrate!"  It was a
catalyst for my rant.  I'm sure you feel hurt and angered that someone
would take umbrage at your twee little offering (smiley and all), but my
point remains -- O/S bigotry itself SUCKS far more than any individual
operating system.

>>The plain fact of the matter is that -perl- is able to run on many
>>different platforms, and whatever platform it runs on, there are different
>>caveats.

>>What makes the incompatibilities and idiosyncratic behaviour of perl on
>>different versions of Linux, any different from perl running on DOS, OS/2
>>or Window 95 or Windows NT? 

>You'll find that the difference in Perl's operation on the aforementioned Unix
>platforms is almost imperceptable when running the same version/build of Perl.

Because Perl is Unix-centric.  And thats fine, I was surprised when I
learnt that Perl would run on Windows NT, I was more surprised when I found
it would run quite well on Windows 95.  I think it is great that Perl is
available on these platforms, and I've gushed about that aspect of perl
before (http://www.pcug.org.au/~dac/perl.htm).  

You won't find me going around saying 'Linux sucks because it won't run
Starcraft'.  Yet if NT can't do something that Linux can, then it's "NT is
braindead, it can't do FWVM".  Swings and roundabouts.

>Your perceived differences are either because the vendors of those Linux
>versions insist on including outdated versions, or you don't actually have any
>experience with them (I'll give you the benefit of the doubt and assume the

Sheesh.  My perceptions have nothing to do with the DIFFERENCES between
various versions of Linux.  The #perl IRC channel has regular bitching
sessions concerning the folly of Red Hat vs the innate righteousness of
Slackware.  I'm recounting Linux-head vs Linux-head here; from the horses
mouth, so to speak.

>former).  I run Perl on SCO, AIX, HP/UX and Linux (SlackWare 4.3 if it

Yada yada yada.

>One who has worked in the Unix world will find the lack of features such as
>alarm(), fork(), decent redirection, the need for binmode(), etc. to be
>virtually crippling.

If NT were Unix I'd be surprised to find those features missing too.
Funnily enough, NT isn't Unix. :-)

For alarm() I'd have to think about it, for fork() I'd use spawn() and
binmode() just *is* (For a unix-centric example, look at FTP.  How many
times have people stumbled over the arrant nonsense inherent in having to
know what TYPE of file you were trying to send or recieve?)

>>Stop the bigotry. 
>Yeah, right. Sure. You bet.
>>Thanks.
>Uh huh.

Politenessman wins the point.

Have a nice day. :-)

Dac


---
David Andrew Clayton     # Please remove NO_SPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   #


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

Date: Fri, 10 Apr 1998 02:07:45 -0400
From: Jeremy Hill <hilljere@pilot.msu.edu>
Subject: Random Banner Problem
Message-Id: <352DB731.839C1571@pilot.msu.edu>

Someone Please help me!

I need a way to display random banners on a web page
whenever someone goes to the page.  I thought that
I could just say

<img src="MyScript.cgi">  

where MyScript.cgi would return the name of the
banner.  I don't need any banner rotation, I just
want a random banner each time the page is loaded
or re-loaded.  Any help would be GREATLY appreciated.
Thanking you in advance,

Jeremy Hill

P.S. I can handle everthing as far as choosing
a random banner from a certain directory. I just
need to know how to feed it to the web page.  And,
I would rather not use server-side-includes.


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

Date: 10 Apr 1998 04:03:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6gk5mc$8km$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Jeremy Allison
<jeremy@netcom.com>],
who wrote in article <jeremyEr63Eu.3tv@netcom.com>:
> You can still serve MS clients with it - you can sell it, you
> can even add a proprietary GUI front end (people have). The 
> only thing you can't do is make proprietary changes. How does 
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> this hurt you ?

As far as you explain, nobody in his mind would use this any better
than Win0.95, which bugs you also have no legal right to fix.

But I hope that you misstated the license policy, it cannot be *that*
bad.  Most probably I can modify it for private use, can I?

And let people with businesses explain you why they would not touch
GPLed software with a 10-foot pole.  As I explained already, even my
*free* *ports* had problems with GPL.

Ilya


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

Date: 10 Apr 1998 00:18:40 -0400
From: viro@riemann.math.psu.edu (Alexander Viro)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6gk6j0$hb4@riemann.math.psu.edu>

In article <6gk5mc$8km$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
[snip]
>
>But I hope that you misstated the license policy, it cannot be *that*
>bad.  Most probably I can modify it for private use, can I?
	You can modify it for private use. _If_ you modify it _and_
distribute your modifications _then_ you can't attach additional strings
and should distribute your fix on the same conditions as the original
variant. Read the license, if you are interested in details (you'ld better
do it _before_ starting flame, IMHO).
							Al
PS: Skol'ko mozhno zanimat'sa odnim i tem zhe onanizmom!


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

Date: Thu, 9 Apr 1998 20:49:57 -0500
From: kturvey@pug1.sprocketshop.com (Kenneth P. Turvey)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <slrn6iqum5.f1.kturvey@www.sprocketshop.com>

On 9 Apr 1998 21:30:44 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>[A complimentary Cc of this posting was sent to Stefaan A Eeckels
><Stefaan.Eeckels@ecc.lu>],
>who wrote in article <6giid7$2j0$1@justus.ecc.lu>:
>
>> People writing software they want to share with other people,
>> and assure that their work will remain accessible, should
>> use the GPL. 
>
>Wrong.  They should use AL or BSD-type license.  Fortunately, I know
>only one piece of fine software which uses GPL and does not come from
>FSF, and it is EMX.

Are you forgetting about most of any Linux distribution?  There are other 	
examples as well.  

-- 
Kenneth P. Turvey <kturvey@pug1.SprocketShop.com> 

The constitution, on this hypothesis, is a mere thing of wax in the
hands of the Judiciary, which they may twist and shape into any form
they please.
	-- Thomas Jefferson


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

Date: 10 Apr 1998 05:52:51 GMT
From: zbweb@hotmail.com (Zach Bagnall)
Subject: rounding and precision
Message-Id: <6gkc3j$jcm$1@newsource.ihug.co.nz>

Hi all,

I'm having some trouble with rounding in perl.

$y = 7;
$m = 4 ** $y;
print $m**(1/$y) - int($m**(1/$y));

Why does this print 1 instead of 0? Is 1/7 irrational?
How can I accurately check to see if $m**(1/$y) is an integer?

Zach.



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

Date: Fri, 10 Apr 1998 03:16:23 GMT
From: James A Squire 312 M 193884 <james.a.squire@boeing.com>
Subject: Re: Strange "Modification of a read-only value attempted" error
Message-Id: <352D8F06.324E@boeing.com>

Ronald J Kimball wrote:

> Note another example; assigning to a substr() off the end of the
> string.
> 
> So, just what is line 302 in your program, anyway???

push @names,$name;

Something's conflicting somehow with Oraperl, and then only when this
parameter is the last one on the line (followed by some "name" values).
-- 
James Squire             Send my Spam to mailto:webmaster@cyberpromo.com
MDA^H^H^HBoeing St. Louis                          http://www.boeing.com
------------------------------------------------------------------------
Hey Novell, is it too much to ask that when I log out of NetWare, it
should ACTUALLY record that I've logged out, so that it doesn't have to
scramble around the house laboriously when I try to log back in, forcing
me to ring the door bell 20 times??????
Opinions expressed here are my own and NOT my company's
------------------------------------------------------------------------
"I haven't sensed so many lies since I worked for the political bureau."
	-- Talia (re: G'Kar and Londo), "Born to the Purple"


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

Date: Fri, 10 Apr 1998 01:36:42 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Kees Hendrikse <kees@echelon.nl>
Subject: Re: Tail-like functionality
Message-Id: <352DAFF6.43F51B61@coos.dartmouth.edu>

[posted and mailed]

Kees Hendrikse wrote:
> 
> In <Er3MzG.HE@world.std.com> aml@world.std.com (Andrew M. Langmead) writes:
> 
> > push @output, $line;
> > shift @output if @output > 20;
> > print @output;
> 
> Thanks, this idea was just what I needed. To make it work, you have to
> take into account the length of the lines, as $#output increases by
> the length of $line, not by 1.

Umm, no it doesn't  $#output will always be the index of the last element in
@output.  It has nothing to do with the lengths of the elements in @output.

Whereever did you get this odd idea?

> Luckily, my lines are all of equal length,
> so this works fine:
>         $length = 73;
>         $tail = 10;
>         push @output, $line;
>         shift @output while @output > $length * $tail;

Are you sure you're not pushing the characters onto @output individually?

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 10 Apr 1998 00:23:07 -0400
From: William Jones <wbjones@msn.com>
Subject: Transferring 'Date/Time' Datatype from Access to Oracle Using DBI
Message-Id: <352D9EAA.2A75BD57@msn.com>

Hello,
    I am running Perl v. 5.004_02 on WinNT4.0 and using the DBI database
interface with the appropriate DBD::ODBC and DBD::Oracle drivers.  I am
unable to transfer a 'Date' field from Access to Oracle.  Any
suggestions, or should I check all 'Date' fields dynamically (if
possible) and perform a manual 'on-the-fly' conversion.

                                                Bill J.



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

Date: 10 Apr 1998 03:03:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: URL-Encoding: is + unsafe?
Message-Id: <6gk26e$rp2$1@client2.news.psi.net>

Matt J. Gumbley (gumblem@pecc.co.uk) wrote on MDCLXXXII September
MCMXCIII in <URL: news:352CF5EA.F16F83ED@pecc.co.uk>:
++ Is '+' an unsafe character - should it be escaped?
++ URI::uri_escape
++ doesn't escape it, and section 2.2 of RFC 1738 states that:
++ 
++         "Thus, only alphanumerics, the special characters "$-_.+!*'(),",
++ and
++ reserved characters used for their reserved purposes may be used
++ unencoded within a URL."

Which part of "may be used unencoded" is unclear to you?

++         If I send a name-value pair such as name=Eric+Bob to a CGI
++ script from
++ a form, Apache's cgi-bin/printenv will show a QUERY_STRING containing an
++ escaped + (Eric%2BBob). However, using uri_escape to escape all unsafe
++ data will
++ result in the string being sent as Eric+Bob, which will be interpreted
++ (by ReadParse) as "Eric Bob" - which is not what I want.
++ 
++         It seems that uri_escape and ReadParse are not symmetrical in
++ their
++ escaping.. or am I missing something?

They are totally unrelated.

RFC 1738 deals with URLs. It states that + is fine to use. RFC 1738 
doesn't care about CGI.

CGI says, "in the part of an URL after a ?, I will interpret + as a
space". That is fine. It might interpret A as B and D as q if it likes
too. 

RFC 1738 is about _syntax_, not interpretation.



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


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

Date: Fri, 10 Apr 1998 00:45:09 -0400
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Week of Month
Message-Id: <6gk86d$2i5$1@gaia.ns.utk.edu>

There is an example of something similar in Nigel Chapman's _Perl: The
Programmer's Companion_, ISBN: 047197563X.  After reading it, it shouldn't
be difficult to do. His example counts all of the Friday the 13ths from the
current date back to 1900.

Bob Gwynne
University of Tennessee



Brian Rankin wrote in message <352D07FC.B4EA94BF@wested.org>...
>I need to calculate the week of month for any given date, i.e.:
>
>April 5 = week1
>April 12 = week 2
>April 19 = week 3
>April 26 = week 4
>
>I've done this thru a rather clumsy script; any better scripting ideas
>would be greatly appreciated:
>
>use Date::Manip;
>$now_string= localtime;
>$now_string=&DateCalc("7 days ago", $now_string, \$err);
>$wday = UnixDate($now_string, '%d');
>## get week of month in $num
>$test=$wday/7;
>($num, $extra) = split(/\./, $test);
>if ($extra) { $num++; }
>
>Brian Rankin
>
>




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

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

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