[8346] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1963 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 24 09:13:26 1998

Date: Tue, 24 Feb 98 06:00:30 -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           Tue, 24 Feb 1998     Volume: 8 Number: 1963

Today's topics:
    Re: a match problem (bis) <mj@atmm.nl>
        Answers with references Re: read char without echo (Jim Britain)
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <jdporter@min.net>
    Re: C++ parody Frank@but_dont_use_this.address
        Can't find label "START"--aborting at (Mark Kogan)
    Re: Changing Scalar Variable Name in While <jdporter@min.net>
    Re: DBM Databases - Help Please! <rjk@coos.dartmouth.edu>
        help with matching strings (Tony Chiu)
        Help: using chop($1) in this script.... <craig@skybound.demon.nl>
    Re: How to get the encrypted password string ? (Peter Samuelson)
        IIS4 Header problem <webmaster@cepharmacy.snu.ac.kr>
    Re: Learnning Perl <holcojh5@REMOVEMEwfu.edu>
    Re: Learnning Perl <beans@bedford.net>
    Re: Need some advice <brad.grove@b131.aone.net.au>
    Re: Not being able to run perl script on WinNt using Pe <hagen@bildbau.de>
    Re: Perl HTML checker Frank@but_dont_use_this.address
    Re: Perl in the movie "Sphere"? (Jon Orwant)
        Problem of passing two hashes to a function ?! Doesn't  <apb.freddyb@mailexcite.com>
    Re: Problem of passing two hashes to a function ?! Does <tchrist@mox.perl.com>
        Problem report, strange warning. (Bjorn Eriksson)
    Re: Regexp question... (Al Aab)
    Re: Safely running one-liners (Abigail)
    Re: Send email from Perl on NT platform <david.richards@alderley.zeneca.com>
    Re: The Ineffable Tom C. <joseph@5sigma.com>
    Re: why no Case statment? <jhi@alpha.hut.fi>
    Re: y2k UNIX laundry list (Peter Samuelson)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 24 Feb 1998 10:59:25 +0100
From: "M.J. Pieters" <mj@atmm.nl>
Subject: Re: a match problem (bis)
Message-Id: <6cu5jj$bmr$1@news.worldonline.nl>

Liming Wang wrote in message <6csaot$gqf@nbdchc4.bnr.ca>...
>Hello,
>
>sorry for last messsage, should be this one,
>
>#!/usr/bin/perl -w
>use strict;
>$pat = '/Foo$(xyz)';
>$str = '/A /B /Foo$(xyz) /c';
>print "ok\n" if $str =~ /$pat/;
>
>please point out why the match does not work.  TIA
>background: perl  5.004_02 on NT
>


Read
perldoc perlop
\Regexp Quote-Like Operators
and
perldoc perlre

and you'll see that $ and () are special characters in re's. Making
the pattern a scalar, and then try and match on that scalar, doesn't
escape them. It only makes it possible to use the bounding character
in the pattern (in your case a /). Add the following code before you
use a scalar in a regexp pattern, that you want to match as is:
$pat =~ s( ([][\\^.$|()*+?{}]) )(\\$1)xg;
This will escape any special characters, and make your code work. To
satisfy the use strict, your code should read:

#!/usr/bin/perl -w
use strict;
use vars qw($pat $str);
$pat = '/Foo$(xyz)';
$str = '/A /B /Foo$(xyz) /c';
$pat =~ s( ([][\\^.$|()*+?{}]) )(\\$1)xg;
print "ok\n" if $str =~ /$pat/;

Running this will print ok.

M.J. Pieters, Web Developer
| Audax Tros MultiMedia http://www.atmm.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@atmm.nl http://www.atmm.nl/~mj
 ------------------------------------------





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

Date: Tue, 24 Feb 1998 10:54:49 GMT
From: jbritain@home.com (Jim Britain)
Subject: Answers with references Re: read char without echo
Message-Id: <34f2a4e3.23015372@news>

On 23 Feb 1998 22:18:22 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>You mean other than the ways covered in perlfaq8 using POSIX or
>Term::ReadKey, chapter 7 of the Camel under POSIX, the getc function in
>perlfunc(1) or chapter 3 of the or the tsetattr stuff in Perl's POSIX(3)
>manpage?  Probably not. :-)

I'd like to thank you for answering questions with references.

What this has done for me, is when I see an interesting question, and
response -- I go look it up in the man pages, and doc files you
recommend.

One of the bigger problems with Perl is the s-p-r-e-a-d and variety of
documentation available.  In this example (for example) there are 6
references. Now, I have all 6 at hand (or at least within 6 feet).
but the EXERCISE of the comparative reading has helped me
significantly in learning my way around the ton of hidden paper and
files.

In short, you have been a pilgrim's guide.

Jim
-- 

nnnn



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

Date: Tue, 24 Feb 1998 08:29:46 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <34F2CB4A.33CA@min.net>

Bart Lateur wrote:
> 
> Why not create a censored version. Something like
> 
>         RT*M

Sometimes * (star) is used to mean "*ssh*le", so you would
still have a good acronym: Read The *ssh*le Manual.

John Porter


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

Date: 24 Feb 1998 14:35:47 +0100
From: Frank@but_dont_use_this.address
Subject: Re: C++ parody
Message-Id: <yo9u39pyvkc.fsf@nym.sc.philips.com>

Argh!

I have a dejavue feeling! Everything is falling into parts!


regards
	Frank



P.S. Some related frightening stories:

P.P.S I tried 

perl -e 'for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);'

I'm a bit relieved now.
============================================================




In an announcement that has stunned the computer industry, Ken Thompson,
Dennis Ritchie and Brian Kernighan admitted that the Unix operating system
and C programming language created by them is an elaborate April Fools
prank kept alive for over 20 years. Speaking at the recent UnixWorld
Software Development Forum, Thompson revealed the following: 

"In 1969, AT&T had just terminated their work with the GE/Honeywell/AT&T
Multics project. Brian and I had just started working with an early release
of Pascal from Professor Nichlaus Wirth's ETH labs in Switzerland and we
were impressed with its elegant simplicity and power. Dennis had just
finished reading 'Bored of the Rings', a hilarious National Lampoon parody
of the great Tolkien 'Lord of the Rings' trilogy. As a lark, we decided to
do parodies of the Multics environment and Pascal. Dennis and I were
responsible for the operating environment. We looked at Multics and
designed the new system to be as complex and cryptic as possible to
maximize casual users' frustration levels, calling it Unix as a parody of
Multics, as well as other more risque allusions. Then Dennis and Brian
worked on a truly warped version of Pascal, called 'A'. When we found
others were actually trying to create real programs with A, we quickly
added additional cryptic features and evolved into B, BCPL and finally C.
We stopped when we got a clean compile on the following syntax: 

for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("|"+(*u/4)%2); 

To think that modern programmers would try to use a language that allowed
such a statement was beyond our comprehension! We actually thought of
selling this to the Soviets to set their computer science progress back 20
or more years. Imagine our surprise when AT&T and other US corporations
actually began trying to use Unix and C! It has taken them 20 years to
develop enough expertise to generate even marginally useful applications
using this 1960's technological parody, but we are impressed with the
tenacity (if not common sense) of the general Unix and C programmer. In any
event, Brian, Dennis and I have been working exclusively in Pascal on the
Apple Macintosh for the past few years and feel really guilty about the
chaos, confusion and truly bad programming that have resulted from our
silly prank so long ago." 

Major Unix and C vendors and customers, including AT&T, Microsoft,
Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time.
Borland International, a leading vendor of Pascal and C tools, including
the popular Turbo Pascal, Turbo C and Turbo C++, stated they had suspected
this for a number of years and would continue to enhance their Pascal
products and halt further efforts to develop C. An IBM spokesman broke into
uncontrolled laughter and had to postpone a hastily convened news
conference concerning the fate of the RS-6000, merely stating 'VM will be
available Real Soon Now'. In a cryptic statement, Professor Wirth of the
ETH institute and father of the Pascal, Modula 2 and Oberon structured
languages, merely stated that P. T. Barnum was correct. 

In a related late-breaking story, usually reliable sources are stating that
a similar confession may be forthcoming from William Gates concerning the
MS-DOS and Windows operating environments. And IBM spokesman have begun
denying that the Virtual Machine (VM) product is an internal prank gone
awry. 


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

Date: Tue, 24 Feb 1998 07:11:11 GMT
From: testwv@wv.usaor.net (Mark Kogan)
Subject: Can't find label "START"--aborting at
Message-Id: <jouI.1$le6.48850@news.sgi.net>

I am getting a problem when I move a working perl program to another server 
(both are bsdi), when I run the program, labels inside subroutines are not 
seen, here is an example:  Can't find label "START"--aborting at (filename), 
even after I rewrote it to not call labels, it still opens files within 
subroutines, and then gets an error when trying to use the filehandle, so it 
is a larger problem,  Does anyone know anything which will solve this problem, 
it seems like a path issue, and I would like to avoid reinstalling perl, 
because I don't have easy access to the server.

Any help would be appreciated.

Mark Kogon


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

Date: Tue, 24 Feb 1998 08:43:44 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <34F2CE90.8D8@min.net>

Norman Bunn wrote:
> 
> Let me define the overall problem and see what the "best" solution is.  I
> have a series of parameters called PRO_01, PRO_02, PRO_03, etc. which
> contain strings delimited by colons.  However, some of the parameters are
> often empty depending on the buttons and checkboxes selected on the HTML
> form.  I want to determine which parameters are populated and store them in
> an array of arrays.
> 
> The data is of the form:
> 
> PRO_00 => description00:part number00:price00
> PRO_01 => description01:part number01:price01
> PRO_02 => description02:part number02:price02

I am assuming you mean 
  param("PRO_00") = 'description00:part number00:price00'
etc.

> I want to split each of these and store it in a unique array.   And then I
> want to store the arrays in another array.

To get the array you said you wanted, you can do this:

my @pro = map { [ split( ':', param("pro_$_") ) ] } ( '00' .. '20' );

This does not address the sparseness issue, though.

It is critical to use ( '00' .. '20' ), NOT ( 0 .. 20 ), as some
people have suggested.

hth,
John Porter


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

Date: Tue, 24 Feb 1998 01:10:42 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Burt Lewis <burt@ici.net>
Subject: Re: DBM Databases - Help Please!
Message-Id: <34F26465.BED96AFA@coos.dartmouth.edu>

[posted and mailed]

Burt Lewis wrote:
> 
> dbmopen(%corpdata, "/files/WWW/vhtdocs/eastonmass/corp/test1.txt", 0600);

dbmopen is obsolete.  You probably want to use the tie function instead.

> $therec = $corpdata{$reqkey};
> ($mfg, $name, $city) = split (/"/, $therec);
> 
> if ($therec eq "BOSTON")

Shouldn't that be $city?

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


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

Date: 24 Feb 1998 11:59:16 GMT
From: chiut5@cs.man.ac.uk (Tony Chiu)
Subject: help with matching strings
Message-Id: <6cucmk$80g$1@m1.cs.man.ac.uk>

Here is my code which is quite vague as I don't know the syntax properly:

#!/usr/common/bin/perl


open(OUT, ">match") || die;


&in_author;

sub in_author {
	open(STAFF, "staff.txt") || die "Cannot open staff.txt";
	@staff=(<STAFF>);
	open(AUTHOR, "author.html") || die "Cannot open author.html";
	
	foreach $staffname (@staff)
		{
		 while (<AUTHOR>)
			{
			  if (/$staffname/)
			  {print (grep(/$staffname/))};
			}
		}
	       }

##############

Thanks in advance,

Tony






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

Date: Tue, 24 Feb 1998 13:33:43 +0100
From: Craig <craig@skybound.demon.nl>
Subject: Help: using chop($1) in this script....
Message-Id: <34F2BE27.CF5@skybound.demon.nl>

Hi,

I'm kind of new to Perl, and I've been using this script below. I can't
figure out what the chop($1) is there for in line 38 (search_output)
procedure. I left it out and it worked fine. I'm using Windows 95 and
Perl5.

Can anybody help?

Greetings, 
Craig.


#!/usr/bin/perl5.003
#################################################################
#May not be modified without the permission of websurgeons.com  #
#Get this and many more scritps at http://www.websurgeons.com   #
#Copyright Dan Cresswell, websurgeons.com 1997                    #
#################################################################
# COPY OF SAMPLE DATABASE FILE
# Dan|Toronto|Ontario|Canada
# Joe|Calgary|Alberta|Canada
# Steve|Vancouver|British Columbia|Canada
# Alex|Los Angeles|California|United States
# Mike|Miami|Florida|United States
# John||Manitoba|Canada
# Sara|||England
# Alison|Tokyo||Japan

# Define the variables
$filename = "data.txt";  # the database file, relative or absolute path,
no URL
$numresults = 0; # the counter for matching records
&parse_form; #self explanitory
print "Content-type:text/html\n\n";
print <<HTMLHead;
<html><head><title>Database Test Page</title></head>
<body>
<CENTER><H1>Search Results</H1></CENTER>
HTMLHead
;
open(DB,$filename); # opens the file
@indata = <DB>; #dumps the data into an array
close(DB); # if you can't figure this one out ... duh!

&count_results; # call the counter sub-routine
&search_output; # calls the output sub-routine

####
sub count_results {
 foreach $i (@indata) {
  chop($1);
  ($name,$city,$province,$country) = split (/\|/,$i);
  
  if ($in{'category'} eq "name") { # this checks to see what column
you're searching
   if ($name =~ /$in{'data_in'}/i) { # checks whether the record contain
the input in this column?
    $numresults = $numresults + 1; # adds 1 to the number of matches
   }
  }
  elsif ($in{'category'} eq "city") { # this checks to see what column
you're searching
   if ($city =~ /$in{'data_in'}/i) { # checks whether the record contain
the input in this column?
    $numresults = $numresults + 1;
   }
  }
  elsif ($in{'category'} eq "province") { # this checks to see what
column you're searching
   if ($province =~ /$in{'data_in'}/i) { # checks whether the record
contain the input in this column?
    $numresults = $numresults + 1;
   }
  }
  elsif ($in{'category'} eq "country") {# this checks to see what column
you're searching
   if ($country =~ /$in{'data_in'}/i) { # checks whether the record
contain the input in this column?
    $numresults = $numresults + 1;
   }
  }
  elsif ($in{'category'} eq "all") { # this checks to see what column
you're searching(all of them in this case)
   if ($name =~ /$in{'data_in'}/i || $city =~ /$in{'data_in'}/i ||
$province =~ /$in{'data_in'}/i || $country =~ /$in{'data_in'}/i) {
   # checks whether the record contain the input in this column?
    $numresults = $numresults + 1;
   }
  }
 }
 print "Your search for \"$in{'data_in'}\" in \"$in{'category'}\"
produced<B> $numresults </B>results.<BR>\n";
}
####
####
sub search_output {
 print "<table border=1>\n";
 print
"<tr><th>Name</th><th>City</th><th>State/Province</th><th>Country</th></tr>\n";

 foreach $i (@indata) {
  chop($i);                    
  ($name,$city,$province,$country) = split(/\|/,$i);

  if ($name eq "") { # checks whether the field is empty
   $name = "\&nbsp\;"; # Fills the empy field with an HTML space so
table has proper look
  }
  if ($city eq "") { # checks whether the field is empty
   $city = "\&nbsp\;"; # Fills the empy field with an HTML space so
table has proper look
  }
  if ($province eq "") { # checks whether the field is empty
   $province = "\&nbsp\;"; # Fills the empy field with an HTML space so
table has proper look
  }
  if ($country eq "") { # checks whether the field is empty
   $country = "\&nbsp\;"; # Fills the empy field with an HTML space so
table has proper look
  }
  
  if ($in{'category'} eq "name") { # this checks to see what column
you're searching
   if ($name =~ /$in{'data_in'}/i) { # checks whether the record contain
the input in this column?
    # adds the row to the output table
    print "<tr>\n";
    print "<td>$name</td>\n";
    print "<td>$city</td>\n";
    print "<td>$province</td>\n";
    print "<td>$country</td>\n";
    print "</tr>\n";
   }
  }
  elsif ($in{'category'} eq "city") { # this checks to see what column
you're searching
   if ($city =~ /$in{'data_in'}/i) { # checks whether the record contain
the input in this column?
    # adds the row to the output table
    print "<tr>\n";
    print "<td>$name</td>\n";
    print "<td>$city</td>\n";
    print "<td>$province</td>\n";
    print "<td>$country</td>\n";
    print "</tr>\n";
   }
  }
  if ($in{'category'} eq "province") { # this checks to see what column
you're searching
   if ($province =~ /$in{'data_in'}/i) { # checks whether the record
contain the input in this column?
    # adds the row to the output table
    print "<tr>\n";
    print "<td>$name</td>\n";
    print "<td>$city</td>\n";
    print "<td>$province</td>\n";
    print "<td>$country</td>\n";
    print "</tr>\n";
   }
  }

  if ($in{'category'} eq "country") { # this checks to see what column
you're searching
   if ($country =~ /$in{'data_in'}/i) { # checks whether the record
contain the input in this column?
    # adds the row to the output table
    print "<tr>\n";
    print "<td>$name</td>\n";
    print "<td>$city</td>\n";
    print "<td>$province</td>\n";
    print "<td>$country</td>\n";
    print "</tr>\n";
   }
  }
  elsif ($in{'category'} eq "all") { # this checks to see what column
you're searching
   if ($name =~ /$in{'data_in'}/i || $city =~ /$in{'data_in'}/i ||
$province =~ /$in{'data_in'}/i || $country =~ /$in{'data_in'}/i) {
   # checks whether the record contain the input in this column?
    # adds the row to the output table
    print "<tr>\n";
    print "<td>$name</td>\n";
    print "<td>$city</td>\n";
    print "<td>$province</td>\n";
    print "<td>$country</td>\n";
    print "</tr>\n";
   }
  }
 }
}
####
print "</table>\n";
print "</body></html>\n";
####
sub parse_form { # DO NOT MODIFY
 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
 @pairs = split(/&/, $buffer);
 foreach $pair (@pairs) {
  ($names, $value) = split(/=/, $pair);
  $value =~ tr/+/ /;
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  $value =~ s/<!--(.|\n)*-->//g;
  $in{$names} = $value;
 }
}


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

Date: 23 Feb 1998 23:48:35 -0600
From: psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson)
Subject: Re: How to get the encrypted password string ?
Message-Id: <6ctmvj$vpa$1@sampo.creighton.edu>

[Baher M. Safwat <bsafwat@egyptonline.com>]
> I use Solaris 2.5.1 on Sun Ultra1

I don't.  So I'm sort of guessing.

> when using the perl function to get the password of a certain user
> it return the "x" from the /etc/passwd file instead of the encrypted
> string from the /etc/shadow

Perl borrows a lot of functionality from your C library, including
functions like getpwnam().  In the Digital Unix 3.2 manpage for
getpwnam(3), it states:

    If the password is not stored in the /etc/passwd file and the
    invoker does not have access to the shadow file that contains them,
    this field will contain an unencryptable string, usually an !
    (exclamation point).

So -- at least on OSF/1 -- it should work properly if you're root.  (We
don't use shadow passwords, so I can't verify this.)  If you aren't
root, you don't have any business reading encrypted passwords -- that
would defeat the whole purpose of shadow passwords.  Note that if you
are using NIS, you may be able to defeat this scheme by parsing `ypcat
passwd`.  (IIRC Solaris uses NIS+, which might have fixed that hole.)

If you need to install something setuid root to get at the password
file (xlock comes to mind, for example, as well as the app you're
describing), consider instead making /etc/shadow (or whatever)
group-readable to a special group, then making the programs setgid
instead.  Probably more secure.

-- 
Peter Samuelson
<sampo.creighton.edu ! psamuels>


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

Date: Tue, 24 Feb 1998 16:42:15 +0900
From: cepharm <webmaster@cepharmacy.snu.ac.kr>
Subject: IIS4 Header problem
Message-Id: <34F279D7.FE1E07C1@cepharmacy.snu.ac.kr>

Hi. I have a trouble.

I wrote a BBS CGI on Linux machine. It worked well.
And one month later, when I tried to use it on WindowsNT(IIS 3.0), I
experienced failure.

Netscape showed a dialog saying "will you save this link? or pick an
application...",
and MSIE showed MIME header like "Content-type: text/html" at the top of
document.

When I told it to my senior, he told me to add "HTTP1.0/ 200 OK" http
header,
And I did it, and worked well. At least I thought.

But..

Having installed Internet Information Server 4.0, and MSIE 4.0, I
experienced another
failure. Netscape 4.0 works well, but MSIE 4.0 showed the header,
"HTTP1.0/ 200 OK Content-type: text/html " at the top of document.

Is this the bug of MSIE 4.0 ?

- scgyong@nownuri.net -



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

Date: Tue, 24 Feb 1998 01:52:06 -0500
From: Philosopher King <holcojh5@REMOVEMEwfu.edu>
To: Michael Fabrico <MFabrico@ix.netcom.com>
Subject: Re: Learnning Perl
Message-Id: <34F26E16.11E52F8B@REMOVEMEwfu.edu>

Michael Fabrico wrote:
> 
> Hello:
> 
>   I'm VERY new to perl.  I have little programming skills...  Can anyone
> help???
> 
> Michael Fabrico
> mfabrico@ix.netcom.com

Get a copy of _Learning_Perl_ by Randal Schwartz and Tom Christiansen 
as soon as you can. You should be able to find it in any book store,
or you can order it over the web from http://www.ora.com or some other
bookstore.

Good luck,

Heath

-- 
Heath Holcomb                  * they don't know what to call it 
holcojh5@REMOVEMEwfu.edu       * but they all say it's wrong
holcomb@REMOVEMEmthcsc.wfu.edu * well, I don't see no greener pastures
http://www.wfu.edu/~holcojh5   * this must be where I belong


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

Date: 24 Feb 98 12:17:34 GMT
From: "TomH" <beans@bedford.net>
Subject: Re: Learnning Perl
Message-Id: <01bd40e3$a2217f20$119163ce@beans.bedford.net>

http://www.perl.com

There is a Tutorial here.

 ...> 
>   I'm VERY new to perl.  I have little programming skills...  Can anyone
> help???
 ...


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

Date: Tue, 24 Feb 1998 22:58:53 +1100
From: "Brad Grove" <brad.grove@b131.aone.net.au>
Subject: Re: Need some advice
Message-Id: <6cug99$mbi$1@news.mel.aone.net.au>

It is OK! I think I know how this can be done. Going to approach the thing
from a whole new direction.

Jonathan Feinberg wrote in message ...
>pyefinch@b130.aone.net.au said...
>: I have developed a bulk emailing script which will read our web database
and
>: email each of our customers in the database. For each record in the
>: database, it simply checks for a valid email address etc and passes the
data
>                      ^^^^^^ ^^^ ^ ^^^^^ ^^^^^ ^^^^^^^
>Them's fightin' words 'round these parts.  It can't really be done.
>
>: It seems to work well except it does not send any response back to
>: the browser until the script has completed.
>
>You'll have to do a little research, but the idea is to make an nph script.
>Use CGI.pm, thus:
>
>   use CGI qw/ :standard :nph /;
>
>Some servers require you to name the script "nph-whatever.cgi" in order to
>expect the fancy headers...  Anyway, I'm leaving clpm territory, so I'll
stick
>with tradition and exhort you to RTFM (CGI.pm, your server, etc.).  Oh
yeah,
>remember to
>
>   $|=1;
>
>--
>#!/usr/bin/perl -w --                     Just another Perl hacker,
>(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
>y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
># Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY




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

Date: Tue, 24 Feb 1998 10:17:13 -0000
From: "Hagen Seyring" <hagen@bildbau.de>
Subject: Re: Not being able to run perl script on WinNt using Peer Web Server
Message-Id: <34f299ac.0@news.sireco.de>

You have to add a entry in the registry under
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlset/Services/W3SVC/Parameters/Script
Map/

Put the Extension of your CGI-Script like ".pl" in the field name and the
path of the programm that calls your script in the value field like
"c:\Perl\bin\perl.exe %s %s"

Then you have to restart your Peer Web Server.

Than you have to put your cgi-script like "cgi-bin" in a directory that only
allows execute script don4t read

Hagen

Manohar Uchil schrieb in Nachricht <34F259EC.997ECEC1@citicorp.com>...
>I have installed Perl5.003 and the corresponding registry entries have
>been modified (as a part of the installation process). I have placed a
>perl  script(.pl file) at c:\inetpub\wwwroot and I am trying to run this
>by calling this script through a post action in another file placed in
>the same directory. The error code is 501.
>Though this perl script is running fine from command prompt.
>
>Please help.
>
>Thanks.
>






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

Date: 24 Feb 1998 14:39:00 +0100
From: Frank@but_dont_use_this.address
Subject: Re: Perl HTML checker
Message-Id: <yo9sop9yvez.fsf@nym.sc.philips.com>

ftp://ftp.cre.canon.co.uk/pub/weblint/weblint.tar.gz
regards
	Frank


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

Date: 23 Feb 1998 21:20:46 GMT
From: orwant@cyrano.media.mit.edu (Jon Orwant)
To: mcafee@battlezone.rs.itd.umich.edu (Sean McAfee)
Subject: Re: Perl in the movie "Sphere"?
Message-Id: <ORWANT.98Feb23162046@cyrano.media.mit.edu>


mcafee@battlezone.rs.itd.umich.edu (Sean McAfee) writes:

   I just got back from seeing the new movie "Sphere", and I think I saw part
   of a Perl script on a computer screen at one point.  Perhaps someone else
   can verify this, having also seen it or looking for it in the future...

If anyone can positively identify the code, I'd love to mention it
in the next issue of The Perl Journal.  

We've already had some good press from denverbroncos.com using mod_perl.

-Jon

------------------------------------
Jon Orwant            http://tpj.com
Editor & Publisher, The Perl Journal

--


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

Date: Tue, 24 Feb 1998 09:05:34 -0500
From: "Alfred P. Bartholomai" <apb.freddyb@mailexcite.com>
Subject: Problem of passing two hashes to a function ?! Doesn't work.
Message-Id: <34F2D3AD.B2091680@mailexcite.com>

SUBJECT: Problem of passing two hashes to a function ?! Doesn't work.

2/24/98

----------------------------
% perl -v

This is perl, version 5.004_04 built for sun4-solaris

----------------------------
Below is a runnable SHORT SHORT perl script which gives an example of
my problem of passing two hashes to a function.

You can take this script and run it to see the results.
Below the script is the output of the script.

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

#!/usr/local/bin/perl

$List1{ "one" } = "1";
$List1{ "two" } = "2";
$List1{ "three" } = "3";

$List2{ "twenty" } = "20";
$List2{ "twenty-one" } = "21";
$List2{ "twenty-two" } = "22";

ShowHashValues( "List1", %List1 );
ShowHashValues( "List2", %List2 );

# I am having problems passing two or more hashes to a function.
# Why ? How can I get around this ?
Show( %List1, %List2 );

exit 0;


sub Show
{
    printf( "\nShow\n" );
    my( %List1, %List2 ) = @_;

    ShowHashValues( "List1", %List1 );
    ShowHashValues( "List2", %List2 );
}

sub ShowHashValues
{
    my( $Title, %List   ) = @_;

    printf( "\n:%s:\n", $Title );

    while ( ( $Token, $Value ) = each ( %List ) )
    {
        printf( "Token: %s - Value: %s\n", $Token, $Value );
    }
}

----------------------------
Below is the output of running hash_test
----------------------------

** 142 ** < fredb@deathstar > ** /home/fredb/scripts/perl **
% hash_test

:List1:
Token: three - Value: 3
Token: one - Value: 1
Token: two - Value: 2

:List2:
Token: twenty-one - Value: 21
Token: twenty-two - Value: 22
Token: twenty - Value: 20

Show

:List1:
Token: three - Value: 3
Token: two - Value: 2
Token: one - Value: 1
Token: twenty-two - Value: 22
Token: twenty-one - Value: 21
Token: twenty - Value: 20

:List2:

----------------------------
The result is that when I pass two hashes to a function. The first hash
is a composite of the first and second hash. The second hash passed is
empty.
Why ?



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

Date: 24 Feb 1998 13:52:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Problem of passing two hashes to a function ?! Doesn't work.
Message-Id: <6cujaq$llj$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, apb.freddyb@mailexcite.com writes:

>The result is that when I pass two hashes to a function. The first hash
>is a composite of the first and second hash. The second hash passed is empty.

Because those are the rules.  Please reread the fine perlsub(1) manpage.
This is covered right at the front:

       The Perl model for function call and return values is simple:
       all functions are passed as parameters one single flat list of
       scalars, and all functions likewise return to their caller one
       single flat list of scalars.  Any arrays or hashes in these call
       and return lists will collapse, losing their identities--but
       you may always use pass- by-reference instead to avoid this.
       Both call and return lists may contain as many or as few scalar
       elements as you'd like.  (Often a function without an explicit
       return statement is called a subroutine, but there's really no
       difference from the language's perspective.)

You'll also find this answered in perlfaq7(1)

    How can I pass/return a {Function, FileHandle, Array, 
    Hash, Method, Regexp}?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
In general, if you think something isn't in Perl, try it out, because it
usually is.  :-)
        --Larry Wall in <1991Jul31.174523.9447@netlabs.com>


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

Date: Tue, 24 Feb 1998 10:48:35 +0100
From: mdeans@algonet.se (Bjorn Eriksson)
Subject: Problem report, strange warning.
Message-Id: <MPG.f5cb5da834d476c989681@news.algonet.se>

This is part of the output:
-----------------CUT---------------
{0,PARM:D}~0~~0~
Use of uninitialized value at dxf2pg.pl line 371, <IN> chunk 12670 (#1)
377{Block TEST_D got  parameters
-----------------CUT---------------
from this part of a larger program:

$ntmp = !$parms_needed{$insblockname} ? 0 : $parms_needed{$insblockname};
print STDERR "~$args_consumed~";
print STDERR "~$ntmp~\n";
print STDERR "$ntmp != $args_consumed" if $ntmp != $args_consumed;
if ( $ntmp != $args_consumed ) { #Im line 371
	$zz = "";
	printf(STDERR "(%d, %d) Block /$insblockname:%s/ ", 
$args_consumed, $parms_needed{$insblockname}, $attstr);
	die "needs $ntmp parameters, stopped" if 
$parms_needed{$insblockname};
	die "($insblockname) doesn't want parameters 
($ntmp,$parms_needed{$insblockname} != $args_consumed), stopped";
} else {
	print STDERR __LINE__, "{Block $insblockname got 
$parms_needed{$insblockname} parameters\n";
}

 How is it possible for line 371 to give me a 'Use of uninitialized 
value'-
warning when line 369 doesn't? I started adding lines to see if I could
isolate the problem but it seems to be a problem with perl. I using:

This is perl, version 5.004_02

Copyright 1987-1997, Larry Wall


MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis
djgpp v2 port (jpl5003c) by Hirofumi Watanabe, 1996
djgpp v2 port (perl5004) by Laszlo Molnar, 1997

Perl may be copied only under the terms of either the Artistic License or 
the
GNU General Public License, which may be found in the Perl 5.0 source 
kit.

PS. I tried the $SIG{__WARN__} but it doesn't give me any more info. DS.

//Tata


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

Date: Tue, 24 Feb 1998 09:06:20 GMT
From: af137@torfree.net (Al Aab)
Subject: Re: Regexp question...
Message-Id: <EovLAK.n2G.0.queen@torfree.net>

		sed "s/  *$//" infile > outfile

-- 
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator                                      sed u soon 
               it is not zat we do not see the  s o l u t i o n          
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+


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

Date: 24 Feb 1998 07:45:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Safely running one-liners
Message-Id: <6cttr7$arm$1@client3.news.psi.net>

Danny Aldham (danny@lennon.postino.com) wrote on 1638 September 1993 in
<URL: news:6ctlft$3st$1@lennon.postino.com>:
++ X-Newsreader: TIN [version 1.2 PL2]
++ 
++ A lot of posters here have .sigs that include perl one liners.
++ Is there a safe way to run them, and be assured that they wont
++ damage and/or erase files?  (or e-mail off my shadow file)

Just make sure you understand it ;)


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 24 Feb 1998 08:34:19 GMT
From: "Zeneca" <david.richards@alderley.zeneca.com>
Subject: Re: Send email from Perl on NT platform
Message-Id: <01bd40ff$003bd040$55a0479c@UKMCPHISFW051.ukmcphmfg.zeneca.com>

use BLAT 

Rick Ryan <rickryan@datrixnet.com> wrote 

> Is there a was to send email from a Perl script on the NT platform? 



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

Date: Mon, 23 Feb 1998 22:41:40 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: The Ineffable Tom C.
Message-Id: <34F25D8B.E119C28D@5sigma.com>

Personally I wish Tom would email the sarcastic one-liners and not
post them.  Not so much because of the noise it directly creates in 
the newsgroup but because every time he does, a flood of imitators
arises, and then every FAQ posted gets a half dozen "that's an FAQ"
replies instead of one.

The only reason Tom elicits this response is because people respect
his opinion and judgment, and that obviously arises from an otherwise
exemplary history of contribution to the Perl community.  So I would
hope people would accept Tom being Tom, but at least where the
snappy comebacks are concerned, not imitate him.

	-joseph

John Callender wrote:
> 
> At the same time, the "value" of Tom's participation in the group for a
> given user varies greatly depending on that user's level of
> sophistication. For newbies, sarcastic one-liners, [...]

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: 24 Feb 1998 10:24:57 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: why no Case statment?
Message-Id: <oeek9alxvdy.fsf@alpha.hut.fi>


Randal Schwartz <merlyn@stonehenge.com> writes:

> 
> >>>>> "Jarkko" == Jarkko Hietaniemi <jhi@alpha.hut.fi> writes:
> 
> Jarkko> If you can answer these questions, well, then you can write the
> Jarkko> if-elseif-else.
> 
> What's "elseif" ?
> 
> :-)

Freudian slip? 

:-)

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 24 Feb 1998 00:29:13 -0600
From: psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson)
Subject: Re: y2k UNIX laundry list
Message-Id: <6ctpbp$vi6$1@sampo.creighton.edu>

[Steve Dover <swd@strata-group.Xcom>]
> I'm curious as to why some of the perl maintainers think
> Perl 4 has different Y2k issues than Perl 5.

I've always assumed it's a clever little red herring.[1]  For many years
now, we've been trying to convince the world that Perl4 is deader than
comp.lang.perl and that they must stop using it.[2]  One way is to point
out that Perl4 has known security problems.  That gets attention.  But
even talking about security isn't as potent as mentioning Y2K
compliance.  If some middle manager somewhere gets the notion that
Perl5 is more Y2K-compliant than Perl4, it'll almost certainly help
push the case for an upgrade.  I smile every time I read that "there
are no plans to make Perl4 Y2K-compliant" or whatever the official
phrase is.

[1] Someone please correct me if I'm wrong.
[2] The real reasons to upgrade to Perl5 are legion, but most of them
    don't sound too concrete to non-programmers.

-- 
Peter Samuelson
<sampo.creighton.edu ! psamuels>


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

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

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