[8748] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2365 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 20 15:07:16 1998

Date: Mon, 20 Apr 98 12:00:29 -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           Mon, 20 Apr 1998     Volume: 8 Number: 2365

Today's topics:
    Re: ---- Need Help to force a Page to Reload <codestorm@mailcity.com>
        2 questions on screen controll <aaronl@sunset.net>
    Re: Bill Gates should be invited to O'Reilly's "Free So <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    Re: CGI help for a newbie, easy question (Steven Fletcher)
        Eat my dust - Perl running on Windows 95 <elssa09@callisto.si.usherb.ca>
        GD.Pm problem <jahnel@xarch.tu-graz.ac.at>
    Re: getpwnam question <barnett@houston.Geco-Prakla.slb.com>
        Help with regular expression <mferg@hal.ddntl.didata.co.za>
    Re: Help with regular expression <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Hide or Encrypt perl source code (John Stanley)
    Re: How do I get the name of each file in a dir? <aaronl@sunset.net>
    Re: How do I get the name of each file in a dir? <mindmore@mindless.com>
    Re: How to insert a \n each... greene@gucc.org
    Re: How to insert a \n each... (M.J.T. Guy)
        HOWTO strink c embed Perl bin fil <fhleongx@pahang.intel.com>
    Re: Lexers / tokenizers in Perl (Mark-Jason Dominus)
    Re: Lexers / tokenizers in Perl (Andy Wardley)
        Message Threading <tony@cyberscape.net>
    Re: Message Threading <rogerso@bigfoot.com>
        Perl 5.004_04 will not compile under Linux (William Burrow)
    Re: Perl module to retrieve a document and send it to a <mindmore@mindless.com>
    Re: PERL SUBROUTINES.... <codestorm@mailcity.com>
    Re: perl/shopping cart <achatran@gonzaga.edu>
    Re: Perl/Tcl <mindmore@mindless.com>
    Re: RMS should be invited to O'Reilly's "Free Software  (Michael Funk)
    Re: SendMail on NT <elssa09@callisto.si.usherb.ca>
    Re: Snobby news group <mindmore@mindless.com>
    Re: Sorting an associative array. greene@gucc.org
    Re: Special characters <perlguy@inlink.com>
        UNIX mail script anpap@usa.net
        Win32::Registry SetValueEx question <kairys@mi.sl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 20 Apr 1998 02:22:19 -0700
From: Arup Kanjilal <codestorm@mailcity.com>
Subject: Re: ---- Need Help to force a Page to Reload
Message-Id: <353B13CB.7816@mailcity.com>

Bulk E-Mail ISP wrote:
> 
> I have a search.cgi script that calls a file called search_define.pl. In
> this file, I have somt html for a page counter. The problem is that each
> time the .pl file is called without hitting "reload", the page counter
> does not increment.
> 
> How do I make the page counter increment each time the search.cgi script
> is run?
> 
> Address replies to mailto:kamenar@webmall.net
> 
> Thanks


Before you

print "Content-type: whatever/whichever\n\n";

do a 

print "Pragma: no-cache\n";

Be warned, msie blatantly ignores this, ns works great tho


-- 
Arup Kanjilal                    codestorm@mailcity.com
Webmaster                        thematek@giascl01.vsnl.net.in
ThemaTech India                  http://www.westbengal.com/


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

Date: Mon, 20 Apr 1998 00:56:02 -0700
From: Aaron <aaronl@sunset.net>
Subject: 2 questions on screen controll
Message-Id: <353AFF92.6C1B@sunset.net>

Hi, I perused the current list of postings and the faq's and didn't see
anything that realy answered either of these two questions:

1. I want to make an interactive program with a menu system, how can I
place text at specific locations on the screen without the screen
scrolling?  eg.  I want a persons name to start 3 rows down and 8 colums
in from the left, also this would need to work on both unix and win32
text screens.

2.  Are there any good interfaces for perl to create a window?  A perl
GUI (win32 only, I know I can use Tcl/Tk in unix to do this)?

Thanks in advance for your help.

Aaron
aaronl@sunset.net


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

Date: 20 Apr 1998 13:10:02 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <m2ra2svjed.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>

Zenin <zenin@archive.rhps.org> writes:

> 	To this point, you are *highly* mistaken.  Have you ever even
> 	installed FreeBSD?  I hear they've even had blind moneys do it
> 	it's that simple, with simple duelbooting to anything else one
> 	might like.

duelbooting?  would that be starting both operating systems at the
same time, let them run 10 paces, and then both try to shoot the
other, and the survivor continues booting?


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany


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

Date: Mon, 20 Apr 1998 10:29:04 GMT
From: steven@shellnet.co.uk (Steven Fletcher)
Subject: Re: CGI help for a newbie, easy question
Message-Id: <353b2282.1727133@news.shellnet.co.uk>

On Mon, 20 Apr 1998 00:47:51 -0400, "Andrew Connell"
<jconnell@lords.com.nospam> wrote:

On the contrary, you messed up twice, not once =)

1)
>
>#!/user/bin/perl -w

On most systems, that would be
#!/usr/bin/perl -w

Unless of course if you actually have /user or it is symlinked.

2)
>
>END_of_Multiline_Text;
>

Don't put a ";" at a terminating string, whatever it's called.

So I now have:

#!/usr/bin/perl -w
# howdy--the easiest of CGI programs
print <<END_of_Multiline_Text;
Content-type: text/html

<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<H1>Greetings, Terrans!</H1>
</BODY>
</HTML>

END_of_Multiline_Text

Check it for yourself - http://smtp.shellnet.co.uk/cgi-bin/test.pl

>------
>Andrew Connell <jconnell@lords.com>
>ICQ#: 4210346   AOL IM: jaconell
>http://jconnell.host4u.com
>
>"No one is too old or too young to do something."
>        -Bobby Sands-

-Steven Fletcher (steven@shellnet.co.uk)
Shellnet - http://www.shellnet.co.uk/ 


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

Date: Mon, 20 Apr 1998 02:57:01 GMT
From: ELSS Admin <elssa09@callisto.si.usherb.ca>
Subject: Eat my dust - Perl running on Windows 95
Message-Id: <33066F57.2FF1@callisto.si.usherb.ca>

Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
(486 dx-66)


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

Date: Mon, 20 Apr 1998 10:57:05 +0200
From: Jahnel Klaus <jahnel@xarch.tu-graz.ac.at>
Subject: GD.Pm problem
Message-Id: <353B0DE0.8E1A301F@xarch.tu-graz.ac.at>

Hier is my script:
%aports =
("YPAD","0,150","YSSY","300,200","YMML","400,400","EGKK","357,190","EGLL","244,248","EHAM","303,232","LOWW","400,290",);

$n=0;
foreach (@piloten){
  @ac=split (" ",$piloten[$n]);
  $k='$blue';
  $tra= "($aports{$ac[0]},$aports{$ac[1]},$k)";
if ($tra=~ /\(?:(\d+),{4}$blue\)/ && $1<256 && $2<256 && $3<256 &&$4<256
){
    @tester=(0,0,500,500,$blue);
  $im->line(@tester);
    $im->line($tra);
  }
$n++;
}
the problem is:
i want to test if the coordinates exists in the hash , if yes it shoulfd
drw me a line from x to y.
the @tester work but not the  $im->line($tra);
can anybody help me out ?
TIA
KLAUS



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

Date: Mon, 20 Apr 1998 10:10:08 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: getpwnam question
Message-Id: <353B6550.D8DD3A7D@houston.Geco-Prakla.slb.com>

Ken Quinn wrote:
> 
> Hi, I'm trying to use getpwnam, the following works;
> 
> $username = "bill" ;
> @pwdlist = getpwnam($username) ;
> print @pwdlist ;
> #so does;
> $username = "bill" ;
> $username = $a
> @pwdlist = getpwnam($a) ;
> print @pwdlist ;
Are you sure???  $username = $a needs a ";" after it.
Secondly, you set $username = $a, but then getpwnam of $a, not
$username.  Where is $a set????

> #when I pipe a username like;
> $username  =  <> ;
> print $username ;
> #no problem, but when I pipe it to  getpwnam ;
Where did your cursor end up?  At the end of the user name you typed, or
at the start of the next line???  VERY important.  All user input from
<> operator contains "text", and "\n" (a newline character!).  Be aware
of it.  It is both a friend, and an infuriating oversight.  :-)

Look into chomp.  (perldoc -f chomp)

> $username = <> ;
> $username =  $a
> @pwdlist = getpwnam($a);
> print @pwdlist ;
> 
> It dosen't work.  I know this may be rather simple but I am having
> trouble so I would greatly appreciate any help.
> Thanks  Ken
> 
>  I'm trying to pipe a username to a filter which uses getpwnam.
Try the following:
#!/usr/local/bin/perl -w
#
$username = "bill" ;
@pwdlist = getpwnam($username) ;
print @pwdlist ;
#so does;
$username = "bill" ;
@pwdlist = getpwnam($username) ;
print @pwdlist ;
#when I pipe a username like;
$username  =  <> ;
print $username ;   ###  Still has the newline char!
#no problem, but when I pipe it to  getpwnam ;
$username = <> ;    ###  Again has the newline char!
chomp($username);   ###  Remove the newline char!
@pwdlist = getpwnam($username);  ### Now works fine.
print @pwdlist ;
__END__

I think you will find that works much better.

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Mon, 20 Apr 1998 11:51:37 +0200
From: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Help with regular expression
Message-Id: <353B1AA8.B5A30491@hal.ddntl.didata.co.za>

Please can someone help me with the following:

$DATE="03/30/98"
$TIME="14:49:43"

How do I get:
$NEWDATE="1998-03-30 14:49:43"

Thanks in advance.

--
_____________________________________________
Mark Fergusson: mferg@hal.ddntl.didata.co.za
Dimension Data:
PO Box 236, Pavillion, 3611, South Africa
(+27)-204-8424 (Work)
(+27)-204-8590 (Fax)
082-771-8519 (Cell)




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

Date: 20 Apr 1998 12:13:08 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Help with regular expression
Message-Id: <7x90p0pzre.fsf@beavis.vcpc.univie.ac.at>

Re: Help with regular expression, Mark
<mferg@hal.ddntl.didata.co.za> said:

Mark> Please can someone help me with the following:
Mark> $DATE="03/30/98" $TIME="14:49:43"

don't forget the `;' to terminate statements...

Mark> How do I get: $NEWDATE="1998-03-30 14:49:43"

Try the Date:: modules

    Date::Manip
    Date::DateCalc

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

Date: 20 Apr 1998 18:21:54 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Hide or Encrypt perl source code
Message-Id: <6hg3o2$3rp$1@news.orst.edu>

In article <3536cad3.524144494f47414741@radiogaga.harz.de>,
Martin Vorlaender <MARTIN@RADIOGAGA.HARZ.DE> wrote:
>John Porter (jdporter@min.net) wrote:
>: I commercial project I'm on had a total installation footprint 
>: of about 4 meg until I suggested (and started) using perl.
>: Now it's 14 meg.  Do you think that's easy to justify?
>
>Show them the footprint of any Microsoft product....

Thanks for the laugh, Martin. I can't recall when I ever saw anyone
justify perl by claiming Microsoft set the precedent.



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

Date: Mon, 20 Apr 1998 00:33:04 -0700
From: Aaron <aaronl@sunset.net>
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <353AFA30.7187@sunset.net>

Mike Williams wrote:
> 
> On Sun, 19 Apr 1998 12:38:42 -0500, Chocolate <poohba@io.com> wrote:
> >How do I get the name of each file in a dir and print it?
> 
> How about
> 
> print `ls`;
> 
I too have wondered about this.  I have had to resort to the above or
also I have used $foo=`echo /some_dir/*`;
But what if I'm on a different platform, win32?  Do we always have to
resort to the shell to get a file list?  Hell we can chmod, chdir, mkdir
and the like, but I can't find a "perl" command to list the files.

Aaron


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

Date: Mon, 20 Apr 1998 11:54:12 +0300
From: Fain <mindmore@mindless.com>
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <353B0D34.A69C1BD4@mindless.com>

Mike Williams wrote:

> On Sun, 19 Apr 1998 12:38:42 -0500, Chocolate <poohba@io.com> wrote:
> >How do I get the name of each file in a dir and print it?
>
> How about
>
> print `ls`;

# Tried and True...
print `ls`;
# works

Why use a whole function for something that you can do as simply as
that?

- NAthan



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

Date: Mon, 20 Apr 1998 03:19:21 -0600
From: greene@gucc.org
Subject: Re: How to insert a \n each...
Message-Id: <6hf0e8$bth$1@nnrp1.dejanews.com>

In article <6h8f11$748@hplntx.hpl.hp.com>,
  "Larry Rosler" <lr@hpl.hp.com> wrote:
>
> Phil Vuong wrote in message
> <01bd69b2$108e5360$57b837cb@melcs10.gribbles.com.au>...
> >
> And $& is relatively inefficient.  The better
> answer has already appeard in this group:
>
> $line =~ s/(.{10})/$1\n/g ;
>
>

Thanks to all! I've been lurking around the "Perly Gates" (perl on Win95/NT)
for about a year now, but I see there is still much to learn!

However, I've tried benchmarking $& vs $1 and don't see a significant
difference on my WinNT machine (Perl 5.004 binary distribution). Is this true
only because the regex is small and simple?

--
# James Greene - Informatics Consulting - 79539 Loerrach, Germany
# www.gucc.org/greene/consult - greene (at) gucc (dot) org
perl -e "eval unpack
'u*',q/B<')I;G0@(DIU<W0@86YO=&AE<B!015),(&AA8VME<B$*(@``/"

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 20 Apr 1998 15:50:57 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How to insert a \n each...
Message-Id: <6hfqt1$r5j$1@lyra.csx.cam.ac.uk>

In article <6hf0e8$bth$1@nnrp1.dejanews.com>,  <greene@gucc.org> wrote:
>
>However, I've tried benchmarking $& vs $1 and don't see a significant
>difference on my WinNT machine (Perl 5.004 binary distribution). Is this true
>only because the regex is small and simple?

The costs of $& are not in the current regex.   Rather, use of $& and
friends causes overhead in _every other_ regex in your script.    So it
will make little difference for the sort of cases you have benchmarked.
But if you inserted your examples into a large script, you'd notice the
difference.


Mike Guy


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

Date: Mon, 20 Apr 1998 16:48:40 +0800
From: FH Leong <fhleongx@pahang.intel.com>
Subject: HOWTO strink c embed Perl bin fil
Message-Id: <353B0BE8.AB18C9D9@pahang.intel.com>

I'm currently doing a project which use perl to search and C for
database, I can
do that in pure C but needs longer code. I've try it out and it works
quite fast
but the only thing is that I notice the executable is quite large, more
than 500k.
I try some simple C program with Perl embeded and the file is also more
than
500k. The Perl version I'm using is 5.003 EMBED and the perl exe is just
bout 50k
so I like to know if the file size is something standard or can it be
strink ?

thanks for sharing....



--
---
  F.H.Leong

  Intel Technology Sdn Bhd,
  Bayan Lepas FTZ, Phase 3,
  11900, Penang,
  Malaysia





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

Date: 19 Apr 1998 12:05:10 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Lexers / tokenizers in Perl
Message-Id: <6hd7bm$90g$1@monet.op.net>
Keywords: Gibraltar grata Rutgers visceral


In article <6hbsci$gom$1@brokaw.wa.com>, Aaron Harsh <ajh@rtk.com> wrote:
>Very nice!! (Both LOD page and the lexer example).

Thanks.

>I love the way you made the regexp completely readable.  

Well, that's just lucky.  If this had been 1994, it would have gone in
in the one-line unreadable version.

>When I've done this sort of thing, I've always used the /g option on the
>match operator, rather than split.

That may be a better way to do it.  If you stick a \G at the front,
you can get it to give you one token at a time.

>The only caveats are that you have to stick the \S at the end to catch
>invalid characters, 

Yes.  My original thought was to make the last alternative `.', to
pick up characters that could not be part of tokens, but it's probably
better to make the last two alternatives \s+|. so that you get a
separate `white' token type; then it's easier to discad white space.

One disadvantage of the /g method seems to be that there's no easy way
to discard the white space.  Well, that's not quite true; you can pass
it one level up to a subroutine that throws away all-white `tokens'.
But conventional lexers wouldn't even let the white space get out of
the lexer; they'd just swallow it silently.

No, I guess it's not true at all.  I can see several strategies:

	1. Use the `split' method, and then throw away all the
	odd-numbered tokens:

		@tokens = split ...;
		@tokens = values do { my %_ = @tokens };   # LOD

	2. Use whatever method, and then grep out the white tokens before
	you pass the token list on:

		@tokens = whatever...;
		@tokens = grep /\S/, @tokens;

	3. Let the white space get up to the next level anyway.

You know, 3 is probably best, because then the next level up can do

	$lineno += $token =~ tr/\n//;

to keep track of what line it's on; then it can report parse errors at
that line.   Normally this is done in the tokenizing stage, which
causes all sorts of communication difficulties.  Once again, my
knowledge of how it's `usually done' is leading me to solutions that
may be suboptimal.




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

Date: Mon, 20 Apr 1998 10:15:36 GMT
From: abw@cre.canon.co.uk (Andy Wardley)
Subject: Re: Lexers / tokenizers in Perl
Message-Id: <ErpJ61.FCs@cre.canon.co.uk>
Keywords: Gibraltar grata Rutgers visceral

In article <6hbsci$gom$1@brokaw.wa.com>, Aaron Harsh <ajh@rtk.com> wrote:
>Very nice!! (Both LOD page and the lexer example).

Agreed!

Mark-Jason Dominus <mjd@op.net> wrote:
>One disadvantage of the /g method seems to be that there's no easy way
>to discard the white space.  Well, that's not quite true; you can pass
>it one level up to a subroutine that throws away all-white `tokens'.

I've previously used the following approach:

    my $assignment = q(:=);
    my $exponent   = q(\*\*);
    my $charop     = q([\-\+\*\/]);
    my $ident      = q([a-zA-Z_]\w*);
    my $number     = q[(?:\d+(?:\.\d+)?)];
    my $whitespace = q(\s+);
   
    while ($string =~ /             # regexen to match...
            (
                  $assignment       # ...an assignment
                | $exponent         # ...'**' exponential
                | $charop           # ...a single character operator
                | $ident            # ...an identifier
                | $number           # ...a number
            )
            | $whitespace           # ...whitespace
        /gx) {
     
        push(@tokens, $1) if $1;
    }

Which produces the following sample output:

    $string: " foo:=(  bar *baz)**3; x := -3.14159/8  "
    @tokens: foo, :=, (, bar, *, baz, ), **, 3, ;, x, :=, -, 3.14159, /, 8

It's not as neat as Mark's one-liner but it has a couple of advantages.

  * whitespace is stripped by the tokenizer.

  * with a minor modification to the regex (to enclose _each_ token 
    type in a set of parenthesis rather than enclosing $assignment, 
    $exponent, etc., all in one group), one can do per-token processing 
    based on the token type by examining $1, $2, $3, etc to determine 
    which got "filled":

    while ($string =~ /            # regexen to match...
              ( $assignment )      # ...an assignment
            | ( $exponent   )      # ...'**' exponential
            | ( $charop     )      # ...a single character operator
            | ( $ident      )      # ...an identifier
            |   $whitespace        # ...whitespace 
        /gx) {

        if (defined $1) {
            # found an assignment...
        }
        elsif (define $2) {
            # found an exponent....
        }
        # etc...
    }

    You can also use the /\G.../gc modifiers to repeatedly test the same
    string against each of a number of regexes, as described in perlop.
    This saves having to test $1, $2, $3, etc.

As Mark says, Perl can be extremely powerful for writing lexers and 
parsers but you have to write it in a perlish way.  


A

--
Andy Wardley <abw@kfs.org> http://www.kfs.org/~abw    
Signature lost in transit.  We apologise for any inconvenience caused.


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

Date: Sun, 19 Apr 1998 16:47:25 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Message Threading
Message-Id: <6hd6b1$lhb$1@svr-c-02.core.theplanet.net>

I am trying to create a web based discussion forum preferably using DBM
files.

My problem is that I am trying to work out how to thread the messages.  I
understand this is a tricky concept and have search the web and all my books
trying to find out how to do it.

Does anyone know of where i can find some information on this so that i may
learn how it is done.  Or, can anyone help me in any way, pointer to the
right way of doing it would be quite helpful.

Randal: Maybe a WT column on threading? :))

Thanks in advance.

~TK





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

Date: Tue, 21 Apr 1998 01:55:39 +1000
From: "Roger So" <rogerso@bigfoot.com>
Subject: Re: Message Threading
Message-Id: <6hfrho$je0$1@nswpull.telstra.net>

Tony Kenny wrote in message <6hd6b1$lhb$1@svr-c-02.core.theplanet.net>...
>I am trying to create a web based discussion forum preferably using DBM
>files.


I'm trying to do this as well, but using plain text files for everything.
But I guess the file format shouldn't affect the algorithm...

>My problem is that I am trying to work out how to thread the messages.  I
>understand this is a tricky concept and have search the web and all my
books
>trying to find out how to do it.
>
>Does anyone know of where i can find some information on this so that i may
>learn how it is done.  Or, can anyone help me in any way, pointer to the
>right way of doing it would be quite helpful.


Take a look at this: http://spacehunt.ml.org/~rogerso/cgi-bin/test3.pl  Is
this what you're trying to do?

This is how it works: each message in the forum contains a "FollowUp" field,
which is a list of message IDs that is a direct reply to that message
*only*.  When you want to display a threaded list of messages, start at the
thread's first message, and:
1) Print "<ul> $the-message-title \n";
2) Look at the "FollowUp" field;
3) If not empty, foreach (@FollowUp) { repeat step 1; }
4) Print "</ul>\n";
 ... or something similar.

I've started learning Perl only 4 days ago, so the above is probably not the
proper way to do it, inefficient, or even completely wrong. :)

Cheers,

Roger So    rogerso@spacehunt.ml.org



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

Date: 20 Apr 1998 02:49:44 GMT
From: aa126@NOSPAM.fan.nb.ca (William Burrow)
Subject: Perl 5.004_04 will not compile under Linux
Message-Id: <slrn6jldu8.i0n.aa126@fan1.fan.nb.ca>


After grabbing the huge Perl source to compile, doing a ./configure; make,
I get the following error:

util.c: In function `Perl_huge':
util.c:2348: `__HUGE_VAL_bytes' undeclared (first use this function)
util.c:2348: (Each undeclared identifier is reported only once
util.c:2348: for each function it appears in.)
make: *** [util.o] Error 1


Is this a known problem?  What is the workaround?

-- 
--
William Burrow, VE9WIL (Adv, 5wpm)  --  New Brunswick, Canada 
Copyright 1997 William Burrow  


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

Date: Mon, 20 Apr 1998 12:04:12 +0300
From: Fain <mindmore@mindless.com>
To: Yongzheng Mao <ymao@array.ca>
Subject: Re: Perl module to retrieve a document and send it to a browser(Netscape)
Message-Id: <353B0F8C.CD9C0431@mindless.com>

Yongzheng Mao wrote:

> Would someone tell me where I can find a Perl module which can be
> envoked in a homepage, retrieve a document and send it back to the
> browser(Netscape)? Note: I have Perl5 and LWP installed in my account
> already.

  Is there some reason why you want a module in patucular? I ask because
what it sounds like you want can be done simply in a CGI script by
opening the HTML page reading it's contents and then sending them to the
screen.

- Nathan



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

Date: Mon, 20 Apr 1998 02:49:44 -0700
From: Arup Kanjilal <codestorm@mailcity.com>
Subject: Re: PERL SUBROUTINES....
Message-Id: <353B1A38.5959@mailcity.com>

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

A good way to do it is to have a wrapper that parses the cmnd line args
and calls the appropriate sub:

#!/usr/bin/perl -w

$cCommand = shift;


# Begin wrapper
if($cCommand eq "reboot"){

   _reboot;

}
# End wrapper


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

Date: Mon, 20 Apr 1998 03:43:06 -0700
From: Alisa Chatranon <achatran@gonzaga.edu>
To: William Shaffer <wpshaf@gte.net>
Subject: Re: perl/shopping cart
Message-Id: <Pine.HPP.3.95.980420032610.15395H-100000@barney.gonzaga.edu>

Hi,

I'm a new webbie trying to implement PerlShop Shopping Cart also, but
having some problems understanding it. The mannual is pretty long, and I
did try to go over them, but there are still some part that I'm not sure,
especially about the security issue; and I will greatly appreicate any
suggestion on this shopping cart program.

- In general, what are the things I should do to make sure that the
transaction would be safe enough? 

- It says that "The $allow_ssi_cgi variable can be set to allow the use of
the SSI "cgi" command to run cgi programs, but this creates a BIG security
hole, and should not be enabled unless absolutely necessary AND you know
what you are doing!"

  So.. to be safe, I guess I would not allow the SSI. Would this still be
working fine?

- It suggests that we use CGIwrap to ensure the output file's security.
Would it still be safe enough if I do not use CGIwrap? (because it sounds
kind of complicated to me...)

- What do you have to do with the output file? It says that "The output
files should be periodically removed from the Internet server as often as
possible. If you don't remove them, you should at least encrypt them
manually, making sure not to store the encryption key  on the server. If
transferring the files to your own computer, they snould be encryped
first." 
  I'm not sure yet how to go about encrypting. Is it very important? How
do you manage your output file?

I would appreciate any suggestion on this. Thank you very much in advance.
Alisa



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

Date: Mon, 20 Apr 1998 11:33:35 +0300
From: Fain <mindmore@mindless.com>
Subject: Re: Perl/Tcl
Message-Id: <353B085F.955759A@mindless.com>

Yeah... what he said.

However, have you ever noticed that allot of people will still try to use
perl somehow even when they could do CGI in something they already know (like
C, C++, TCL ....).

Even for myself... If I knew C before I learned Perl and was trying to do
some CGI I don't think I would try it in C. The reason is because there is
much more support for Perl and "it fits the job requirements so well". The
other reason for using Perl instead of TCL or C would be because of this
newsgroup :)

- Nathan


Tim Kramer wrote:

> There's no actual requirement that you use Perl to do cgi  programming.
> It can be done in C, Tcl, Scheme, or any other language.  Perl is used so
> much of the time because it fits the job requirements so well.   Tcl comes
> close to the same functionality though.
>
> LOI N PHAM wrote:
>
> >     I'm trying to call (or learning how to call) Tcl-based libraries in
> >  Netscape Enterprise Server/Unix environment.
> >
> >  1. If I install Tcl extension module for Perl5, then I can instantiate
> >  Tcl interpreter as Per5 object, and excute embedded Tcl code.  I saw
> >  Tcl extension for Perl5 is still in beta1 in CPAN, how reliable is this
> >  beta module?  Is there any other Tcl extension for Perl5 available?
> >
> >  2. Alternatively, I can use straight Tcl code to generate HTML pages.
> >  Pro's and con's against using Tcl extension for Perl5?
> >
> >  3. Is there a "Tcl for Win32" (like "Perl for Win32")?
> >
> >  Many thanks in advance,
> >  Loi






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

Date: 20 Apr 1998 03:51:27 GMT
From: mwfunk@uncc.campus.mci.net (Michael Funk)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <slrn6jlhot.913.mwfunk@localhost.domain>

>Supposedly "free" licenses that allow commercial parasites to take
>without giving are unfairly slanting the playing field away from a
>free software society towards a commercial software society. It is
>not conducive to the goal of software being free.

If this is your goal then you are correct, the GPL is the way to
go.  But that is not the goal of a large chunk (perhaps even a
majority) of the free software community.  This is the exact sort
of agenda-ridden propaganda that many GPL opponents are turned off
by.  You have gone beyond simply presenting a free software license,
and pushed things into the realm of your (very peculiar to many)
worldview: namely that commercial software is somehow evil, and 
that we all should be striving for some ideal world in which all
software is GPL'd.  Admittedly the GPL itself isn't the source
of most of this, rather the GM, RMS' various writings, and other
works.  But it's difficult to see the license itself outside of
the ideology that spawned it.

Many people who might otherwise actually use the GPL are turned
off buy the fact that it carries with it such an odd ideological
burden.  A lot of people also get turned off by the fact that in
so many grandiose pro-GPL statements (such as the one presented
above), there are implicit statements to the effect that there
are no other valid philosophies, and that there is no dissent
within the free software community WRT this matter, which is
simply not true.  There are widely varying opinions as to what
the role of free software is within the industry, and why it
should continue to be developed, and why it's a good thing in
the first place.  I think probably everyone here can agree that
free software is a good thing, but there are probably as many
different rationales for this as there are posters.  It's amazing
how many FSF boosters don't ever seem to admit this, or even
acknowledge the fact that there might be multiple, equally valid
viewpoints.

The zealout/purist attitude evidenced by much of the GPL advocates
is, IMO, just as intellectually dishonest and ultimately destructive
as fundamentalism in religion or extremism in politics.  I'm sure
someone will follow up with a defense of fundamentalism and/or
political extremism, causing the needle on humanity's Cluemeter
to drop another notch. :(

Free software performs many valuable functions, well beyond the
supposed goal of wiping out the supposedly "evil" world of commercial
software.  Might I suggest:

        -to encourage more openness within the industry
        -to allow projects which have no business value
         but much intellectual value to get off the ground
        -obvious educational value
        -obvious value to hobbyists
        -to "raise the bar" :) within the industry, forcing
         commercial interests to set their standards for quality
         higher if they wish to compete
        -to counter the forces of darkness (i.e., pointy-haired
         bosses) within the industry; free software gives ideas
         with much techical merit that were rejected for political
         reasons a second (or even first) chance
        -to encourage innovation
        -to encourage alternative approaches when some de facto
         standard causes resentment (gtk vs. Motif)
        -to fuel the cause of open development models (Netscape)
        -to give people a means by which they can stand up and say
         "To heck with Microsoft!  We don't need you."

In general, a force for cluefulness and technical excellence in
all areas of the industry, rather than something which seeks to
wipe out all other approaches, development models, or philosophies
regarding intellectual property.

Some might argue that they use GPL for purely pragmatic reasons, and
don't buy into the whole worldview suggested by the purists.  This
is actually not what I'm getting at here, and is a completely different
debate.  I think one of the major reasons that these "GPL vs. the world"
discussions get so heated is that they reflect two completely different
debates.  One debate has to do with, what's a good license under which
to release free software.  On the surface that's what most of these
discussions focus on.  The other debate can always be found lurking
under the surface, periodically rearing its much more controversial
head: what's the purpose of free software?  Free software licenses
carry with them implicit answers to this question.  Perhaps people
would be better off debating this matter openly, rather than beating 
around the bush by discussing the legal niceties of the various
licenses.

To reiterate: I'm talking about the motivations behind the licenses,
not the actual terms of them.  Also, these discussions get carried
away (and live on, interminably) partially because they tend to dance
back and forth between pragmatic debates over legality and emotional
debates over ideology, without anyone really thinking to draw a line
between the two, or perhaps not even being aware of it.

  Mike



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

Date: Mon, 20 Apr 1998 02:53:16 GMT
From: ELSS Admin <elssa09@callisto.si.usherb.ca>
Subject: Re: SendMail on NT
Message-Id: <33066E76.5387@callisto.si.usherb.ca>

No problem:

	But you'll need the libraries installed! Run it first to see if you
have them. Use the commented line to run the debug first.

	You can play with this script first. Last I checked, it worked. If you
have a question, drop me a line. I'm new to this, but it works.

Natalie
______________________________
#!perl -w
$email = "you\@your_server.com";

use Net::SMTP;

#$smtp = Net::SMTP->new('mail.your_server.com', Debug => 1);
$smtp = Net::SMTP->new('mail.your_server.com');

$smtp->mail($ENV{USER});

$smtp->to('$email');
$smtp->data();
$smtp->datasend("To: $email\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;
exit;


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

Date: Mon, 20 Apr 1998 11:49:45 +0300
From: Fain <mindmore@mindless.com>
Subject: Re: Snobby news group
Message-Id: <353B0C29.43247165@mindless.com>

In my opinion (and only mine I'm sure), I think we shouldn't regulate the
group at all (if that is what we are talking about). Even if we all have to
download 2,000 messages a day. The reason is because USENET programs are
getting much better in that now I can search for something in a particular
message or just the Directory. So, if I'm looking for something in particular
then it's not so hard to find. However... If i'm the type of person that
starts at the top of the list of new messages and just start going down, then
I need to know when to stop.

The more messages the better (again... that's only my opinion).
- Nathan
mindmore@mindless.com

I R A Aggie wrote:

> In article <slrn6jii0i.rq0.wendigo@deathstar.jabberwock.org>,
> wendigoNO@SPAMpobox.com wrote:
>
> + I like the idea of comp.lang.perl.help, as for .moderated ... I'd
> + hold off on that until traffic patterns determined if it were necessary.
>
> Oh, it is necessary.
>
> James
>
> --
> Consulting Minister for Consultants, DNRC
> The Bill of Rights is paid in Responsibilities - Jean McGuire
> To cure your perl CGI problems, please look at:
> <url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>





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

Date: Mon, 20 Apr 1998 03:11:41 -0600
From: greene@gucc.org
Subject: Re: Sorting an associative array.
Message-Id: <6hevvs$b95$1@nnrp1.dejanews.com>

In article <3539d938.6649433@news.singnet.com.sg>,
  hangyk@singnet.com.sg (Han Yiguang (Hang)) wrote:
> foreach $i (sort keys %aalist)
> {
>   print "$aalist{$i}\n";
> }
>
> It didn't help.  Anyway to sort on the values?  And in numerical
> manner?
>

If you don't need to know the hash key, a simple approach would be to use:

foreach (sort values %Temp) {
    print "$_\n" ;
}

Otherwise, I would strongly recommend reading the FAQs.

--
# James Greene - Informatics Consulting - 79539 Loerrach, Germany
# www.gucc.org/greene/consult - greene (at) gucc (dot) org
perl -e "eval unpack
'u*',q/B<')I;G0@(DIU<W0@86YO=&AE<B!015),(&AA8VME<B$*(@``/"

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 20 Apr 1998 11:38:00 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Special characters
Message-Id: <353B3398.BAE19C4E@inlink.com>

try 

s/\015\012//g;
 or
s/\012\015//g;

I always forget which order they go in, but one of them will work.  If
you are in vi, omit the semicolon...

HTH,

Brent


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

Date: Mon, 20 Apr 1998 02:21:37 -0600
From: anpap@usa.net
Subject: UNIX mail script
Message-Id: <6het21$7u7$1@nnrp1.dejanews.com>

I need a Unix (or perl) cgi script that will enable me to
send mail without a mail client.
I have tried telneting on port 25 from within a shell cgi
script, but it didn't work.
Anyone has a script that works??


Andreas Papagapiou.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 20 Apr 1998 11:26:45 -0400
From: "Michael Kairys" <kairys@mi.sl.com>
Subject: Win32::Registry SetValueEx question
Message-Id: <353b7567.0@news.ic.net>

How do I set a REG_BINARY key to nothing (i.e. "zero-length binary value")?

If you're curious, I'm trying to write a script that will go through my
MenuOrder keys and clear out the Order values. (Anyone wanting to know why I
want to do that may e-mail me :-)

I'm calling $key->SetValueEx( "Order", NULL, REG_BINARY, $value ) with
various flavors of $value and watching in RegEdit to see what happens, and I
can't find a way to clear the value, except $key->SetValueEx( "Order", NULL,
REG_BINARY, undef ), which makes me nervous and makes Perl warn "Use of
uninitialized value at ...lib\site/Win32/Registry.pm line 292 "

Looking at the code (registry.xs out of Libwin32) I find:

  case REG_BINARY:
      buffer = SvPV(data, size);
      if (type != REG_BINARY)
       size++;  /* include null terminator in size */
      RETVAL = SUCCESS(RegSetValueEx(hkey,valname,0,type,
         (PBYTE) buffer, size));
      break;

This is what led me to try undef; somehow I want size to end up zero.
Can anyone suggest a cleaner way to do this than the above?





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

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

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