[10719] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4318 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 29 16:07:19 1998

Date: Sun, 29 Nov 98 13:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 29 Nov 1998     Volume: 8 Number: 4318

Today's topics:
    Re: Basic form handler for dropdown boxes? <garethr@cre.canon.co.uk>
        Controlling image display <gallery@jacana.demon.co.uk>
    Re: Handling the last line of a file differently (123) (Mike Stok)
        Help with this example anyone? <trent@jps.net>
    Re: Help with this example anyone? (Andrew M. Langmead)
    Re: Help with this example anyone? <due@murray.fordham.edu>
    Re: help-new <garethr@cre.canon.co.uk>
    Re: how to delete from i. to j. line in a file (Mike Stok)
    Re: How to: know in cgi who's logged when using htacces <r28629@email.sps.mot.com>
    Re: How to: Know who login using .htaccess in cgi <vertigan@iinet.net.au>
        Java Parser in Perl Anyone? (Thomas Quas)
    Re: Java Parser in Perl Anyone? <garethr@cre.canon.co.uk>
    Re: Java Parser in Perl Anyone? <rootbeer@teleport.com>
    Re: localtime () - perl's  bug ? <garethr@cre.canon.co.uk>
    Re: localtime () - perl's  bug ? <gellyfish@btinternet.com>
    Re: localtime () - perl's  bug ? (Larry Rosler)
    Re: localtime () - perl's  bug ? (Larry Rosler)
    Re: localtime () - perl's bug ? (Andrew M. Langmead)
    Re: localtime () - perl's bug ? (Andrew M. Langmead)
    Re: Makefile.PL problem - "make install" doesn't instal (Ken Williams)
    Re: Newbie: Search Engine (Matthias Wiehl)
        perlcc on Win NT paj1@my-dejanews.com
        test <vk@istnet.ru>
    Re: test <gellyfish@btinternet.com>
    Re: top list <r28629@email.sps.mot.com>
    Re: Where can I learn more about SQL with PERL? <garethr@cre.canon.co.uk>
    Re: Writing to password protected directory <sdenisov@chat.ru>
    Re: Y2K work - need suggestions <waidele@rol3.com>
    Re: Y2K work - need suggestions <krollj@worldnet.att.net>
    Re: Y2K work - need suggestions (Andrew M. Langmead)
    Re: Y2K work - need suggestions (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 29 Nov 1998 17:29:19 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: rob@teleprise.com
Subject: Re: Basic form handler for dropdown boxes?
Message-Id: <siu2zipfv4.fsf@cre.canon.co.uk>

[posted and e-mailed]

Rob <rob@teleprise.com> wrote:
> I'm looking for a basic form handler that will simply allow me to use
> dropdown boxes on a Web page to direct visitors to other pages on my
> site and elsewhere. It's a pretty common script: The user sees the
> names of the other pages, and by dropping down the list and pressing a
> submit button, goes off to the selected site.

This is nothing to do with Perl.  Your question would be more likely to
get a useful answer if posted to whichever of these newsgroups seems
most appopriate:

   comp.infosystems.www.authoring.html
   comp.infosystems.www.authoring.misc
   comp.infosystems.www.authoring.tools

In the meantime, you could try a simple solution using HTML plus
JavaScript, like this:

  <html><body><div align="center">
  <form onsubmit="location.href = go.options[go.selectedIndex].value;
		  return false;">
   <select name="go">
    <option value="http://www.perl.com/">PERL.COM</option>
    <option value="http://www.perl.org/">Perl Institute</option>
    <option value="http://language.perl.com/">Perl Language</option>
    <option value="http://www.perl.com/CPAN">CPAN</option>
   </select>
   <input type="submit" value=" Go ">
  </form></div></body></html>

-- 
Gareth Rees


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

Date: Sun, 29 Nov 1998 16:33:12 +0000
From: Godfrey Jackson <gallery@jacana.demon.co.uk>
Subject: Controlling image display
Message-Id: <rhjxXFAIdXY2Ew2f@jacana.demon.co.uk>

I have a perl subroutine that allows me to control the
security and display of jpg images. Recently I found
that it does not work with IE4. Netscape and IE3 are ok.

Are there any knowledgeable perl experts who could advise?
Please email me.

Code section
************
  if($imag =~ /art|wrk/) {$imag = &Read_Date($imag) }
  $imag = "A0" unless(-e "$data_dir/$imag\.jpg");

  if(open(IMAG, "$data_dir/$imag\.jpg")) {
    undef $/;
    binmode(IMAG);
    binmode(STDOUT);
    $bytes = (stat($img_file))[7];
    print "Content-type: image/jpg\n";
    print "Content-length: $bytes\n\n";
    while(<IMAG>) {print}
    $/ = "\n"; }
  else {
    print "Content-type: plain/text\n\n";
    print "No image found for $path\n"; }
************

Thanks,
-- 
Godfrey Jackson       Jacana Gallery of Contemporary Art
+44 (0)1954 251114    Jacana House, Rampton, Cambridge CB4 8QG, UK
                      Email : gallery@jacana.demon.co.uk
Visit the Gallery at  http://www.jacana.demon.co.uk/gallery


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

Date: 29 Nov 1998 16:44:06 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Handling the last line of a file differently (123)
Message-Id: <73rtkm$185@news-central.tiac.net>

In article <73qonj$47d$1@news.rain.org>, Nick Halloway <snowe@rain.org> wrote:
>How can I tell if it's the last line of a file, when reading 
>lines from it?  Thanks.

You might want to check out the supplied documentation for perl's eof
function which can tell you if the next read from a file handle will
return eof e.g.

  open( F, "/etc/passwd" ) || die "open failed ($!)\n";
  while (<F>) {
      print "Last line: $_" if eof;
  }

The docs (in particular the perlfunc manual page) mention a few things to
look out for while using eof.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Sun, 29 Nov 1998 10:48:47 -0800
From: Trent <trent@jps.net>
Subject: Help with this example anyone?
Message-Id: <3661970F.6EAB@jps.net>

Ok, Guru's it's probably painfully apparent to you, but I can't
the output to be modified as required in the foreach loop.

---It runs with no errors.
---$query gets found OK.
---$customerdata[25] is found and changed as directed.

The only problem is that the output file reflects no changes that were
made in the foreach loop. I have tested the output file with basic
changes
ie "substitution" to see if it is actually writing... it is. It just
won't
pay any attention to what's happening in the foreach loop.

Any idea's greatly appreciated.

(for the flamers- Yes, I've been to the Perl FAQ, Idiot's guide to CGI,
FMTEYEWTK, Nik Silver tutorials, my new Perl5 book, and every Perl site
I could find BEFORE asking here...)
 
______________________________
### Open file, read it then close.

	open(READ,$filename) || die "Can't open READ file for reading.\n";
	@lines = <READ>;
	close(READ);


### Make a modification to the contents.
	
	foreach $line(@lines) {
	
		@customerdata = (split(/\,/,$line));
		if ($customerdata[$datanumber] =~ /^$query$/i){
		$customerdata[25] =~ s/\w+/Sold/;
	
		}
	}


### Open it again for writing, and write new stuff.

	open(READ,">$filename") || die "Can't open READ file for output.\n";
	print READ @lines;
	close(READ);


_______________________________


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

Date: Sun, 29 Nov 1998 20:19:49 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Help with this example anyone?
Message-Id: <F379t1.3u3@world.std.com>

Trent <trent@jps.net> writes:

>	open(READ,$filename) || die "Can't open READ file for reading.\n";
>	@lines = <READ>;
>	close(READ);

You have a race condition here. Unless you flock() the files, two
simultaneous runs of this script will overwrite each others contents.


>	foreach $line(@lines) {

Here you are reading each line.
	
>		@customerdata = (split(/\,/,$line));

Here you are taking each line and making a *copy* of each chunk of
data in between each comma.

>		if ($customerdata[$datanumber] =~ /^$query$/i){

Here you are finding if a certain chunk of data matches some criteria.

>		$customerdata[25] =~ s/\w+/Sold/;

Here you are changing the *copy* of the data returned by split() to
the string "Sold". If doesn't affect the contents of $line. If the
25th field only contains one word, it would be more efficient to say
"$customerdata[25] = 'Sold'"

I think what you want next is something like:

 	$line = join ',', @customerdata;

so that your new data is reflected in the @lines array.
-- 
Andrew Langmead


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

Date: 29 Nov 1998 20:35:12 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Help with this example anyone?
Message-Id: <73sb60$er0$0@206.165.167.196>

Trent wrote in message <3661970F.6EAB@jps.net>...
>Ok, Guru's it's probably painfully apparent to you, but I can't
>the output to be modified as required in the foreach loop.
>---It runs with no errors.
>---$query gets found OK.
>---$customerdata[25] is found and changed as directed.
>The only problem is that the output file reflects no changes that were
>made in the foreach loop. I have tested the output file with basic
>changes
>ie "substitution" to see if it is actually writing... it is. It just
>won't
>pay any attention to what's happening in the foreach loop.
>Any idea's greatly appreciated.

>### Open file, read it then close.
>
> open(READ,$filename) || die "Can't open READ file for reading.\n";
> @lines = <READ>;
> close(READ);


You want to check that close too.

>### Make a modification to the contents.
>
> foreach $line(@lines) {
>
> @customerdata = (split(/\,/,$line));
> if ($customerdata[$datanumber] =~ /^$query$/i){
> $customerdata[25] =~ s/\w+/Sold/;
>
> }
> }

Now think about it, just because you split @lines doesn't mean changes you
make to $customerdata are also made to @lines.  @lines remains unchanged.
If you want to change @lines you need to modify it directly.

>
>### Open it again for writing, and write new stuff.
>
> open(READ,">$filename") || die "Can't open READ file for output.\n";
> print READ @lines;


So you are still printing out the original data here.

> close(READ);

Check those closes.

HTH

AmD

[emailed and posted]




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

Date: Sun, 29 Nov 1998 19:21:18 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: help-new
Message-Id: <sipva6paoh.fsf@cre.canon.co.uk>

Dianne Black <rainbowend@earthlink.net> wrote:
> I need to learn CGI and Perl for a project.  What is the best way?

Most Perl programmers learned by reading one or both of these books:

    Programming Perl
    Larry Wall, Tom Christiansen and Randal L. Schwartz
    ISBN 1-56592-149-6
    http://www.oreilly.com/catalog/pperl2/

    Learning Perl
    Randal L. Schwartz and Tom Christiansen
    ISBN 1-56592-284-0
    http://www.oreilly.com/catalog/lperl2/

A fair introduction to CGI, with a number of Perl examples, is

    CGI Programming on the World Wide Web
    Shishir Gundavaram
    ISBN 1-56592-168-2
    http://www.oreilly.com/catalog/cgi/

although of course you could just read the CGI specification at
http://hoohoo.ncsa.uiuc.edu/cgi/

A complementary appropach would be to enroll yourself on a Perl training
course; see http://reference.perl.com/query.cgi?courses for a list.

-- 
Gareth Rees


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

Date: 29 Nov 1998 16:49:30 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: how to delete from i. to j. line in a file
Message-Id: <73rtuq$1dg@news-central.tiac.net>

In article <slrn7628ns.13ng.romani_c@rzaix05.rrz.uni-hamburg.de>,
Cesar Romani <romani_c@mailcity.com> wrote:
>
>I haven't found anything about it in the FAQs.
>You can do it with sed, but with perl, how?
>I'd like to delete, for example, from the 3. line to the 10. line in a file
>or from the 3. line to a line, which contains /pattern/.
>many thanks in advance.

You might want to check out the documentation for .. in perlop.  One thing
to try might be

  perl -ni.bak -e 'print unless 3 .. /pattern/' file

The perlrun manual pace will describe the command line options, the perlop
manual page the .. 

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Sun, 29 Nov 1998 10:39:35 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: "Citimidia Internet" <admin@citemedia.com>
Subject: Re: How to: know in cgi who's logged when using htaccess
Message-Id: <36616AB1.16C53E8E@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Citimidia Internet wrote:
> 
> Hi!
> 
> I permited some users to log into a specific directory using .htaccess.
> When they are logged, how can I determine who log in to reuse the
> username and
> the password in my cgi script?
> 
> Maybe not so complicated!
> 
> Thank for any help
> 
> CIAO EVERYONE!
> 
> Sylvain

First, you posted the same message four (4) times in a row. Reasons being?

Second, this is really _not_ a perl question, though some people would nice
enough to provide you will advices. You should try posting at the cgi ng like: 
      comp.infosystems.www.authoring.cgi

HTH.

-TK


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

Date: Sun, 29 Nov 1998 16:36:10 GMT
From: Steve Vertigan <vertigan@iinet.net.au>
Subject: Re: How to: Know who login using .htaccess in cgi
Message-Id: <366177a2.51333304@news.iinet.net.au>

news@discovery.demon (Jan) wrote thus:

>$ENV{'REMOTE_USER'} holds the username, I think the password can't be
>determined. Anyone?

Not with vanilla CGI but I think it can be done using PHP.  Of course what
any of this has to do with Perl is anyones guess.

--Steve


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

Date: 29 Nov 1998 17:24:41 GMT
From: tom@ant.rz.fh-augsburg.de (Thomas Quas)
Subject: Java Parser in Perl Anyone?
Message-Id: <73s00p$kop$1@av2.rz.fh-augsburg.de>

Hi folks --

I'm looking for a Java parser, preferably written in perl. I'd appreciate any
links.


Thanks, tom
--
thomas quas            | "The difference between theory and practice is
tom@rz.fh-augsburg.de  |  in theory somewhat smaller than in practice."


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

Date: Sun, 29 Nov 1998 18:38:31 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: Java Parser in Perl Anyone?
Message-Id: <sir9umpcns.fsf@cre.canon.co.uk>

Thomas Quas <tom@ant.rz.fh-augsburg.de> wrote:
> I'm looking for a Java parser, preferably written in perl

Try building one yourself from these tools:

    Dmitri Bronnikov' lex/yacc grammar for Java
    http://home.inreach.com/bronikov/grammars/java.html

    Philippe Verdret's Parse::Lex module
    http://www.perl.com/CPAN/modules/by-module/Parse/

    Francois Desarmenien's Parse::Yapp module
    http://www.perl.com/CPAN/modules/by-module/Parse/

-- 
Gareth Rees


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

Date: Sun, 29 Nov 1998 20:54:08 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Java Parser in Perl Anyone?
Message-Id: <Pine.GSO.4.02A.9811291253530.24635-100000@user2.teleport.com>

On 29 Nov 1998, Thomas Quas wrote:

> I'm looking for a Java parser, preferably written in perl. 

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sun, 29 Nov 1998 15:59:42 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <sizp9apk0h.fsf@cre.canon.co.uk>

[Posted to comp.lang.perl.misc and copy mailed.]

Larry Rosler wrote:
> sprintf('%.2d.%.2d.%.2d', $year % 100, $mon + 1, $mday), 

Gareth Rees wrote:
> This look like a bug to me.  It prints "98.11.29", but the current year
> is 1998, not 98.

Larry Rosler wrote:
> In the Jewish calendar, the current year is named 5769, commonly 
> referred to as 769, but neither of those *is* the current year, merely a 
> representation of its name.  Similarly, 1998 is not the current year, 
> nor is 98 -- they are merely representations of its name.

You make my point more eloquently than I could make it myself.  Year
2000 bugs arise from choosing a naming system where a name can refer to
more than one year.

In the $year % 100 naming scheme, the name "98" refers to any of the
years named ..., 1898, 1998, 2098, ... in the (extended) Gregorian
calendar.  Determining which year is represented by the name "98" is in
general impossible, which is why programs using the system are buggy.

-- 
Gareth Rees


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

Date: 29 Nov 1998 16:25:07 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: localtime () - perl's  bug ?
Message-Id: <73rsh3$bv$1@gellyfish.btinternet.com>

On Sun, 29 Nov 1998 14:16:34 GMT Gareth Rees <garethr@cre.canon.co.uk> wrote:
> Larry Rosler <lr@hpl.hp.com> wrote:
>> sprintf('%.2d.%.2d.%.2d', $year % 100, $mon + 1, $mday), 
> 
> This look like a bug to me.  It prints "98.11.29", but the current year
> is 1998, not 98.
> 

Thats not a bug thats a deliberate design decision ;-P

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Sun, 29 Nov 1998 09:40:32 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <MPG.10cb26eb5ffc7c72989933@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <sizp9apk0h.fsf@cre.canon.co.uk> on Sun, 29 Nov 1998 15:59:42 
GMT, Gareth Rees <garethr@cre.canon.co.uk> says...
> > This look like a bug to me.  It prints "98.11.29", but the current year
> > is 1998, not 98.
> 
> Larry Rosler wrote:
> > In the Jewish calendar, the current year is named 5769, commonly 
> > referred to as 769, but neither of those *is* the current year, merely a 
> > representation of its name.  Similarly, 1998 is not the current year, 
> > nor is 98 -- they are merely representations of its name.
> 
> You make my point more eloquently than I could make it myself.  Year
> 2000 bugs arise from choosing a naming system where a name can refer to
> more than one year.
> 
> In the $year % 100 naming scheme, the name "98" refers to any of the
> years named ..., 1898, 1998, 2098, ... in the (extended) Gregorian
> calendar.  Determining which year is represented by the name "98" is in
> general impossible, which is why programs using the system are buggy.

Two-word answer:    CONTEXT    CONVENTION

Longer answer:  Now you are confusing internal representation with 
external representation.  This is the ultimate source of the socalled 
Y2K bug.  Programmers relied on the CONTEXT of the problem domain to 
supply the century, which is commonly omitted by CONVENTION.  They 
assumed that the internal representation of the year as two digits would 
be disambiguated by CONTEXT over the useful life of the program.

(Note that this is by and large still the case.  The bugs arise from 
faulty calculations of the *interval* between two times, where the 
program fails to supply the disambuguating CONTEXT correctly or at all!)

The CONTEXT of most problem domains is in fact severely bounded, so the 
two-digit year CONVENTION for external representation is robustly 
unambiguous.  In any case, the internal representation must be 
appropriately unambiguous.

To put this in a Perl context -- the disambiguation:

    $year = ($year % 100 > 69 ? 1900 : 2000) + $year % 100
        if $year < 1970;

works fine for any program that relies on the Unix epoch for internal 
date/time representation.  Programs which work in a historical or 
astronomical CONTEXT must rely on a different internal date 
representation, with different CONVENTIONs for external representation -
- be they BCE/CE years or MYBP (Millions of Years Before the Present).

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


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

Date: Sun, 29 Nov 1998 10:53:38 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <MPG.10cb380cd6818411989934@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <73rsh3$bv$1@gellyfish.btinternet.com> on 29 Nov 1998 
16:25:07 -0000, Jonathan Stowe <gellyfish@btinternet.com> says...
> On Sun, 29 Nov 1998 14:16:34 GMT Gareth Rees <garethr@cre.canon.co.uk> wrote:
> > Larry Rosler <lr@hpl.hp.com> wrote:
> >> sprintf('%.2d.%.2d.%.2d', $year % 100, $mon + 1, $mday), 
> > 
> > This look like a bug to me.  It prints "98.11.29", but the current year
> > is 1998, not 98.
> 
> Thats not a bug thats a deliberate design decision ;-P

What means the emoticon?  You are right on!  It took me many more words 
to say the same thing.

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


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

Date: Sun, 29 Nov 1998 17:21:28 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: localtime () - perl's bug ?
Message-Id: <F371Js.7GD@world.std.com>

"Sean Mintz" <stmintz@yahoo.com> writes:

>sub date_pad
>{

Sean, have you ever seen Perl's sprintf() function? 

Do you know what the year field of the list returned from localtime is
in the year 2000? (Hint: Its not 2000, and its not 00)

Don't you worry about those "variable only used once" warnings when
you run the script with the "-w" flag?

(Do you run your scripts with the "-w" flag?)


sub get_date_string {
 my $timestamp = shift;

 ($sec, $min, $hour, $mday, $mon, $year) = (localtime $timestamp)[0 .. 5];

 return sprintf("%02d.%02d.%02d", $year % 100, $mon + 1 , $mday), 
        sprintf("%02d:%02d:%02d", $hour, $min, $sec);
}

-- 
Andrew Langmead


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

Date: Sun, 29 Nov 1998 18:45:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: localtime () - perl's bug ?
Message-Id: <F375G8.Epr@world.std.com>

Gareth Rees <garethr@cre.canon.co.uk> writes:

>You make my point more eloquently than I could make it myself.  Year
>2000 bugs arise from choosing a naming system where a name can refer to
>more than one year.

No, year 2000 bugs arise from performing arithmetic on dates where the
date is not in a format to support calculations in the range needed.

I have some software that I wrote for my current company about 8 years
ago. It tracks data that will occur in the future. Once the day
specified passes, the data is no longer valid. The data is tagged with
a two digit year, but there is no Y2K problem. No calculations are
done to compare two pieces and find which is the greater or lesser
piece. The only calculation that is done is whether the month,
day-of-month, and the last two digits of the year match the values for
*today*.

It works now. It will continue to work for years. Its not worth
spending the time to change it.
-- 
Andrew Langmead


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

Date: Sun, 29 Nov 1998 13:05:30 -0600
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Makefile.PL problem - "make install" doesn't install
Message-Id: <ken-2911981305300001@min-mn6-04.ix.netcom.com>

In article <ken-2911980122120001@min-mn4-15.ix.netcom.com>,
ken@forum.swarthmore.edu (Ken Williams) wrote:
>
>I've had a few people tell me that with version 0.05 of my Apache::Filter
>module (in CPAN), "make install" doesn't copy the module to the perl lib
>directory.  I can't figure out why not - it works for me.  


Andreas helped me with the answer - I was distributing the pm_to_blib
file.  I added it to MANIFEST.SKIP, and things should work fine now.


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

Date: 29 Nov 1998 15:50:03 GMT
From: hp-katalog@t-online.de (Matthias Wiehl)
Subject: Re: Newbie: Search Engine
Message-Id: <73rqfb$meo$1@news00.btx.dtag.de>

Many, many thanks to Tad and Birgitt for your kind and detailed
responses!  I'll ask for solutions to my problem in the CGI group you
suggested.

Matthias
-- 
"Homepages bei T-Online" - http://home.t-online.de/home/hp-katalog/
eMail: hp-katalog@t-online.de Feedback: Sebastian.Boehm@t-online.de


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

Date: Sun, 29 Nov 1998 16:44:55 GMT
From: paj1@my-dejanews.com
Subject: perlcc on Win NT
Message-Id: <73rtm5$buv$1@nnrp1.dejanews.com>

Hi,

I am trying to build a perl program into a Win32 .exe file which includes the
Perl interpreter. This is to make downloading it off my website easy for non-
programmers.

I am doing this using PerlCC (part of Perl5.005_02) on WinNT. I've had to hack
at the build script somewhat to make it work, but it now builds an executable.

However, whenever the program tries to access @ARGV, I just get "Modification
of a read-only value attempted." and the program stops.

Has anyone else experienced this? Has anyone successfully made such an
executable on NT?

Thanks,

Paul
--
paj@datcon.co.uk           http://cw.oaktree.co.uk/
    Any opinions expressed are personal and not
     necessarily representative of my employer

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 29 Nov 1998 18:56:21 +0300
From: "vk" <vk@istnet.ru>
Subject: test
Message-Id: <36616eab.0@news.istnet.ru>

test




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

Date: 29 Nov 1998 16:56:41 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: test
Message-Id: <73ruc9$ds$1@gellyfish.btinternet.com>

On Sun, 29 Nov 1998 18:56:21 +0300 vk <vk@istnet.ru> wrote:
> test
> 

Of course you meant it to be posted to alt.test

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Sun, 29 Nov 1998 10:45:39 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Sean Mintz <stmintz@yahoo.com>
Subject: Re: top list
Message-Id: <36616C1D.546FA193@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Sean Mintz wrote:
> 
> hi
> 
> I am trying to make a top list (like top-ten top-twenty etc)
> I have tried many ways to do it, but i am not successfuly.
> 
> Here's what the stuff to be in order looks like:
> 
> Barbarossa 1264
> Galoob 1156
> 
> I need it to make a file that puts the numbers in order from
> greatest to least. Like 10 9 8 7 6 5 4 3 2 1.
> 
> If you have any code or help you can offer me, please help ! :)

Perhaps you could show what you have got so far, then maybe someone can help.

-TK


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

Date: Sun, 29 Nov 1998 16:31:30 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: Oliver Moffat <oliverm@bway.net>
Subject: Re: Where can I learn more about SQL with PERL?
Message-Id: <siww4epijh.fsf@cre.canon.co.uk>

[posted and e-mailed]

Oliver Moffat <oliverm@bway.net> wrote:
> I've heard about MSQL, MySQL, PostGreSQL and the others, but, frankly,
> I don't get it.  Where can I learn more about SQL?

Of course, this is nothing to do with Perl.  Try whichever of the
following newsgroups seems most appropriate:

   comp.databases			Databases in general
   comp.infosystems.www.databases	Using databases with web servers

In the meantime, here's some info to get you started:

SQL is a language for interacting with a relational database management
system (RDBMS).  SQL is an ISO standard (ISO 9075:1992, known informally
as "SQL-92").  The name derives from a 1974 IBM project called "SEQUEL"
("Structured English Query Language").

See http://www.jcc.com/sql_stnd.html for more information on SQL
standards.  A good book on the subject is

    S J Cannan and G A M Otten
    SQL - the standard handbook
    McGraw-Hill
    ISBN 0-07-707664-8

If you want to install and use a RDBMS with SQL capability, two good
ones to start with (both free for non-commercial use) are:

    mSQL (Mini SQL)
    http://www.hughes.com.au/

    MySQL
    http://www.mysql.org/

mSQL is a bit simpler to use; MySQL has more features and a better
implementation of SQL.  Having installed one of these, to access it from
Perl, you'll need to install the following two packages from CPAN:

    DBI (Database independent interface for Perl)
    http://www.perl.com/CPAN/modules/by-category/07_Database_Interfaces/DBI
    http://www.hermetica.com/technologia/perl/DBI/

    Msql-Mysql-modules (mSQL and mysql drivers for DBI)
    http://www.perl.com/CPAN/modules/by-category/07_Database_Interfaces/Msql

-- 
Gareth Rees


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

Date: Sun, 29 Nov 1998 20:03:43 +0300
From: "Sergey Denisov" <sdenisov@chat.ru>
Subject: Re: Writing to password protected directory
Message-Id: <73ruoa$eps$1@dragon.infopro.spb.su>


brian d foy ohxer b qnnayemhh ...
>In article <73psvg$l6v$1@dragon.infopro.spb.su>, "Sergey Denisov"
<sdenisov@chat.ru> posted:
>
>> May be someone knows, how can I create and write to files in password
>> protected directory on my server. And is it truly, that I can freely read
>> from files in this protected directory without any password ?
>
>which operating system are you using?
>
>if i were wondering this, i would just try it.  if you can, you can :)


Thanks for interest, brian.
I'm newbie in CGI & Perl, so I think, my question is simple enough.
The problem is : I have a WWW server. It hosted by some system from Unix
clone. (I don't know exactly). I have a directory, let's say, /orders, where
should be placed some private files. I'd like, that users couldn't have
access to directory without password. But also I'd like to have a read/write
access to this directory from my Perl programs. The question is : what
should I write in Perl 5.004 to read or write to any file in password
protected directory on my server.
    And forget, please, about my second question :    " And is it truly,
that I can freely read from files in this protected directory without any
password ?". It's dumb thing.

Regards, Sergey.
sdenisov@chat.ru




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

Date: Sun, 29 Nov 1998 16:40:28 +0100
From: "Stefan Waidele" <waidele@rol3.com>
Subject: Re: Y2K work - need suggestions
Message-Id: <3661709c.0@hebel.rol3.com>


Citizen Joe schrieb in Nachricht <73nbo0$po7$1@ns2.foothill.net>...
>...
>We have about 300 HPUX servers. There are 150 known components. There could

>...
>Here is where the problem is.  The script takes too long to execute.  It
>takes about 10 seconds for each component and I just can't figure out a way
>to get around that. 10 seconds x 150 components x 300 machines = 450000
>seconds to check all the components on all the machines or 125 hours, when
>I am done.

>...

Sorry, I do not want to be a smartass, but this is how I read Your article
You have 300 servers, let alone the 1000s of clients.
You have a major problem (Y2K)
You have one year, 32 days to solve it, that's almost 10000 hours

Why don't You spare one machine for 5 days to solve it. Brute de force! The
is no award for elegance.

Modify Your script so that You can push a PAUSE button, so You can work on
the box during Your office hours and continue to run the script at night or
over the weekend.

If I am too far off from Your world to understand the situation just ignore
my stand-alone-PC-point-of-view.

Good luck to You,

Stefan




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

Date: 29 Nov 1998 17:08:36 GMT
From: John Kroll <krollj@worldnet.att.net>
Subject: Re: Y2K work - need suggestions
Message-Id: <36617EA7.A81F425E@worldnet.att.net>

Citizen Joe schrieb in Nachricht <73nbo0$po7$1@ns2.foothill.net>...> 

<< snipped >>

> First of all, most components are not even Y2K sensitive since they do not
> involve date. Examples are Perl and Emacs.

Before you say that perl scripts are not Y2K sensitive, remember that
perl is a programming language.  While there is nothing in perl that
will break on 1 Jan 2000, there is nothing preventing a programmer 
from writing a perl script that breaks or produces bad output.
A common example is the year field produced from perl's localtime
function.  If you don't look, I would expect to see a number of 
reports with dates formatted like: "01/01/100".

<< snipped >>
 
> My job is to list all of components, including the critical ones and report
> the compliance status.

In addition to your script, I assume you have done the system adminish
thing and have identified all the HP-UX patches you will need to 
make the OS components Y2K compliant?  Remember that HP-UX 9.xx is 
not going to be made Y2K compliant, and HP-UX 10.20 requires quite
a few patches to make it Y2K compliant.


<< snipped >>

> Here is where the problem is.  The script takes too long to execute.  It
> takes about 10 seconds for each component and I just can't figure out a way
> to get around that. 10 seconds x 150 components x 300 machines = 450000
> seconds to check all the components on all the machines or 125 hours, when
> I am done.

Is there any reason why you can't run all the machines in parallel?
Then its 10 seconds to launch all the remote shells, then 10 seconds *
150 components, or about half an hour.  If your scanning program
emails its output back to you, its something the machines can run on
Sunday afternoon and you can look through the results on Monday.

<< snipped >>


> Please post your suggestions.


My 0.02 worth,
John Kroll


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

Date: Sun, 29 Nov 1998 17:35:12 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Y2K work - need suggestions
Message-Id: <F3726p.Btn@world.std.com>

Citizen Joe <no@spam.org> writes:

>It has occured to me that maybe my program is slow because there is a lot
>of reads and writes to a disk, not because of remsh. My directory tree is
>organized this way:

Have you seen the perl profiling tool?
<URL:http://reference.perl.com/module.cgi?Devel::DProf> it might give
you a better idea of where your program is spending its time.

If your program is spending too much time in calling remsh, is there
some possiblity that you could group all of the calls to remsh for the
same machine into one call? Instead of 

>$command=`remsh $box "/usr/local/bin/component -v"`;

something like:

$command= `remsh $box "/usr/local/bin/component1 -v;/usr/bin/component2 -v"`;
-- 
Andrew Langmead


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

Date: Sun, 29 Nov 1998 17:44:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Y2K work - need suggestions
Message-Id: <366287c9.16963037@news.skynet.be>

John Kroll wrote:

> If you don't look, I would expect to see a number of 
>reports with dates formatted like: "01/01/100".

I don't think so. There probably won't be that many reports being
generated on New Years Day.

 :-)

	Bart.


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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