[9528] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3122 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 10 17:08:48 1998

Date: Fri, 10 Jul 98 14:00:25 -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: 3122

Today's topics:
    Re: -- Abigail, my sink is clogged (Hugh Dunne)
    Re: -w on production code (was Re: better way of gettin (I R A Aggie)
        @$_ causes variable corruption? <kin@omni.c-cube.com>
    Re: Arrays - here's the code (The Wildman)
    Re: capture system() STDERR to filehandle <pius@cisco.com>
        Chmod (cgi-unix) <ggarces@arrakis.es>
        Differences in the file size reported by Net::FTP->size <kperrier@blkbox.com>
    Re: environment-vars (Charles DeRykus)
        extracting data out of html page dwiesel@my-dejanews.com
    Re: extracting data out of html page (brian d foy)
    Re: Help, OLE is giving me a hard time. mad_ahmad@my-dejanews.com
    Re: How can I print  on both sides of a paper? <langford@uiuc.edu>
    Re: I am an "antispam spammer"? (The Wildman)
        MacPerl: Reading rsrc fork (John Siracusa)
    Re: new charter and moderator for comp.lang.perl.announ (David Adler)
    Re: new charter and moderator for comp.lang.perl.announ (David Adler)
    Re: New User (brian d foy)
    Re: number of days between two given dates using perl <vlaurent@NOSPAM.ssmhc.com>
    Re: Perl based Web-to-database system <jjunkin@datacrawler.com>
        Perl+MS SQL <gals@dialup.mplik.ru>
    Re: Perl-HTML not interpreted <jdubois@keane.com>
        Problem using perl5.004_04 rgarg@us.oracle.com.NOSPAM
    Re: Problem using perl5.004_04 <klai@hq.caci.com>
    Re: Proper locking of DBM files? (Jxrn-Morten Innselset)
    Re: Putting CPAN on a CD:  good or not good? (David Adler)
    Re: Putting CPAN on a CD:  good or not good? (brian d foy)
    Re: question about objects <merlyn@stonehenge.com>
        redux, step 1 (was Re: new charter and moderator for co <merlyn@stonehenge.com>
    Re: simple file grepping/searching question <aperrin@mcmahon.qal.berkeley.edu>
        Weirdness in trying to extract year from localtime <achoy@us.oracle.com>
    Re: Weirdness in trying to extract year from localtime (brian d foy)
    Re: Weirdness in trying to extract year from localtime (Larry Rosler)
        Win32_gd module mad_ahmad@my-dejanews.com
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 10 Jul 1998 20:10:59 -0000
From: Hugh_Dunne@nospam.com (Hugh Dunne)
Subject: Re: -- Abigail, my sink is clogged
Message-Id: <35a67553@SpamAssassin.com>

In article <35a64800@SpamAssassin.com>, Hugh_Dunne@nospam.com (Hugh Dunne) wrote:
> Then go to CPAN and download module DRANO.
> After all, perl is the ultimate 'kitchen sink' language!
> 
> ------>>> TO EMAIL ME: Replace "nospam" by "hotmail" <<<------
> Hugh Dunne, Chandler, Arizona      Standard disclaimer applies
> Those who are fond of software and sausages should not enquire
> too closely into the making of either.

Re: -- Abigail, my sink is clogged

------>>> TO EMAIL ME: Replace "nospam" by "hotmail" <<<------
Hugh Dunne, Chandler, Arizona      Standard disclaimer applies
Those who are fond of software and sausages should not enquire
too closely into the making of either.


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

Date: Fri, 10 Jul 1998 15:26:11 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <fl_aggie-1007981526110001@aggie.coaps.fsu.edu>

In article <ltsok94zcy.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:

+ fl_aggie@thepentagon.com (I R A Aggie) writes:

+ > And this is an honest business? I would recommend *not* doing business
+ > with them. If they're willing to cut corners on the quality of their
+ > product, I'm sure they'll cut other corners, too.

+ I never said that their software is their product.  The companies I'm
+ thinking of use software for purposes ancillatory to their primary
+ business ... such as for accounts payable, accounting, inventory
+ control, customer tracking, on-line sales, etc.  I'm sure (because I
+ have seen this first hand) that many of these companies do *not* cut
+ corners in their primary products and services.

Well, as long as they're the ones that take the hit if the software
they've cut corner's on suddenly behaves in a bizarre manner, that's
not so bad...

James - yeah, accounting isn't so important... ;)


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

Date: 10 Jul 1998 12:19:33 -0700
From: Kin Cho <kin@omni.c-cube.com>
Subject: @$_ causes variable corruption?
Message-Id: <coh7m1l4ipm.fsf@omni.c-cube.com>

Hi,
Just ran into a variable corruption problem which is like this:

the second entry of a global variable, which is an array of array,
is getting corrupted upon calling a sub, which is in its own package.
In perldb, the corruption happens right upon entry to the sub --
before any statement is executed.

So I started changing things in hopes of making the problem go away.
Nothing worked until I changed the use of $_ to reference the entries
of the global variable within a for loop to using an explicit for loop
variable.  Now my script works correctly.  However, I wonder if the use
of the following is safe in general:

for (@aoa) {	# aoa is an array of array
   my ($a,$b,$c) = @$_;
   ...
   &mysub($a);	# causes @aoa to be corrupted
   ...
}

The following is my workaround:

for $ndx (@aoa) {	# aoa is an array of array
   my ($a,$b,$c) = @$ndx;
   ...
   &mysub($a);	# works fine!
   ...
}

Thanks for any advice!

-kin

I'm using 5.004_4 on Solaris 2.5.1.



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

Date: 10 Jul 1998 19:52:23 GMT
From: the_wildman_98@hotmail.com (The Wildman)
Subject: Re: Arrays - here's the code
Message-Id: <slrn6qct1u.op7.the_wildman_98@foobar.net>

On 10 Jul 1998 14:51:47 -0400, Wildman's eyes rolled up in his head and
froth dripped from his fangs when Mark-Jason Dominus
<mjd@op.net> said the following fighting words:
>I guess I'll start with the problem you're actually complaining about,
>on line 18.  The code I omitted (at line 3) sets $event[$i].  But then
>by the time you get to line 18 to print out $event[$i], $i is
>different, because you added one to it, either on line 5 or line 14.
>I hope that's what you wanted to know.
Heh. That would certainly be the cause of my trouble. Using $event[$i - 1]
gave the correct results.

>That out of the way, I suggest that you rewrite the code like this:
[...]
>It would be a lot shorter that way, and that is usually a good thing.  
Thank you! I thought perl had a better way to do it. Now I see why people
like it.

>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. I was thinking that
since eq existed, == must mean something else. I would *never* knowingly
code in COBOL. Time for some regex search and replace.
Done. Now it looks like it was written by a C programmer, like it should.

>The big one is that you used thirty lines where five would do.  The
>Cardinal Rule of Programming is that if you have two parts of the
>program to do the same thing, you should merge them.  A related rule
>is: Use code to capture irggularity, and data to capture regularity.
>Here you have an extremely regular structure, so regular that it could
>be turned into a little table.  So that's exactly what we'll do, and
>replace your thirty lines of code with a thirty-element array:
[...]
>After we do this, we're going to make sure that $event_no has not been
>used yet.  Until we do that, there's no point in assigning it to
>$event[$i], so we can delay that until the end.  The entire function
>now looks like this:
[...]
>There are only about nine lines here that have real semantic content.
>That's a big improvement, because the original function was forty or
>fifty lines long.
That was beautifull. Someday I might understand it. How would I add in this?
if ($dice == 100) {
    $dice = &roll(1,100) + 20;
    if ($dice >= 101 && $dice <= 105)   {$event[$i] = 30;}
    if ($dice >= 106 && $dice <= 110)   {$event[$i] = 31;}
    if ($dice >= 111)                   {$event[$i] = 32;}
    if ($dice <= 100)                   {$event[$i] = 0;}
    $events++;
}
There are quite a few functions that have this type of "sub-table".

>This may be as far as you want to go, but I gather (from the name
>`f113') that you have a lot of very similar functions in this program,
>and the Cardinal Rule says you should merge them.  There are only
>three parts of the function that aren't totally generic:
>
>  The part that rolls the dice
>  The @max_dice table
>  $events  
>
The functions aren't that similar, unfortunately. However, I will certainly
make adjustments along these lines where possible.

[snipped here, but I'm saving that for future reference]
>If you really have 113 similar functions, you can probably reduce the
>code size by a factor of 70 or 80.
Well... The functions are following a really bizarre naming
convention. The first was 101, the last will be 978, and they are not
numbered consecutively. However, there are about 100 tables, most of which
can be reduced to the more efficient code you posted. So the reduction will
be pretty darn good anyway.

>Hope this helps.
>
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.

-- 
The Wildman - wildman at microserve dot net
Do NOT reply to this post! All mail sent to the From/Reply-To will be
considered spam, and handled appropriately.
Fight spam - http://www.cauce.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/MU d- s: a- C++ UL+ P+ L+++ !E W-- N+++ o !K w--- !O !M V-- PS PE Y+ PGP?
t+ 5+ X R tv b++ DI+ D++ G e h---- r++++ y++++
------END GEEK CODE BLOCK------


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

Date: Fri, 10 Jul 1998 13:43:48 -0700
From: Pius <pius@cisco.com>
Subject: Re: capture system() STDERR to filehandle
Message-Id: <35A67D04.6633BDC8@cisco.com>

Hi Tom,

Somehow it is not sent out. I have identified myself at the
end of the original request as Pius, pius@cisco.com.
Thanks for the hint. The solution is

open (STDERR, ">&MAIL");

Of course, close(STDERR) at the end.

Pius
pius@cisco.com

I have tried to add it 
Tom Christiansen wrote:
> 
> In comp.lang.perl.misc, USERID@cisco.com writes:
> :How can I capture STDERR from system() to current selected filehandle?
> 
> This is in the FAQ.  And as soon as you post under a real ID,
> I'll tell you which one.
> 
> --tom
> --
> /* This is the one truly awful dwimmer necessary to conflate C and sed. */
>     --Larry Wall, from toke.c in the v5.0 perl distribution


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

Date: Fri, 10 Jul 1998 22:43:52 +0200
From: "Guillermo Garcis" <ggarces@arrakis.es>
Subject: Chmod (cgi-unix)
Message-Id: <35a67fba.0@news.arrakis.es>

How i can do a chmod from a cgi




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

Date: 10 Jul 1998 14:54:24 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Differences in the file size reported by Net::FTP->size and ls -l
Message-Id: <ysizpeh8osv.fsf@blkbox.com>

I have written a script that will ftp patches for me to my local machine.
One of the tasks that I am having the script is compair the size of the 
remote file with the size of the local file and , if they are different,
download the file again (assuming they modified the patch in question).

Well it looks like that the file size returned by Net::FTP is somewhat
different than that returned by an ls -l of the directory in question.

Does anyone know why?  If you want sample code I can post it but this is
pretty easy to duplicate so I don't think this is necessary.

Oh, according to the perldoc Net::FTP page I am using the 21/Dec/97 version.
I am using:

[rs6k-dev] /home/h630652>perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
  Platform:
    osname=aix, osvers=4.1.4.0, archname=aix
    uname='aix rs6k-dev 1 4 002056265900 '
    hint=previous, useposix=true, d_sigaction=define
    bincompat3=n useperlio= d_sfio=
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE'
    ccflags ='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=1, d_casti32=define, d_castneg=
    intsize=4, alignbytes=8, usemymalloc=n, randbits=15
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-ldbm -lld -lm -lc -lbsd -lPW
    libc=/lib/libc.a, so=a
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/per'


Characteristics of this binary (from libperl): 
  Built under aix
  Compiled at Aug 19 1997 12:32:32
  @INC:
    /usr/local/lib/perl5/aix/5.004
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/aix
    /usr/local/lib/perl5/site_perl
    .


Kent


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

Date: Fri, 10 Jul 1998 19:28:01 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: environment-vars
Message-Id: <Evw8qq.A1q@news.boeing.com>

In article <35A491EE.30F5F6CE@erlm.siemens.de>,
Antje Rau  <Antje.Rau@erlm.siemens.de> wrote:
>
>how can i get the following result:
>
>shell#: echo $TEST
>TEST: Undefined variable
>shell#: <perl-script>.pl
>shell#: echo $TEST
>testvar
>shell#:
>
>

perldoc perlfaq8 and look for the question:

I {changed directory, modified my environment} in a perl
     script.  How come the change disappeared when I exited the
     script?  How do I get my changes to be visible?


Then something like this may work depending on your
shell: 

shell# eval `perl -we 'print q(export TEST=testvar)'`


HTH,
--
Charles DeRykus


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

Date: Fri, 10 Jul 1998 20:13:43 GMT
From: dwiesel@my-dejanews.com
Subject: extracting data out of html page
Message-Id: <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.

If you look at this code snippet you'll see what I mean...

CODE SNIPPET
============

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;

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

HTML
====

<TD VALIGN="TOP">The Shawshank Redemption : The Shooting Script (A Newmarket
Screenplay)&nbsp;</TD>
<TD VALIGN="TOP">Darabont, Frank<BR>King, Stephen (Int)<BR>King,
Stephen&nbsp;</TD>
<TD VALIGN="TOP">Newmarket Pr, 1996, USA, Paperback&nbsp;</TD>
<TD VALIGN="TOP">172.00&nbsp;</TD>

<BR><BR>

<TD VALIGN="TOP">Breathing Method: Winter'S Tale&nbsp;</TD>
<TD VALIGN="TOP">King, Stephen <BR>Escott, John (R.) <BR>Strange, Derek
(R.)&nbsp;</TD>
<TD VALIGN="TOP">PENGUIN BOOKS LTD., 1996, UK, Paperback&nbsp;</TD>
<TD VALIGN="TOP">60.00&nbsp;</TD>


Please, help me.

// Daniel

-----== 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 16:57:14 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: extracting data out of html page
Message-Id: <comdog-ya02408000R1007981657140001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6o5sln$7ij$1@nnrp1.dejanews.com>, dwiesel@my-dejanews.com posted:

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

>HTML
>====
>
><TD VALIGN="TOP">The Shawshank Redemption : The Shooting Script (A Newmarket
>Screenplay)&nbsp;</TD>

>
><BR><BR>
>
><TD VALIGN="TOP">Breathing Method: Winter'S Tale&nbsp;</TD>

>Please, help me.

is there an implicit whimper in that line ;)

it looks like the separator for records in this file is the 
"\n\n<BR><BR>\n\n" sequence.  try something like this:

   
   * split the data on that sequence.
   * save the list returned by split in an array
   * step through the array and extract the title of each record

good luck :)

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


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

Date: Fri, 10 Jul 1998 19:04:21 GMT
From: mad_ahmad@my-dejanews.com
Subject: Re: Help, OLE is giving me a hard time.
Message-Id: <6o5ojl$li$1@nnrp1.dejanews.com>

In article <35a510c6.1796242@news2.ibm.net>,
  jan.dubois@ibm.net (Jan Dubois) wrote:
> [mailed & posted]
>
> mad_ahmad@my-dejanews.com wrote:
>
> >Hi, No one answered my last posting much to my dismay. please help me.
>
> You only posted it yesterday. Have a little more patience (or read the
> documentation).
>
> >i'm still haveing problems grabbing a certain range from an Excel spreadsheet
> >and storing it in a Perl array object.
> >so far this is what i've got:
> >
> >$cella = $comparesheet->Cells(2,$j)->{'Address'};
> >$cellb = $comparesheet->Cells(42,$j)->{'Address'};
> >@ourcolumn = $comparesheet->Range("$cella:$cellb")->{'Value'};
> >
> >from this code, all i get is an array with it's first element being the
memory
> >address of an array appearantly (something like  ARRAY(off2338e)).
> >when i do:
> >print @$ourcolumn;
>
> Please recheck your knowledge about references. The code above returns a
> reference to an array. For ActiveState Perl 3xx you should write it as:
>
>     >     print join("\n", @$ourcolumn), "\n";
>
> If you use a later version of the Win32::OLE module then the code
> actually returns a two dimensional array (list of lists) because you
> retrieve a column vector and not a row vector. You can flatten it
with$ourcolumn = $comparesheet->Range("$cella:$cellb")->{Value};

>
>     foreach (@$ourcolumn) { $_ = @$_[0]; }
>     print join("\n", @$ourcolumn), "\n";
>
> or you access elements like @$ourcolumn[0][$index]
>
> -Jan
>


Jan, and\or anyone else,

i tried your suggestion, and i still get just the first element of the array,
(or the first cell of the range)
I think the problem is in this line: the assignment:

$ourcolumn = $comparesheet->Range("$cella:$cellb")->{Value};

I don't know what it is though for some reason the array that gets assigned
only contains one element, and yet it's still an array.
(ie, the memory addrss says ARRAY(blah), but when i print, one value appears)

any ideas??

thanks,
Ahmad

-----== 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 15:11:30 -0500
From: Jacob Langford <langford@uiuc.edu>
Subject: Re: How can I print  on both sides of a paper?
Message-Id: <35A67571.56E98A63@uiuc.edu>

Ophir Marko wrote:

> HI All,
> I need to write a perl script for Unix to print on both sides of a
> paper. Our printer can do that but I have no idea how. So far I could
> only get it to print on one side only.
>
> Thanks,
> Ophir Marko
>
> please reply to ophir@saifun.com

How about this?

#!/usr/bin/perl
open PRINTER, "|lp -oduplex";
while (<>) {
   print PRINTER;
}
close PRINTER;





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

Date: 10 Jul 1998 20:01:26 GMT
From: the_wildman_98@hotmail.com (The Wildman)
Subject: Re: I am an "antispam spammer"?
Message-Id: <slrn6qctj1.op7.the_wildman_98@foobar.net>

On 10 Jul 1998 18:35:27 GMT, Wildman's eyes rolled up in his head and
froth dripped from his fangs when The Wildman
<the_wildman_98@hotmail.com> said the following fighting words:
>On Fri, 10 Jul 1998 17:02:28 GMT, Wildman's eyes rolled up in his head and
>froth dripped from his fangs when WD Baseley
><wbaseley@mindspring.com> said the following fighting words:
>>[comp.lang.perl.misc added to newsgroups]
>And snipped.
Oops. Well, it's snipped now, and followup set. I had absolutely no
intention of discussing this matter here.
The individual who prompted this knows who they are, and is quite welcome to
honor the followup-to.

-- 
The Wildman - wildman at microserve dot net
Do NOT reply to this post! All mail sent to the From/Reply-To will be
considered spam, and handled appropriately.
Fight spam - http://www.cauce.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/MU d- s: a- C++ UL+ P+ L+++ !E W-- N+++ o !K w--- !O !M V-- PS PE Y+ PGP?
t+ 5+ X R tv b++ DI+ D++ G e h---- r++++ y++++
------END GEEK CODE BLOCK------


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

Date: 10 Jul 1998 20:48:42 GMT
From: macintsh@cs.bu.edu (John Siracusa)
Subject: MacPerl: Reading rsrc fork
Message-Id: <6o5una$6v2$1@news1.bu.edu>

Using MacPerl, I'm trying to read the contents of a file's resource
fork in the same manner that you'd read the data fork: as a stream of
bytes.  The MacPerl docs list at least one useful function:

---

OpenResFile NAME	

The OpenResFile function opens an existing resource file. It also
makes this file the current resource file.

    if ( defined($RFD = OpenResFile("Resource.rsrc")) ) {
        # proceed
    } else {
        # error occurred
    }

---

but I have no idea what $RFD is (it's just a number), or how you'd go
about reading from it.  There are a bunch of functions for reading
specific resources based on their ID and/or type, but nothing to just
read it linearly like the regular perl open().  Is this possible?

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow



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

Date: 10 Jul 1998 19:57:04 GMT
From: dha@panix.com (David Adler)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <6o5rmg$bam@news1.panix.com>

On 10 Jul 1998 09:26:25 -0600, Nathan Torkington <gnat@frii.com> wrote:
>Perhaps we could come up with a c.l.p.a code, like the geek code.
>	a++c+C++--L++X+W+
>(translation: a big commercial app with no C++, written by Larry Wall
>to do with XML and the web :-)

I like it!  You should get Jon to add that as a new category in the
Obfuscated Perl Contest.

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"I go where I will and I do what I can" - Henry Fool


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

Date: 10 Jul 1998 20:12:52 GMT
From: dha@panix.com (David Adler)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <6o5sk4$bam@news1.panix.com>

On 10 Jul 1998 06:46:50 -0700, Russ Allbery <rra@stanford.edu> wrote:

>Just pick one of the people who is willing to run the risk of being
>sued, appoint them comoderator for commercial content, and bounce
>everything that you see that you're unwilling to make a judgement on
>over their way.

This may indeed be the best of all possible worlds (w/apologies to Leibnitz).

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
All hail El Cabeza Del Oro!


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

Date: Fri, 10 Jul 1998 15:17:49 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: New User
Message-Id: <comdog-ya02408000R1007981517490001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bdac2b$5155f180$f80110ac@atl-mail.accutech>, "Dalavon" <dalavon@mindspring.com> posted:

>I am a new user.  I just loaded perl onto a HP9000 and I do not think I
>installed the man pages correctly (I am fairly new to UNIX also).  I can
>not find them anywhere on my system.  Can any one help?

make sure the location of the man pages is in your MANPATH.  you might
try /usr/local/man, or the man directoryin whatever prefix you used
for the perl installation.

>Also are there any Perl user groups in the Atlanta, GA area.

Yes!  there is the Atlanta Perl Mongers.  see <URL:http://www.pm.org>
for details and contact info.

good luck :)

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


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

Date: Fri, 10 Jul 1998 15:56:00 -0500
From: Vince Laurent <vlaurent@NOSPAM.ssmhc.com>
To: santhi@my-dejanews.com
Subject: Re: number of days between two given dates using perl
Message-Id: <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.

santhi@my-dejanews.com wrote:

> I have to calculate the number of days in between two given dates in certain
> format.( 07/10/98, 05/30/98 ) Is there any Perl module written for that, or I
> have to write my own function? Please help me.
>
> -----== 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 19:22:39 GMT
From: "Joe Junkin" <jjunkin@datacrawler.com>
Subject: Re: Perl based Web-to-database system
Message-Id: <3Stp1.11$ZH1.257909@news.rdc1.ct.home.com>

I have had a fairly comprehensive contact management system in place for a
while. I am re-hooking up the demo this week, it should be done by next
week. I will keep you informed but I do not have your email, so I will post
it back here next week.

Thanks
Joe Junkin
jjunkin@datacrawler.com

Clinton Gormley wrote in message <6o33pv$i4a$1@taliesin.netcom.net.uk>...
>Useful - indeed yes
>
>I am trying to write some contact management software for the financial
>services community based on an html interface.
>
>what u're tlaking about would be perfect
>
>please keep me informed
>
>Clinton Gormley





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

Date: Sat, 11 Jul 1998 01:09:58 +0500
From: "Senya Galperin" <gals@dialup.mplik.ru>
Subject: Perl+MS SQL
Message-Id: <6o5om4$ovc$1@news.mplik.ru>

                                                        Hi!
Please, help: is there any module that gives opportunity to work with
Microsoft SQL Server (I need to write a program that connects Internet user
and database)

Thanx!




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

Date: Fri, 10 Jul 1998 15:42:58 -0400
From: Joseph DuBois <jdubois@keane.com>
Subject: Re: Perl-HTML not interpreted
Message-Id: <35A66EC2.579C0306@keane.com>



sprigen687@pop.dnvr.uswest.net wrote:

> This is simmilar to Scott Cherkofsky's problem.  I have a script where
> the user enters information and it sends back an HTML document.  But
> when I submit the form, Netscape says that the Document contains no
> data.  I didn't forget the line: print "Content-type: text/html",
> "\n\n";.  I've tried everything.  What's going on?


Have you tried running it from the command line. If you are using the
perl cgi libraries then the following should work on a UNIX system

echo "var=xxx&var2=eee" | scriptname.pl

  This way you can see the output that is being generated. Maybe none!?


-------------------------------------------------------
Joseph DuBois            (Internet/Intranet Specialist)
mailto:jdubois@keane.com  (Work)  http://www.keane.com/




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

Date: 10 Jul 1998 19:03:33 GMT
From: rgarg@us.oracle.com.NOSPAM
Subject: Problem using perl5.004_04
Message-Id: <6o5oi5$n9d$1@inet16.us.oracle.com>


Hi,

	I'm not able to get perl5.004_04 run this simple program snippet:

#!/usr/local/bin/perl 
#
use Net::Ping;
 
print "'HOST' is alive and kicking\n" if pingecho('HOST', 10) ;

This bails out with these errors:

DynaLoader object version 1.03 does not match $DynaLoader::VERSION 1.00 at
/usr/local/lib/perl5/DynaLoader.pm line 58.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/Net/Ping.pm line 19.


This program used to work fine with perl5.000. 


Any hints how to fix it?
I tried using percompiled binaries from two different sources with similar
errors.


Thanks,

Raman


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

Date: Fri, 10 Jul 1998 20:22:24 GMT
From: "Khuong" <klai@hq.caci.com>
Subject: Re: Problem using perl5.004_04
Message-Id: <01bdac40$c0055020$35120a0a@Khuong.hq.caci.com>

recompile and reinstall DynaLoader module with perl 5.004 may fix the
problem

rgarg@us.oracle.com.NOSPAM wrote in article
<6o5oi5$n9d$1@inet16.us.oracle.com>...
> 
> Hi,
> 
> 	I'm not able to get perl5.004_04 run this simple program snippet:
> 
> #!/usr/local/bin/perl 
> #
> use Net::Ping;
>  
> print "'HOST' is alive and kicking\n" if pingecho('HOST', 10) ;
> 
> This bails out with these errors:
> 
> DynaLoader object version 1.03 does not match $DynaLoader::VERSION 1.00
at
> /usr/local/lib/perl5/DynaLoader.pm line 58.
> BEGIN failed--compilation aborted at /usr/local/lib/perl5/Net/Ping.pm
line 19.
> 
> 
> This program used to work fine with perl5.000. 
> 
> 
> Any hints how to fix it?
> I tried using percompiled binaries from two different sources with
similar
> errors.
> 
> 
> Thanks,
> 
> Raman
> 


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

Date: Fri, 10 Jul 1998 21:38:46 +0200
From: vibes@hipdrome.org (Jxrn-Morten Innselset)
Subject: Re: Proper locking of DBM files?
Message-Id: <MPG.10109a4651360f3989698@d2o201.telia.com>

In article <35A37CE3.3359@iil.intel.com>, sbekman@iil.intel.com says...

> It isn't. See the DB_File section in Camel . Should be like:

[snip]

Thanks. I hadn't noticed that section. I adjusted my code to the locking 
suggested by the Camel, and it _seems_ to work. I must admit that I am a 
bit surprised that proper DB-handling in Perl needs such "low level" 
coding as this.

-- 
"Don't be fooled. FreeBSD is UNIX, not a clone like Linux. FreeBSD or bust!"
<URL:http://home.telia.no/vibes/>


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

Date: 10 Jul 1998 19:54:07 GMT
From: dha@panix.com (David Adler)
Subject: Re: Putting CPAN on a CD:  good or not good?
Message-Id: <6o5rgv$bam@news1.panix.com>

On Fri, 10 Jul 1998 13:05:19 -0400, 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.

Well, good point.  But that would be true of *any* snapshot of CPAN,
or Perl itself, for that matter.  As long as it's prominently stated
that the snapshot is of a certain date and that you should always
check for the current versions, is it that big a problem?  I mean, the
only reason I can think of for someone using this is that they, for
some strange reason, have no other access to CPAN.

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

Perhaps there should be an addendum to the artistic license:
"...unless I feel otherwise" (kidding)

All in all, as long as it's done as an "as is" sorta thing, i.e. no
changes, notices intact... It doesn't strike me as that big a thing.
That said, there may be some weird copyright issue involved that I
don't know about (although I doubt it, but IDEPALOTV).  Also, you may
just not feel like it, for whatever reason.  But from a relatively
objective stand point, I don't see any compelling reason to exclude
your work from the project.

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Free Randal Schwartz!  <http://www.rahul.net/jeffrey/ovs/>


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

Date: Fri, 10 Jul 1998 16:47:22 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Putting CPAN on a CD:  good or not good?
Message-Id: <comdog-ya02408000R1007981647220001@news.panix.com>
Keywords: from just another new york perl hacker

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/>

Randal is free!  Rejoice!

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


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

Date: Fri, 10 Jul 1998 19:50:05 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: question about objects
Message-Id: <8csok98p06.fsf@gadget.cscaper.com>

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

Larry> Not content with the brevity of that form, I offer this:

Larry> sub quadrant {
Larry>    my $self = shift;
Larry>    (3, 4, 2, 1)[($self->x() >= 0) + 2 * ($self->y() >= 0))
Larry> }

Or, with some sideways coding....

    BEGIN {
	my $pi_over_2 = atan2(0,-1)/2;
	sub quadrant {
	    my $self = shift;
	    int(4+atan2($self->x, $self->y)/$pi_over_2) % 4 + 1;
	}
    }

:-)

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: Fri, 10 Jul 1998 19:31:07 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: redux, step 1 (was Re: new charter and moderator for comp.lang.perl.announce)
Message-Id: <8cww9l8pvr.fsf_-_@gadget.cscaper.com>

>>>>> "John" == John D Groenveld <groenvel@cse.psu.edu> writes:

John> The current charter is effective because it explicitly states
John> that announcements of new releases of Perl or its extensions
John> will accepted.

Right.  I can nearly do this in my sleep.  "Source or FAQ?" "NO, outta
here." "Source?  OK, see if it's free (click click click) yup, OK."
Like that.

John>  Proponents of a change in the charter want to include other
John> types of announcements. Why shouldn't we expect them to reach a
John> consensus of what other specific types will be accepted?

And so far, we've had various ins and outs.  Let me see if I can
redraw the discussion lines a bit so we can bring people out to hear
the whole arguments.

First:  commercial v. non-commercial --

1) Some people don't want commercial postings at all

2) Some (the majority?) wouldn't mind, and in fact want commercial
postings, but only when labled in a way they can killfile.

3) Some want commercial posts, and don't care if they're labled.

Let's say that the final charter will not address group 3 here.  Can
we agree if there are commercial posts, they will be labeled?

Second: Everything that comes along as long as it's well formatted,
vs. things that are only of interest to programmers?

a) Some people want no end-products, only building blocks or info

b) Some people want allcomers

c) Some people don't mind, as long as it's labled.  What, "[PRODUCT]"? :)

Can we assume that "a" and "c" are the majority here again, and
request the "b" people to just ignore the label?

So, that makes the two major issues I see to be:

commercial posts accepted? (if so, labled)
"non-programmer" posts accepted? (if so, labled)

Did I miss any other major issues?

Some minor issues:

Must be in CPAN, vs. can be anywhere, vs. should encourage CPAN
Books/Magazines/Columns? (Unless they're free, subject to commercial above)
Web sites? (And then how "perly" does it have to be?)
Job Postings?  Resumes?  (Cans of Worms? :)

John> It seems to me that the experts in Perl who would be in the best
John> position to act as King Soloman either already have a commercial
John> interest in Perl or inevitably end up with some. My
John> understanding is that Randal does not want to be in the position
John> to have to balance this conflict of interest. I assume other
John> Perl experts will have the same reasonable reservations. If they
John> don't, I think many readers will.

Right. I cannot see how thousands of readers of CLPA can fully trust
me to "do the right thing" about posting my own or a competitors
commercial product.  I don't want to ask for that level of trust
either.
 
John> I don't think moderating c.l.p.a should be a fulltime job. If
John> the charter is explicit in what will be accepted, it doesnt have
John> to be.

Yes, we really are talking about five minutes a day, unless you're
talking about the last two weeks. :)

print "Just another Perl newsgroup moderator,"

-- 
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: Fri, 10 Jul 1998 12:08:53 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: Scott Saddison <scotts@mdmgr.com>
Subject: Re: simple file grepping/searching question
Message-Id: <35A666C4.3E76B79@mcmahon.qal.berkeley.edu>

 ...and what's wrong with grep() for this task?

ap

Scott Saddison wrote:

> Hi, I know someone out there must have an easy way of doing this:
>
> I have a list of ids (@ids), and a list of files (@Files)
>
> I want to sort the list of files for the list of ids, if a files
> contains any of the ids in the id list to print it.
>
> I was looking for a file grep command in perl to search the files for an
> id without having to open it parse thru it.
>
> Thanks in advance
>
> Scott Saddison, scotts@mdmgrmw.com or scott@skyenet.net



--
-----------------------------------------------------------------
Andrew J Perrin - aperrin@igc.apc.org - NT/Unix/Access Consulting
255 S Rengstorff Ave #130, Mountain View, California 94040 USA
Phone:   650-938-4740 | http://socrates.berkeley.edu/~aperrin
E-mail wheres-andy@socrates.berkeley.edu to find me.
SEIU1199---------------------------------------------------------




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

Date: Fri, 10 Jul 1998 13:13:45 -0700
From: Allen Choy <achoy@us.oracle.com>
Subject: Weirdness in trying to extract year from localtime
Message-Id: <35A675F9.29324E54@us.oracle.com>

I'm having this weird occurence with extracting the year from localtime.

Here's the code:

1. $z = (split / /, localtime)[4];

However, there were times where

2. $z = (split / /, localtime)[5];

would get me the year, and 1) wouldn't, and visa-versa.

Anyone has a clue what's going on?

Thanks in advance,

Allen



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

Date: Fri, 10 Jul 1998 16:57:46 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <comdog-ya02408000R1007981657460001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35A675F9.29324E54@us.oracle.com>, Allen Choy <achoy@us.oracle.com> posted:

>I'm having this weird occurence with extracting the year from localtime.
>
>Here's the code:
>
>1. $z = (split / /, localtime)[4];

no idea what you are trying to do with that snippet.  why not just

   $year = (localtime)[5] + 1900;

? good luck :)

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


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

Date: Fri, 10 Jul 1998 13:45:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Weirdness in trying to extract year from localtime
Message-Id: <MPG.10101d3cd756a41b989701@nntp.hpl.hp.com>

In article <35A675F9.29324E54@us.oracle.com> on Fri, 10 Jul 1998 13:13:45 
-0700, Allen Choy <achoy@us.oracle.com> says...
> I'm having this weird occurence with extracting the year from localtime.
> 
> Here's the code:
> 
> 1. $z = (split / /, localtime)[4];
> 
> However, there were times where
> 
> 2. $z = (split / /, localtime)[5];
> 
> would get me the year, and 1) wouldn't, and visa-versa.

You should look again at the documentation for localtime.  What you have 
done is evaluate localtime in a scalar context, which yields a string, 
and then split its components into an array.  You can get the value you 
want directly as:

$z = 1900 + (localtime)[5];

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


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

Date: Fri, 10 Jul 1998 19:48:45 GMT
From: mad_ahmad@my-dejanews.com
Subject: Win32_gd module
Message-Id: <6o5r6u$5g0$1@nnrp1.dejanews.com>

Hi, does anyone who uses perl for win32 or the new ActivePerl from
Activestate,

does anyone have problems when trying to install the win32_GD module (its the
one that allows painting)
i can't seem to install it.  i've tried different kinds.
here's what i do (as the instructions say):
1. copy GD.pm into the lib directory.
2. create "GD" dir in "auto" dir (which is in "lib")
3. copy GD.pll into "GD" dir

It DOn't Work!!
i get parse error or something

#### also, for anyone whose tried activeperl, why are there two "lib"
directories in different places??

thanks,
AHmad

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


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

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

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