[17391] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4813 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 5 11:05:40 2000

Date: Sun, 5 Nov 2000 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973440309-v9-i4813@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 5 Nov 2000     Volume: 9 Number: 4813

Today's topics:
    Re: About to slit my own throat (Tim Hammerquist)
    Re: About to slit my own throat (Martien Verbruggen)
        Array of Hash <giuffridaj@netzero.net>
    Re: Building a Module on Server without Install.pm <flavell@mail.cern.ch>
    Re: Building a Module on Server without Install.pm (Ameen Dausha)
    Re: Building a Module on Server without Install.pm (Ameen Dausha)
    Re: Building a Module on Server without Install.pm (Martien Verbruggen)
        CGIsite / Time problem <mailme@shadownet.net>
    Re: CGIsite / Time problem <bcaligari@my-deja.com>
    Re: CGIsite / Time problem (Martien Verbruggen)
    Re: CGIsite / Time problem (Mark-Jason Dominus)
    Re: Hardwood Website <wojcik@genjerdan.com>
        How Do I? <phil.singer@virgin.net>
    Re: How Do I? (Gwyn Judd)
    Re: How Do I? (Martien Verbruggen)
    Re: How Do I? (Mark-Jason Dominus)
    Re: How Do I? <flavell@mail.cern.ch>
        how to make $ARGV[0] numeric <ddijk@hetnet.nl>
    Re: how to sort corresponding arrays? (Mark-Jason Dominus)
    Re: i'm new. will someone direct me? <dale@emmons.dontspamme.com>
        Javadoc for Perl? <SCook@pobox.com>
    Re: Javadoc for Perl? (Robert Hallgren)
    Re: Newbie question <harrisr@bignet.net>
        Perl CGI won't fork with mod_perl in Apache <draxus@dragonsrealm.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 05 Nov 2000 12:40:32 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: About to slit my own throat
Message-Id: <slrn90am86.on2.tim@degree.ath.cx>

Anthony <apsaffer@hotmail.com> wrote:
 [ snipped code ]
> CGI::Carp qw(fatalsToBrowser);
 [ snipped code ]

I didn't notice this mentioned anywhere else (maybe I lost it in all the
"this can produce spam!" flames), but did you plan on 'use'ing the
CGI::Carp module?  Or just make a reference to it?

-- 
-Tim Hammerquist <timmy@cpan.org>
American society is a sort of flat, fresh-water pond which absorbs
silently, without reaction, anything which is thrown into it.
	-- Henry Brooks Adams


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

Date: Mon, 6 Nov 2000 00:35:25 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: About to slit my own throat
Message-Id: <slrn90aogs.567.mgjv@martien.heliotrope.home>

On Sat, 04 Nov 2000 22:02:34 GMT,
    Anthony <apsaffer@hotmail.com> wrote:

Some of these things have already been said by others. I'll repeat them
nonetheless. None of the code submitted has been tested. It was simply
too much work to create a form, and the whole f-doodledoo. Don't take
this as code you can copy, but as hints to what you could to to improve
the program.

> #!/usr/local/bin/perl

#!/usr/local/bin/perl -T
use warnings;
use strict;

> # Anonymous Mailer Script
> # Written By Anthony Saffer

# $Id$

> CGI::Carp qw(fatalsToBrowser);

use CGI ':standard';
use CGI::Carp 'fatalsToBrowser';

> $mail_prog = '/usr/lib/sendmail' ;
> 
> $Mail_To = $field{'Mail_To'} ;     
> $Mail_From = $field{'Mail_From'} ;     
> $Mail_Subject = $field{'Mail_Subject'} ;   
> $Message_Text = $field{'Message_Text'} ;   
> $B1 = $field{'B1'} ;   
> $B2 = $field{'B2'} ;   

B1 and B2 are never used.

my %check = (
    Mail_From => 8,
    Mail_Subject => 128,
    Message_Text => 0xfff, # 4 kb is more than enough
);

my @message;
for my $field (keys %check)
{
    push @message, "$field is too long"
        if (length(param($field)) > $check{$field})
}

die @message if @message;

> if (length($Mail_Subject) > 1297250159) {

insane number. Why do you allow a subject that long? You migth as well
not check, because I don't even believe that any HTTP client-server
communication would support this.

> $recip = $Mail_To ;

You may need to check some of the input to make sure it doesn't contain
anything ugly. All user input is tainted. You're not really passing
anything off in ways that Perl sees as dangerous, but you should maybe
be careful anyway/

> open (MAIL, "|$mail_prog -t");

open (MAIL, "|$mail_prog -t") or die "Cannot open pipe to $mail_prog: $!";

> print MAIL "To: $recip\n";
> print MAIL "Reply-to: $Mail_From\n";

print MAIL <<EOM;
To: @{[param('Mail-To')]}
 ...
 ...

@{[param('Message_Text')]}

EOM

Or

print MAIL
    'To: ', param('Mail-To'), "\n",
    'From: ', param('Mail-From'), "\n",
    ...
    "\n",
    param('Message_Text'),
    "-- \n",
    $disclaimer;

# Always check the result of a close when writing to a pipe
#
close(MAIL) or die "Problems with mail: $!";

> print MAIL "---\n" ;

Normally a signature follows a line with two dashes, followed by a space
and a newline. See above.

print header, html_start, 'Done', html_end;

If nothing else, you'll end up with a more maintainable, and much more
readable program.

Don't use cargo-cult CGI form processing stuff. Just use CGI.pm.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                  | 


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

Date: Sun, 5 Nov 2000 08:27:06 -0500
From: "Joe Giuffrida" <giuffridaj@netzero.net>
Subject: Array of Hash
Message-Id: <t0ankt5niedm1f@corp.supernews.com>

I am trying to write an extension interfacing to a C library and one of the
functions returns and array of pointers to a struct and I want to return it
as an array of hash and I have no idea how to do this.  Could someone help
me get started ?

-Joe




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

Date: Sun, 5 Nov 2000 03:04:20 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Building a Module on Server without Install.pm
Message-Id: <Pine.GHP.4.21.0011050247380.4890-100000@hpplus03.cern.ch>

On Sun, 5 Nov 2000, Martien Verbruggen wrote:

> On Sun, 05 Nov 2000 00:44:26 GMT,
> 	MNJP <not.my.real.email@bellglobal.com> wrote:
> 
> [rewrapped and reformatted article to make it a bit more readable]

You know, Martien, in the course of the past 24 hours I found myself
three times starting to compose a response to three different pieces
of nonsense from this MNJP, and then abandoning it because it didn't
seem worth the bother - because there simply was no "class" in the
postings, and I decided to rely on the well-recognised upside-down
quotage as sufficient warning to anyone who might get misled.

> > I guess I do fall under the category "know what you're doing and doing it
> > correctly" 

Well we haven't seen any production code, but the garbage that has
been offered to others shows that didactic skills, at least, are
lacking...

> > Sine I have developed online banking commerce systems, web
> > portals, a webmail system from the ground-up, and much more.

Yeah, I've seen plenty of commercial systems that suck. 

"Web portals", indeed.

> The problem stays the same. You're giving people a piece of cargo cult
> that they can use, which will bite them unless they know what they're
> doing.

Absolutely...

> Besides that, if you aim to impress with that list, you fail. Many
> things have been implemented in this world, and are highly successful,
> commercially, without impressing me one single bit.

I'm afraid that history shows that technologically advanced solutions
can't win.  The customers understand brute force much better than they
understand the right answer. 

> > I will repeat it: In *MY* experience I have never had the need for that
> > library. I grab what's passed to me using this sub I provided and the rest
> > is up to my program (and let me assure you I have done some pretty clever
> > things with "the rest")

I'd be interested to see what "pretty clever things" the hackers would
do with the rest.  You're familiar with CA-2000-02 of course?

Martien:
> You don't know what I do, who I am, or what my qualifications are. 

I don't either, but your advice speaks for itself, and I'd take it
any day in preference to the posturing of this anonymous creature.



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

Date: Sun, 05 Nov 2000 02:51:02 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: Building a Module on Server without Install.pm
Message-Id: <3a04ca92.171597914@news>

For what it's worth, I am a bit more than an unskilled user. :-) I use
CGI.pm at work all the time which is why I keep pushing my web host to
follow suit. I'm trying to web a database, and now that I've got the
CGI.pm working I'll be able to keep on trucking. :-)



On Sun, 5 Nov 2000 12:11:45 +1100, mgjv@tradingpost.com.au (Martien
Verbruggen) spat:

>On Sun, 05 Nov 2000 00:44:26 GMT,
>	MNJP <not.my.real.email@bellglobal.com> wrote:
>
>[rewrapped and reformatted article to make it a bit more readable]
>
>> "Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
>> news:slrn909a0p.ac5.mgjv@martien.heliotrope.home...
>> > On Sat, 04 Nov 2000 20:57:53 GMT,
>> > MNJP <not.my.real.email@bellglobal.com> wrote:
>> > >
>> > > Just include the following sub into your program, call it in the
>> > > beginning, and you'll have all the variables passed from the
>> > > browser in the hash %FORM.  It works for me every single time.
>> >
>> > Oh, puhleeze. Not another cargo-cult solution.
>> >
>> > Search this newsgroups for reasons not to do this. Unless you know what
>> > you're doing, and you can do it _correctly_ don't. Unless you only have
>> > some trivial stuff to do, don't do this.
>> 
>> I guess I do fall under the category "know what you're doing and doing it
>> correctly" Sine I have developed online banking commerce systems, web
>> portals, a webmail system from the ground-up, and much more.
>
>The problem stays the same. You're giving people a piece of cargo cult
>that they can use, which will bite them unless they know what they're
>doing. They most likely don't know what they are doing.
>
>Besides that, if you aim to impress with that list, you fail. Many
>things have been implemented in this world, and are highly successful,
>commercially, without impressing me one single bit. The three things
>above may sound nice on a resume, and they contain all the hip and
>web-savvy keywords, but tat doesn't mean a thing. The code matters, and
>that's what could impress me. 
>
>> I will repeat it: In *MY* experience I have never had the need for that
>> library. I grab what's passed to me using this sub I provided and the rest
>> is up to my program (and let me assure you I have done some pretty clever
>> things with "the rest")
>
>Your experience is much more limited than the experience of the total
>userbase of CGI.pm.
>
>> I guess these are the differences between a senior developer and a systems
>> administrator.
>
>You don't know what I do, who I am, or what my qualifications are. Don't
>assume you do because you read a signature that is randomly generated
>from a larger set.
>
>Do you always respond to slight criticisms -- and a fairly standard one
>on this group at that -- by slinging out your private parts for size
>comparison?
>
>> > Besides that, your 'solution' doesn't even start scratching at the
>> > surface of all the things CGI.pm does.
>> >
>> > The OP asked for CGI.pm. You offer the OP about 0.03% of the
>> > functionality of that module, incorrectly implemented, and you expect
>> > that to be ok?
>
>And you forgot to say anything about this. I'll repeat it. The OP asked
>for CGI.pm. Maybe they wanted the cookie stuff, or the persistency
>stuff. Maybe they wanted to use it to generate HTML (which is what I
>often use it for). Maybe they didn't really feel like doing any of the
>stuff that CGI.pm does themselves, just like I don't think it's
>interesting to implement that stuff myself any more. Been there, done
>that.
>
>Martien
>-- 
>Martien Verbruggen              | 
>Interactive Media Division      | 
>Commercial Dynamics Pty. Ltd.   | What's another word for Thesaurus?
>NSW, Australia                  | 



Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"


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

Date: Sun, 05 Nov 2000 02:52:43 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: Building a Module on Server without Install.pm
Message-Id: <3a04cb30.171756020@news>

[self snip]

Guys! Thanks for your suggestions I installed install.pm and then
cgi.pm and am continuing on as needed. :-) I appreciate your help and
advice.



Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"


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

Date: Sun, 5 Nov 2000 14:17:36 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Building a Module on Server without Install.pm
Message-Id: <slrn909kag.2ia.mgjv@martien.heliotrope.home>

[Please, in the future, post your replies _after_ the suitably trimmed
text you reply to. It makes your article, and followups, easier to read,
and follows the accepted convention on this group and Usenet in general]

On Sun, 05 Nov 2000 02:51:02 GMT,
	Ameen Dausha <ameen@dausha.net> wrote:
> For what it's worth, I am a bit more than an unskilled user. :-) I use
> CGI.pm at work all the time which is why I keep pushing my web host to
> follow suit. I'm trying to web a database, and now that I've got the
> CGI.pm working I'll be able to keep on trucking. :-)

I'm glad you got it installed and working.

You should maybe inform your ISP that what they're doing is really
silly. They can't stop you from installing and using Perl modules, they
just make their user's life hard, which means they get ticked off, and
are more likely to move their business somewhere else.

If they don't want you to install modules, they shouldn't let you
install ANY code. modules are part of a code base, and if they think
otherwise, they just haven't understood how it works. It is better for
them if they install standard modules like these, because they can
encourage users to use these things in their scripts, which means they
all share the same codebase, version and binaries. They are less likely
to cause security problems.

I could include the full code of CGI.pm in every single script, and it
would work. Your ISP wouldn't have any troubles with that, because I'm
not installing any modules. But it makes no sense.

An ISP has several possibilities to limit what code users can run, but
this is simply silly, unacceptable, and shows a lack of willingness to
provide service, and a lack of understanding on how this thing works.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Freudian slip: when you say one
Commercial Dynamics Pty. Ltd.   | thing but mean your mother.
NSW, Australia                  | 


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

Date: Sun, 5 Nov 2000 10:47:44 +0100
From: "[AGUT] Shadow Code" <mailme@shadownet.net>
Subject: CGIsite / Time problem
Message-Id: <8u3ab9$26v$1@porthos.nl.uu.net>

Hi,
Does anyone know a good site where I can find help and sourcecodes for Cgi
scripting (PERL)?

I made a simple log, but I couldn't find out how to get the date using the
date program located in \bin\date..
Most scripts seem to use localtime, which is a bit complicated because I
want a 24H clock, not 12PM/AM......

Thanks in advance!
Shadow


--
-----------------------------------------------------
Sig, snip it, if you want
-----------------------------------------------------
Wanna have free money?
Without surfer?
Or just wanna help me?
Go, join, and use this:
http://connect.to/yourfreemoney

Thx, I owe you one!
-----------------------------------------------------




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

Date: Sun, 05 Nov 2000 11:24:10 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: CGIsite / Time problem
Message-Id: <8u3g0o$21m$1@nnrp1.deja.com>

In article <8u3ab9$26v$1@porthos.nl.uu.net>,
  "[AGUT] Shadow Code" <onnoj@hotmail.com> wrote:
> Hi,
> Does anyone know a good site where I can find help and sourcecodes
for Cgi
> scripting (PERL)?
>
> I made a simple log, but I couldn't find out how to get the date
using the
> date program located in \bin\date..

backticks maybe?

> Most scripts seem to use localtime, which is a bit complicated
because I
> want a 24H clock, not 12PM/AM......

????????
printf("The time right now is %02d:%02d", (localtime())[2,1]);

try perldoc -f localtime

localtime(time()) returns an array of time elements like day, second,
etc.


Brendon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 5 Nov 2000 22:43:05 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: CGIsite / Time problem
Message-Id: <slrn90ahu9.53n.mgjv@martien.heliotrope.home>

On Sun, 5 Nov 2000 10:47:44 +0100,
	[AGUT] Shadow Code <mailme@shadownet.net> wrote:
>  Hi,
>  Does anyone know a good site where I can find help and sourcecodes for Cgi
>  scripting (PERL)?

There is no such thing as PERL, unless you are talking about a sotck
symbol. It's Perl for the language, perl for the program. Check perl FAQ
section 1.

To answer your question:
http://www.cgi-resources.com/

But to add something to that: Don't indiscriminately use crap that you
download from the Web, and trust that it's good. In general, anything
that doesn't use the CGI.pm module probably needs a lot of checking and
code review, more than something that does.

Did you know that search engines like www.google.com are quite good at
answering these sorts of questions? 

>  I made a simple log, but I couldn't find out how to get the date using the
>  date program located in \bin\date..
>  Most scripts seem to use localtime, which is a bit complicated because I
>  want a 24H clock, not 12PM/AM......

Do not go there. It is just silly to use date(1) when you have localtime
and strftime. here are times when calling an external program makes
sense. This is not one of those times.

open LOG, '>logfile' or die "Cannot open logfile: $!";
printf LOG "($0:%s) Message\n", scalar localtime;
close LOG;

If you want 24 hour time, you could consider setting your locale to
something more decent, or use strftime() from the POSIX package. It
takes a time string just like the date(1) format does, and is modelled
on strftime(3). You will still need localtime.

use POSIX;
# ...
printf LOG "($0|%s) Message\n", strftime("%Y/%m/%d %T", localtime);

[snip of signature which is much longer than 4 lines. Please consider
shortening it]

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd.   | Universe and Reboot +++
NSW, Australia                  | 


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

Date: Sun, 05 Nov 2000 14:35:22 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: CGIsite / Time problem
Message-Id: <3a057029.6b25$2b1@news.op.net>
Keywords: beguile, cuddle, frenetic, protean


In article <8u3ab9$26v$1@porthos.nl.uu.net>,
[AGUT] Shadow Code <onnoj@hotmail.com> wrote:
>Most scripts seem to use localtime, which is a bit complicated because I
>want a 24H clock, not 12PM/AM......

localtime *does* yield a 24H clock.  For example:

plover% perl -le 'print scalar localtime()'
Sun Nov  5 13:43:02 2000

plover% perl -le 'printf "%02d:%02d\n", (localtime)[2,1]'
13:43
-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sun, 5 Nov 2000 15:25:24 +0100
From: "Daniel J. Wojcik" <wojcik@genjerdan.com>
Subject: Re: Hardwood Website
Message-Id: <8u3qkl$mk0q$1@ID-34085.news.dfncis.de>

"Elaine Ashton" <elaine@chaos.wustl.edu> wrote in message news:4YjM5.13322>
Actually, I was kinda disappointed it wasn't about Viagra.

Did you know that Sta-Puft Marshmallows have the same effect as Viagra?





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

Date: Sun, 5 Nov 2000 09:08:26 -0000
From: "Philsinger" <phil.singer@virgin.net>
Subject: How Do I?
Message-Id: <6r9N5.27422$mv2.93552@news2-win.server.ntlworld.com>

Hi, All.

I'm creating a website at the moment about the london Underground, and as
part of it, I want to have a journey planner, where the user can put in a
start destination and a finish destination, with the capability to have via
in it. Also, could I work out an approximate journey time?

Is Perl the best way to do it? (I want a server side method of doing this)
Can anyone suggest a good free script that I can base it around (as I'm a
begginner)?

Thanks,

Phil Singer






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

Date: Sun, 05 Nov 2000 09:52:36 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: How Do I?
Message-Id: <slrn90abm5.30b.tjla@thislove.dyndns.org>

I was shocked! How could Philsinger <phil.singer@virgin.net>
say such a terrible thing:
>Hi, All.
>
>I'm creating a website at the moment about the london Underground, and as

>Is Perl the best way to do it? (I want a server side method of doing this)
>Can anyone suggest a good free script that I can base it around (as I'm a
>begginner)?

My only suggestion: Start with something a little smaller. And don't
attempt this problem until you realise exactly why the question 'Is Perl
the best way to do it?' makes no sense. I hope that helps.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Knowing trees, I understand the meaning of patience. Knowing grass,
I can appreciate persistence.


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

Date: Sun, 5 Nov 2000 22:50:54 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How Do I?
Message-Id: <slrn90aicu.567.mgjv@martien.heliotrope.home>

On Sun, 5 Nov 2000 09:08:26 -0000,
	Philsinger <phil.singer@virgin.net> wrote:
> Hi, All.
> 
> I'm creating a website at the moment about the london Underground, and as
> part of it, I want to have a journey planner, where the user can put in a
> start destination and a finish destination, with the capability to have via
> in it. Also, could I work out an approximate journey time?

Yes, it is possible. No, it is certainly not a trivial problem.

> Is Perl the best way to do it? (I want a server side method of doing this)
> Can anyone suggest a good free script that I can base it around (as I'm a
> begginner)?

A beginner should not try to do this. I'm sorry to say so, but you
really should be pretty comfortable with programming in general before
tackling a problem like this. And before implementing it in any
language, you should be comfortable with that language.

General:

Besides that, the general algorithm to do this sort of thing has no
relation to the language you implement it in. You could ask on
comp.programming if anyone has a useable algorithm for you. 

Implementation:

I would not do it in Perl, because I'd be afraid the memory requirements
could be a bit much, especially if there were potentially many requests
running. I'd probably write a single specific server process in C that
would deal with this problem alone, and make my server side web
processes talk to it over sockets, or via other IPC.

Iwouldn't give this as a project to one of the junior programmers at our
company, and they're not beginners. I really think you're being a bit
too ambitious.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.   | you come to the end; then stop.
NSW, Australia                  | 


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

Date: Sun, 05 Nov 2000 14:32:17 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: How Do I?
Message-Id: <3a056f70.6b15$17@news.op.net>

In article <6r9N5.27422$mv2.93552@news2-win.server.ntlworld.com>,
Philsinger <phil.singer@virgin.net> wrote:
>Is Perl the best way to do it? (I want a server side method of doing this)

Perl is probably *a* good way to do it.  What is best depends a lot on
your temperament and on the programming environment you have
available---of Perl has not been installed on your providers web
server, that would be a good reason to use something else.

Good luck!
-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sun, 5 Nov 2000 15:36:06 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How Do I?
Message-Id: <Pine.GHP.4.21.0011051531030.14718-100000@hpplus03.cern.ch>

On Sun, 5 Nov 2000, Martien Verbruggen wrote:

I had ignored the original posting on account of the subject header...

> On Sun, 5 Nov 2000 09:08:26 -0000,
> 	Philsinger <phil.singer@virgin.net> wrote:

> > I'm creating a website at the moment about the london Underground, and as
> > part of it, I want to have a journey planner, where the user can put in a
> > start destination and a finish destination, with the capability to have via
> > in it. Also, could I work out an approximate journey time?

You mean like this?
http://www.subwaynavigator.com/bin/select/english/united-kingdom/london

> Yes, it is possible. No, it is certainly not a trivial problem.

Agreed.




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

Date: Sun, 5 Nov 2000 15:29:52 +0100
From: "dick dijk" <ddijk@hetnet.nl>
Subject: how to make $ARGV[0] numeric
Message-Id: <u$vQAWzRAHA.283@net003s>

Hello,

Does anyone know how to make a commandline argument (like $ARGV[0]) numeric,
so that you can use it in
"$a = pack("n", $ARGV[0])"?

Dick




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

Date: Sun, 05 Nov 2000 13:59:46 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: how to sort corresponding arrays?
Message-Id: <3a0567d2.6a4b$300@news.op.net>
Keywords: choppy, confidant, felicity, seamen

In article <slrn9097nh.5tb.tadmc@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>On Sat, 04 Nov 2000 22:49:59 GMT, drtsq@my-deja.com <drtsq@my-deja.com> wrote:
>>I want to print these sorted descending from highest score to lowest.
>
>
>Err, you have neglected to mention _what_ you want to sort on.

I think he might want to print them sorted descending from highest
score to lowest.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sat, 4 Nov 2000 21:56:17 -0600
From: "Dale Emmons" <dale@emmons.dontspamme.com>
Subject: Re: i'm new. will someone direct me?
Message-Id: <t09mic2rn5o693@corp.supernews.com>

> >
> >I would really really like to break into the whole perl/CGI thing. but i
> >don't know anything about where to start.
> [snip]
> >in other words i know nothing.
>
> If you've never done any programming (HTML and CSS don't count as
> "programming"), then your first priority should be to learn how to
> program, that is, the fundamentals that apply regardless of which language
> you finally end up using.  Take an introductory programming class or get
> an introductory textbook.  For example, you might check out your local
> college or university and find out what they use for their introductory
> programming courses.
>
> At this point, which language you use is not terribly important, although
> if the course or book happens to use Perl, that will be convenient
> later.  Most good introductory programming books probably use C++,
> Java or Pascal, but people here have mentioned a new beginner's oriented
> Perl book that appears to be good.  Maybe someone will chip in with its
> title and author.
>
> Then, when you've got a good handle on basic programming concepts, start
> learning Perl seriously, if you started with some other language.  Most
> Perl books tend to assume some experience with programming, so you'll have
> a choice here.  "Learning Perl" (the "llama book"), published by O'Reilly,
> is the classic.  Don't worry about CGI stuff yet; write some command-line
> console mode scripts to get a feel for regular expressions, hashes, and
> other Perl features that other languages don't have.
>
> Finally, learn about the CGI protocol and start writing CGI scripts.
>
> This probably sounds like a long chain of stuff to learn, but trust me,
> it'll be a lot less confusing for you if you concentrate on one thing at a
> time.  Doing "the Perl/CGI thing" requires that you know programming,
> Perl, and CGI, and each of them is a whole field in itself.  Trying to
> learn them all at once is asking for trouble.

rpark4,

I can vouch for everything that Jon has written. I've tinkered with
programming (mostly BASIC) for most of my life (I'm 18) but didn't become
serious about it until last winter. Over the last 10 months I've learned a
_ton_ about programming, and about perl in particular.

However, I'm still a newbie. My point is, it's not as simple as "I want to
learn perl so I can do database stuff for clients." Programming is an
academic discipline, something that takes a very long time to become good
at. Keep that in mind.

Another thing: what you're proposing to learn are three separate things:
programming
CGI
databases

Remember to treat them as seperate things.

-Dale






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

Date: Sun, 05 Nov 2000 11:04:49 GMT
From: "Steve" <SCook@pobox.com>
Subject: Javadoc for Perl?
Message-Id: <l9bN5.12397$Tq6.112634@news-server.bigpond.net.au>

Hi,

I am wondering if there is a program that will generate documentation for
Perl code like Javadoc does for Java?

- Steve




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

Date: Sun, 05 Nov 2000 14:15:00 GMT
From: sandhall@swipnet.se (Robert Hallgren)
Subject: Re: Javadoc for Perl?
Message-Id: <slrn90aqo0.18u.sandhall@poetry.lipogram>

On Sun, 05 Nov 2000 11:04:49 GMT,
 Steve <SCook@pobox.com> wrote:

> I am wondering if there is a program that will generate
> documentation for Perl code like Javadoc does for Java?

perldoc perlpod


Robert
-- 
Robert Hallgren <sandhall@swipnet.se>

PGP: http://www.lipogram.com/pgpkey.asc
5F1E 95C2 F0D8 25A3 D1BE 0F16 D426 34BD 166A 566C


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

Date: Sun, 5 Nov 2000 00:27:36 -0500
From: "Randy Harris" <harrisr@bignet.net>
Subject: Re: Newbie question
Message-Id: <t09rt5ta29lm16@corp.supernews.com>

Alan Page <alandpage@aol.comnospam> wrote in message
news:20001104125054.10188.00001255@ng-ch1.aol.com...
> Hello,

Alan, just a suggestion.  Many of the regulars here become annoyed at
cutsie subject lines such as you have used.  Put information about your
actual problem in the subject, you will be more likely to get helpful
responses.

RH




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

Date: 05 Nov 2000 07:32:15 GMT
From: Draxus <draxus@dragonsrealm.com>
Subject: Perl CGI won't fork with mod_perl in Apache
Message-Id: <i43a0to8gakgocrsbb45bv247v9lbndcjc@4ax.com>

I'm running Apache 1.3.12 on a server running Redhat Linux 7.0. For
some reason Apache won't allow a Perl CGI that I am running to fork.

I have updated all of the Apache Perl modules using CPAN.pm.

I can run the script stand-alone as any user (including as user
"nobody") and it deletes the output file fine. Run it as an Apache CGI
script and it works up until the point of where it is supposed to fork
and then it doesn't delete the file. It doesn't come up with any
errors is any of the apache logs. For some reason mod_perl just
doesn't like it... Anyone have any suggestions?

Please email responses to draxus@dragonsrealm.com .  Thanks in
advance.

Code is as follows:

----------- Start of Code -------------

#!/usr/bin/perl

#
# Misc Code Here
#

$outfile = "/var/www/html/temp/file.dat";

use POSIX 'setsid';

&daemonize;

sleep 30;
unlink $outfile;

sub daemonize {
  chdir '/'                 or die "Can't chdir to /: $!";
  open STDIN, '/dev/null'   or die "Can't read /dev/null: $!";
  open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
  defined(my $pid = fork)   or die "Can't fork: $!";
  exit if $pid;
  setsid                    or die "Can't start a new session: $!";
  open STDERR, '>&STDOUT'   or die "Can't dup stdout: $!";
}

---------- End of Code ----------



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 4813
**************************************


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