[8752] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2369 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 15:17:31 1998

Date: Tue, 21 Apr 98 12:00:33 -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           Tue, 21 Apr 1998     Volume: 8 Number: 2369

Today's topics:
        2 newbie questions <mbell@thedomaingroup.com>
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
        animated gifs (Richard Pocklington)
    Re: Array / List question <jdporter@min.net>
    Re: Attempt to speed up rand() (Mark Waterous)
    Re: Beep to another NT-workstation <perlguy@inlink.com>
    Re: CGI help for a newbie, easy question <mindmore@mindless.com>
    Re: DateTime manipulation <rjk@coos.dartmouth.edu>
    Re: Easy way to count lines in a file <keithmur@mindspring.com>
    Re: Eat my dust - Perl running on Windows 95 (Petr Prikryl)
        Expand wildcards shellishly <dfetter@shell4.ba.best.com>
    Re: Help sorting nested hashes by value (Jason Gloudon)
    Re: Help, I'm going Perl-bald! <perlguy@inlink.com>
    Re: How do I get the name of each file in a dir? (Petr Prikryl)
        How Send Mail: PERL to VB Translators?! <hamilton@melbpc.org.au>
    Re: how to change password in netscape webserver with a <sneaker@earthling.net>
    Re: How to get clock ticks or calculate elapsed time le <quentin@jihad.amd.com>
        Idea-- Command promt through www page? <mindmore@mindless.com>
    Re: Idea-- Command promt through www page? <sneaker@earthling.net>
    Re: Java Script in CGI <perlguy@inlink.com>
    Re: Netscape Perl?  Beginner question <sneaker@earthling.net>
    Re: Netscape Perl?  Beginner question <perlguy@inlink.com>
    Re: Parser works sometimes (Martien Verbruggen)
    Re: Problem With "gethostbyaddr". <Rodney.Wines@ahqps.alcatel.fr>
    Re: Project question and gripe about (Re: Snobby news g (Chris  & Sheila King)
    Re: Regexp question (Ilya Zakharevich)
    Re: Regular Expression to match a valid IP address <rjk@coos.dartmouth.edu>
    Re: Regular Expression to match a valid IP address <Patrick.Hayes.CAP_SESA@renault.fr>
    Re: Setuid is dangned near impossible (Jason Gloudon)
    Re: Snobby news group (Georg Bauer)
    Re: srand and rand fx (brian hiles)
        subtitube variable into system command <johnvun@asiapac.net>
    Re: suggested research methods? lvirden@cas.org
        using unpack to generate checksums. (Fergus McMenemie)
        VB DLL and Perl (Steve)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 Apr 1998 22:40:52 GMT
From: "Matthew Bell" <mbell@thedomaingroup.com>
Subject: 2 newbie questions
Message-Id: <01bd6cad$ceeea410$8eeb42cf@priscilla>

1. Can someone point me to a set of FAQs that would be understandable to a
non-UNIXhead?  I'm teaching myself Perl on NT, using the Camel book, but I
need more basic beginning help since examples like "It's just like grep or
awk, except for the ...." don't mean much to me, never having used grep or
awk.

2. I'm trying to write a line of code that will strip an ending space
character from a string, and it's not working.  Here's what I've written:
********
$teststring = "one space at end ";

open(TEST,">tester.txt");
print TEST "$teststring\n";

$_ = $teststring;

if (/$ /) {
 print "Found space at end\n";
}
else {
 print "No space found at end\n";
}

s/$ //g;				# substitute any space char at END of line w/nothing
					#  and repeat until string is clean of space char at end
print TEST "$teststring\n";

exit[0];
*******
I thought "/$ /" meant "match at the end of the string [space character]",
but I continually get "No space found at end" as a result of my "if" test,
and $teststring doesn't change after the attempt at substitution -- what's
wrong with my code?  Thanks.

-- 
Matthew Bell
MBell@TheUNSPAMDomainGroup.com
(remove the obvious to reach me directly)


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

Date: Tue, 21 Apr 1998 10:24:02 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage893154242.9598@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 12 April 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The Perl FAQ is modified frequently; the last major
update was in Spring of 1997. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

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

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
403_662_481 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

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

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

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


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

Date: 21 Apr 1998 10:10:56 -0700
From: richard1@leland.Stanford.EDU (Richard Pocklington)
Subject: animated gifs
Message-Id: <6hijv0$ms5@epic14.Stanford.EDU>
Keywords: animate gif perl GD

hi

anyone make animated GIFs with GD?


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

Date: Tue, 21 Apr 1998 16:55:39 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Array / List question
Message-Id: <353CD10A.E7F@min.net>

Larry Rosler wrote:
> 
> John Porter wrote in message <353B9AF4.146C@min.net>...
> >A.P. wrote:
> >> John Porter wrote:
> ...
> >  DB<1> @i = (1,2,3,4);
> >
> >In other words, @i**2 squares the number of elements in @i;
> >@i[@i]**2 squares the last element in @i.  Are these the same?
> >Are 0 and 16 the same?  Does ( 0 == 16 ) evaluate True?
> 
> I'm baffled by this.  What does @i[@i] have to do with the last element
> in @i?  As I read this, it is an array slice, whose value for the data
> shown above should be ( 2, 3, 4, undef ).  

I should have said "squares the last element in the slice", which in
this case is undef.

I was really thinking of the case of an identity array; that is,
when @i = (0..$n), @i[@i] == @i.

John Porter


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

Date: Tue, 21 Apr 1998 04:17:16 GMT
From: mail@silas.hypermart.net (Mark Waterous)
Subject: Re: Attempt to speed up rand()
Message-Id: <353bfe66.37353707@news.bctel.ca>

On Sun, 19 Apr 1998 15:01:49 -0400, kpreid@ibm.net (Kevin Reid) wrote:

>Mark Waterous <mail@silas.hypermart.net> wrote:
>
>>       I have a short script that I wrote, mostly as a quick practice
>> of my perl, but what it does is it loads a random page, depending on
>> the result returned by the rand() function. The script is short, and
>> looks like this:
><snip> 
>>       What I am attempting to do now, though I don't know if it's
>> possible, is to speed up the process a bit.
>
>> --[begin default.pl]--
>> #!/usr/local/bin/perl -w
>> use diagnostics;
>
>There's the problem. Remove "use diagnostics" and your script will start
>much faster. You probably don't need it anyway except while debugging.

	Actually, I realized that myself soon after posting. Running
from the command line, it appeared to jump right into the script
instead of halting for that second before it did. I still got at least
one more helpful response that 'optimized' the code in another way,
that I may find useful in the future, or at least interesting to know.
So although I solved my own problem (in a sense), I still got other
help that was unlooked for. Thanks,



_________________________________
Mark Waterous - Silas Productions Online

"Your entrance to a world of information..."
                          http://silas.hypermart.net/


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

Date: Tue, 21 Apr 1998 10:24:25 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Beep to another NT-workstation
Message-Id: <353C73D9.16336BCA@inlink.com>

Have you tried:

`net send <username> beep`;

or you could try:

$command="net send <username> beep;
system($command);

???

If you can type it on the command-line, you can usually do the same
thing with the ` `'s

HTH,

Brent


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

Date: Tue, 21 Apr 1998 12:18:11 +0300
From: Fain <mindmore@mindless.com>
To: Andrew Connell <jconnell@lords.com.nospam>
Subject: Re: CGI help for a newbie, easy question
Message-Id: <353C6453.A136D1D7@mindless.com>

It's a syntax problem...
The problem is on the very last line with the very last character.

Change (last line):
END_of_Multiline_Text;
To:
END_of_Multiline_Text

Simple aye... I tried your script like this and had no problems. So, if for
some strange reason this doesn't work... write me.

- Nathan
mindmore@mindless.com
You wouldn't believe how many errors like this I make in a day, it's a
something God has given me personally :)


Andrew Connell wrote:

> I am new to cgi scripting, but i am familiar with perl.  However, I have yet
> to make it work.  I have put a script which I know works in that directory
> (I know it works because it is straight off a tutorial site).  I have tried
> the chmod 0755 to the file, but I continue to get the "Internal Server
> Error: The server encountered an internal error or misconfiguration and was
> unable to complete your request." error.  Anyone see anything that I am
> doing wrong or things I should check on?  Please email responses.
>
> A copy of the script as well as the URL is located below:
> http://jconnell.host4u.com/CGI-bin/howdy.pl
>
> #!/user/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;
>
> ------
> 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-





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

Date: Tue, 21 Apr 1998 00:12:50 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: DateTime manipulation
Message-Id: <353C1CC4.13E26226@coos.dartmouth.edu>

nmoni@hotmail.com wrote:
> 
> I need to manipulate dates and times. So I am on a look out for a reliable
> module which helps to increment dates, check if it a leap year etc. Do any of
> you know of any such module. I would appreciate ANY pointers I could get.
> Thanks and have a great day.

Have you looked on CPAN <http://www.perl.com/CPAN/README.html>?  If there were
any such modules, they'd probably have the word 'Date' in their names...

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


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

Date: Mon, 20 Apr 1998 17:41:41 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <353BCF25.31E392FE@mindspring.com>

Shawn Gordon wrote:
> 
> Hi Harold
> 
> > Is there an easy way to count the number of lines a file has?
> [clip]
> >
> > while (<ACCESS>) {
> >     counter++;
> > }
> > print "You have $counter lines in this file\n";
> >
> 
> How about:
> 
> $lines = scalar(@_ = <ACCESS>);
> 
Fine, except that I find:

$lines = (@_ = <ACCESS>);

works also.

I had thought that perhaps I could do:

$lines = (<ACCESS>);

or maybe

$lines = ((<ACCESS>));

but in such cases Perl outsmarts me and refuses to evaluate the
filehandle in a list context before it goes to scalar context, so the
assign to @_ seems necessary, unless there's something clever someone
else knows...
> shawn


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

Date: 21 Apr 1998 09:36:06 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <6hhpa6$ndn$2@boco.fee.vutbr.cz>

Ronald J Kimball (rjk@coos.dartmouth.edu) wrote:
>ELSS Admin wrote:
>> 
>> Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
>> (486 dx-66)

>I have Perl running on four DOS machines at work.  What's your point?  :-)

Do read carefully the message! Do you also have that much fun of it ;-)

--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz)   http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering;    tel. +420-(0)5-7275 218


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

Date: 20 Apr 1998 22:34:31 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Expand wildcards shellishly
Message-Id: <6hgihn$m5d$2@nntp1.ba.best.com>

Kind people,

In the course of working with an O^H^H^H legacy database, I've found a
profound lack of wildcardishness in matching strings, so I'd like
to build a wildcard expander in perl, which would work like this:

Wildcard_Expand('.*([a-c]foo|[d-f]bar)?') would return the following
list:

%afoo_
%bfoo_
%cfoo_
%dbar_
%ebar_
%fbar_

What references should I be consulting?
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

Quartz glyph jocks vend, fix, BMW.


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

Date: Tue, 21 Apr 1998 03:45:45 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: Help sorting nested hashes by value
Message-Id: <slrn6jo5j5.798.jgloudon@hyssop.bbn.com>

Don Silvia <lyanddon@peapod.com> wrote:
>%Data   %Route    %Point
>----- ----------  -------  ------
>$Data{'Route_21'}{'72586'}{'Sta'} = "21856.3";
>$Data{'Route_21'}{'72588'}{'Sta'} = "21870.3";
>$Data{'Route_19'}{'70351'}{'Sta'} = "19871.3";
>$Data{'Route_19'}{'70352'}{'Sta'} = "19901.5";
[above condensed]
>What I need to do is to print a list of Points, sorted by the value of their
>'Sta' keys.  So I tried something like this:  (I know this example doesn't
>work)

Since you want to sort the points, you need to extract the list of points from
the structure you have:

@sortedpts=     map { $_->[0] }
		sort { $a->[1] <=> $b->[1] }
		# Outputs list of (points, 'Sta') for all routes
		map {	
		        # Outputs list of (points, 'Sta') values for this route
			map { 
				[ $_, $_->{'Sta'} ]
			} 
			keys %{$_} # name of points for each route
		} 
		values %Data;  # hash references of each route

This is a schwartzian transform of a pretty grotesque nature.

If you have to do this often in your code it may be worth considering changing
the ordering of your keys. Ie. $data{'Sta'}{'Point'}{'Route'}, as you can
achieve the results of this sort a lot more simply.

--
Jason Gloudon


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

Date: Tue, 21 Apr 1998 10:42:38 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Help, I'm going Perl-bald!
Message-Id: <353C781E.92A48714@inlink.com>

Now come on, I am not a Microsoft lover but I use it where I work,
through no fault of my own, and it is a very stable system.  I did try
IIS 4.0 and gave up so I am back to 3.0.  But, I have developed and run
a complete document management system that checks user rights, has
check-in/out capabilities, ... just using NT 4.0, IIS 3.0 and Perl.

Perl is the question at hand here and it is my "tool of choice".  I use
it on several flavors of UNIX and also NT.  It is reliable and stable on
every system I have used it on.

Brent Michalski
Web Geek

David Fetter wrote:
> 
> msbzdragn@hotmail.com wrote:
> > Heeeeeelllllppp!!!!!
> 
> > I'm going bald prematurely, and all because I've just become a newbie... ;)  I
> > just started playing around with Perl and CGI for a project I am trying to do
> > at work, and I'm completely baffled...
> 
> > I've got a web server (Sambar, http://www.sambar.com) running on
> > Windows NT Server 4.0,
>   ^^^^^^^^^^^^^^^^^^^^^
> Aha!  That's your problem.  While Perl can run on Windows boxen thanks
> to the Herculean efforts of many fine developers, said boxen are still
> intrinsically buggy and unstable.  To make full use of your box, get
> Linux, install Apache and Perl, and watch it do magic.
> 
> The easiest distribution I've found so far is Red Hat 5.0, which
> installs both Apache and Perl by default.
> 
> HTH,
> Dave.
> --
>             David Fetter         888 O'Farrell Street Apt E1205
>    shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
>   http://www.best.com/~dfetter     +1 415 567 2690 (voice)
> print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)
> 
> Now they show you how detergents take out bloodstains, a pretty
> violent image there. I think if you've got a T-shirt with a bloodstain
> all over it, maybe laundry isn't your biggest problem.  Maybe you
> should get rid of the body before you do the wash.
>                                        Jerry Seinfeld


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

Date: 21 Apr 1998 09:32:23 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <6hhp37$ndn$1@boco.fee.vutbr.cz>

Fain (mindmore@mindless.com) wrote:
>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?
[...]
>> print `ls`;
[...]
>Why use a whole function for something that you can do as simply as
>that?  - NAthan

Because Perl, fortunately, runs also on OS's which are far from Unix
concerning the good and simple functionality.  The Perl helps to solve
many problems which were not included into Unix ;-)  You may ask
"Why people use other OS than Unix?".  Commercial reasons -- they want
to pay for it :-)

                       Petr

--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz)   http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering;    tel. +420-(0)5-7275 218


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

Date: Tue, 21 Apr 1998 19:54:16 +1000
From: "David Hamilton" <hamilton@melbpc.org.au>
Subject: How Send Mail: PERL to VB Translators?!
Message-Id: <01bd6d0b.7279e1a0$2e9c0ccb@aclpcr1>

I am wondering if anyone can help me?
I want to know how to send an E-Mail from a Visual Basic 4 CGI, using a
mail program already on the server.  I think it is just a matter of
SENDing the info to the program, but I don't know how to direct this info
to the mail program.

The PERL equivalent of what I want to do goes something like this and I
need to know how I would express the first line of this in visual basic,
as I assume the 'print MAIL "Subject: ";' is equal to 'Send ("Subject: ")
in VB.

open (MAIL, $mailprog -t)
print MAIL "Subject: ";
print MAIL "To: ";

Thanks,
>From David Hamilton.


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

Date: Tue, 21 Apr 1998 09:47:12 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: how to change password in netscape webserver with a CGI?
Message-Id: <353C6983.8B83A731@earthling.net>

ender@mythen.ch wrote:

> Hi All
>
> We have many users defined in a Netscape Enterprise Server 2.0
> Database. Now the maintenance takes a lot of time and only the server
> administrator can change user data.
> It would be very useful if users could change their passwords by
> themselves over the Web or if some users would be able to create new
> user accounts.
> Does anyone know how to implement this with a CGI in Perl?
> Thanks in advance.
>
> Josi

 At www.perl.com you will find some examples and coding possibilities.
Look under Security and/or search for htaccess and what not.

Lincon Stein wrote a User Manage system which may be just what
you are looking for.

I wrote a WebPass package that changes the Unix passwd, but something
similar could be done easier for a Netscape-type User Database, only
problem I see is - there is a well known incompatibility between the
Salt generated and used with the crypt function and the User Database
for
Netscape.  At Netscape's home site, research this and you may find that
either upgrading to NSE3.0 or possibly using another WWW server
may more advantagous.  I resolved the problem by using the
/etc/passwdfile as my user database and then using the WebPass
system to manage passwds, etc...

HTH,
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|




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

Date: 20 Apr 1998 17:04:37 -0500
From: Quentin  Fennessy <quentin@jihad.amd.com>
Subject: Re: How to get clock ticks or calculate elapsed time less than a second
Message-Id: <ximogxwdua2.fsf@jihad.amd.com>

>>>>> "Jim" == Jim Harrison <j_harrison1@ti.com> writes:

    Jim>  Since posting this question I have discovered:
    Jim> POSIX::times() which returns the elapsed time in ticks, as
    Jim> well.  I am replying to myself in case someone else reads my
    Jim> question and reads the replies.

Thanks for the followup, Jim.  Too often I see followups by original
posters that say:

    Never mind!  I just solved my problem.

Without providing the solution.  

-- 
Quentin Fennessy			AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals


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

Date: Tue, 21 Apr 1998 12:29:07 +0300
From: Fain <mindmore@mindless.com>
Subject: Idea-- Command promt through www page?
Message-Id: <353C66E3.969CF481@mindless.com>

This idea has lot's of secirity problems, I know this already. However,
it would be cool to try out. Question: Do you think it is possable...
would it just be a matter of having the perl sript run the commands?

- Nathan Fain
mindmore@mindless.com



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

Date: Tue, 21 Apr 1998 10:01:35 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Idea-- Command promt through www page?
Message-Id: <353C6CE2.49A07C92@earthling.net>

Fain wrote:

> This idea has lot's of secirity problems, I know this already. However,
> it would be cool to try out. Question: Do you think it is possable...
> would it just be a matter of having the perl sript run the commands?
>
> - Nathan Fain
> mindmore@mindless.com

 Possible and VERY dangerous if not implemented with extreme security
mindiness.

I would just pass you 'rm -fR /' and say End of the Game!  "Play
another?"
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|




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

Date: Tue, 21 Apr 1998 10:29:00 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Java Script in CGI
Message-Id: <353C74EC.6169A5BD@inlink.com>

Have you tried modifying the .cgi script to put the code in the HTML for
the java applet?  That's where I'd start.  You may also want to try the
comp.infosystems.www.authoring.cgi newsgroup since this is not a perl
question.

HTH,

Brent


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

Date: Tue, 21 Apr 1998 09:59:27 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
To: unk@webcom.com
Subject: Re: Netscape Perl?  Beginner question
Message-Id: <353C6C62.83E090EF@earthling.net>

[Mailed and Posted]

Unk wrote:

> Netscape says file is type "application/x-perl" and then it doesn't know
> what plug in to load.
>
> I have perl installed on my machine (a PC with 95) and I put a copy of
> Perl.exe in the directory "/usr/local/bin" where my Perl script says it
> is.
>
> What else do I need to do to get the damn thing working?
>

 An actual web server, say Apache, would be nice.  Netscape browsers and
CGI don't work the way you're trying to get them to.  May I suggest
researching this thread in the CGI newsgroup?

HTH,
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|




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

Date: Tue, 21 Apr 1998 10:22:08 GMT
From: Brent Michalski <perlguy@inlink.com>
To: unk@webcom.com
Subject: Re: Netscape Perl?  Beginner question
Message-Id: <353C7350.2D8AFCAF@inlink.com>

To run a Perl script via a call from a web page, you need to have a web
server running.  The web server needs to be configured to start perl.exe
when it encounters a .pl filetype.  You won't be able to just reference
a Perl script on your hard drive and have it execute.

www.activestate.com has information on setting up Perl on the different
type of wintel boxes.

HTH,

Brent


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

Date: 21 Apr 1998 02:57:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Parser works sometimes
Message-Id: <6hh1v3$q8c$1@comdyn.comdyn.com.au>

In article <no_spam-1904982047390001@sf-pm15-1-193.dialup.slip.net>,
	no_spam@medianook.com (Jay Fayloga) writes:

> I'm stuck at a point where I thought I would ask for some help from others
> out there. I have a parser that is trying to remove all HTML tags from a
> page and give me a reasonable, nice, straight forward text page.

There already is a module out there that does this. It's called
HTML::Parser. You can get it from CPAN (http://www.perl.com/CPAN/). I
strongly suggest you use it.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: Tue, 21 Apr 1998 19:04:14 +0200
From: Rodney Wines <Rodney.Wines@ahqps.alcatel.fr>
Subject: Re: Problem With "gethostbyaddr".
Message-Id: <353CD18E.CF1DBD84@ahqps.alcatel.fr>

Rodney Wines wrote:
<snip>
> I thought at first that the problem was with DNS; a long time-out for IP
> addresses without host names.  However, I added a print statement to dump each
> IP address, and I noticed that the program would hang on addresses which I could
> resolve instantly with "nslookup", and it would even hang on addresses that it
> had seen before, so it appears I might not be caching addresses as I had hoped.

The mistake was mine.  The problem really is due to DNS.  I'd put my debug print
statement in the wrong place, so it was always printing the previous IP and not
the one the script was actually trying to translate.  Once I put the print
statement in the right place, the performance of my script did correlate nicely
with that of nslookup (unfortunately).


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

Date: Mon, 20 Apr 1998 22:13:24 GMT
From: cking@wenet.net (Chris  & Sheila King)
Subject: Re: Project question and gripe about (Re: Snobby news group)
Message-Id: <353dc7d4.227510618@news.wenet.net>

On Sun, 19 Apr 1998 14:29:05 GMT, Randal Schwartz
<merlyn@stonehenge.com> wrote:

:I read nearly every article in comp.lang.perl.misc and
:comp.lang.perl.modules.  I see three types of responses:
:
:1) an answer to the question
:
:2) a request to go look at manual X or FAQ Y or Dejanews Z for the answer,
:   rather than having us retype it
:
:3) a request to take the question to a more appropriate group (usually
:   ciwac)
:
:and then I also see a lot of the following meta-responses:
:
:A) bitching about posts that aren't one of 1-2-3 above
:
:B) responses from people that do 1-2-3 above saying that there is no #4

Reminds me of a Usenet post I sawed archived, about the Usenet hierarchy
and how it is organized.
 
Supposedly, each newsgroup is named after the topic most frequently
discussed in that newsgroup. However, since the most frequently
discussed topic in each group is Usenet netiquette, all groups would
have the same name (i.e. news.netiquette). 
 
Therefore, each group is named after the SECOND most frequently
discussed topic.
 
Sheila King


------
http://www.wenet.net/~cking/sheila/


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

Date: 20 Apr 1998 22:24:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regexp question
Message-Id: <6hghv6$mue$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to A.P.
<road@apdo.com>],
who wrote in article <353B8BD5.E20015D3@apdo.com>:
> I'm learning Perl reading the Llama book. There's an exercise proposing
> to find a regexp to match the same word written two or more times in a
> row (with possibly varying intervening whitespace). The book proposes
> the following answer:
> 
> /(^|\s)(\S+)(\s+\2)+(\s|$)/

This is obviously wrong.  See below.

> Why do (^|\s) and (\s|$) match any number of leading/trailing
> whitespaces and not just one or none?

As many people explained, they do not.

The idea of the correct answer is to find a word

    \b(\w+)\b

followed by any whitespace 

    \s+

followed by the same word

    \1\b

(the last \b is needed to avoid matching 

     blah blahfoo

).  It looks like the book consider word as a sequence of
non-whitespace, then you need a modification of \b which matches not
between \w and \W, but between \s and \S.  

Until recently Perl did not have such a possibility of such a
modified-word-boundary, however, it is not absolutely needed: the
above example puts (^|\s) and (\s|$) to guarantie that \s/\S boundary.

(Note that the above expression matches more space than taken by the
two pseudo-words, this is why (^|\s)\S+ is quite different from \b\w+.)

Hope this helps,
Ilya


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

Date: Mon, 20 Apr 1998 23:55:27 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Regular Expression to match a valid IP address
Message-Id: <353C18B0.7303AE83@coos.dartmouth.edu>

Alan J. Flavell wrote:
> 
> On Mon, 20 Apr 1998, Ronald J Kimball wrote:
> 
> > IP: {
> >   last IP if $ip =~ /[^\d.]/;
> >   @pieces = split /\./, $ip;
> ..
> >   last IP if $pieces[1] < 0 or $pieces[1] > 255;
> 
> I'm sure I'm going to regret this, but how can a string consisting only
> of digits possibly test less than 0?

Err, ah, hmm....

You know, I thought of that while writing the first bit, and promptly forgot
by the time I got to the later bits.  :-)

last IP if $pieces[1] > 255;

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


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

Date: 21 Apr 1998 11:51:54 +0200
From: Patrick Hayes <Patrick.Hayes.CAP_SESA@renault.fr>
Subject: Re: Regular Expression to match a valid IP address
Message-Id: <vxj3ef7zemd.fsf@goblin.pdj.renault.fr>

Dan Boorstein <danboo@negia.net> writes:
> > Still speaking mostly baby talk, I'd probably do something along the
> > lines of
> >         m#(\d)+.(\d)+.(\d)+.(\d)+#
> > and then verify ranges for $1, $2, etc. I'm sure there's a more
> > elegant solution.

Jeffrey Friedl's book: Mastering Regular Expressions uses the validation of IP
adresses as an example. His solution is a one long regexp that works for all
valid adresses, but fails to match for non valid adresses like "1.1.1.999".
Whether you want to use the regexp to eliminate non-valid adresses or do so
afterward using $1... is a matter of taste I suppose.

m/^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$/

Pat

-- 
--------------------------------------------------------
Patrick.Hayes.CAP_SESA@renault.fr    (33) 01.41.04.64.20
--------------------------------------------------------


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

Date: Tue, 21 Apr 1998 03:56:37 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: Setuid is dangned near impossible
Message-Id: <slrn6jo67h.798.jgloudon@hyssop.bbn.com>

Kermit Tensmeyer <kermit@ticnet.com> wrote:
> it would be nice to use Perl to make thing work well

>but Perl has made it so difficult to do even simple things
>with this new changes. (perl5.0040063)
                         ^^^^^^^^^^^^^

This is not a release version of perl, you should not be trying to use it to do
real work. Try latest.tar.gz from CPAN instead.

I really can't understand what you have done (assuming i understand what
you ARE trying to do as that is muddled as well). If you'd show the persmissions
on the binaries and scripts involved, and the warnings/errors you get from perl
someone might be able to tell you what exactly is going on.

Jason Gloudon


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

Date: Mon, 20 Apr 1998 21:26:07 GMT
From: gb@hugo.westfalen.de (Georg Bauer)
Subject: Re: Snobby news group
Message-Id: <gb-2004982326070001@hugo.westfalen.de>

In article <353B0C29.43247165@mindless.com>, Fain <mindmore@mindless.com> wrote:

>The more messages the better

The consequence of this: nobody will answer newbie questions. Nobody
want's to wade thru 2000 messages just to look if someone had a _real_
question. Those people that post FAQs without thinking do much more damage
to newbies than anything else - because they bury _real_ questions under a
big heap of stupidity.

bye, Georg

-- 
#!/usr/bin/perl -0777pi
s/TS:.*?\0/$_=$&;y,a-z, ,;s,   $,true,gm;s, 512,2048,;$_/es


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

Date: 21 Apr 1998 03:47:18 GMT
From: bsh@rainey.blueneptune.com (brian hiles)
Subject: Re: srand and rand fx
Message-Id: <6hh4s6$5qd$1@supernews.com>

Why reinvent the wheel?

http://bolder.grainger.uiuc.edu/random.htm
http://www.best.com/~thvv/gpw.html

_and_ one of these haves a special random number generator, _and_
the other one specifically produces "pronouncable" paswords.

-Brian



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

Date: Tue, 21 Apr 1998 16:52:29 +0800
From: johnvun <johnvun@asiapac.net>
Subject: subtitube variable into system command
Message-Id: <353C5E4C.6CE9@asiapac.net>

Dear Perl experts,

This is my code,

for($ptt=1; $ptt<=$pttcount; $ptt++)
{
system ("perl -p -i -e "s/shop/shop$ptt/g;" mcc$ptt");
}

i have a sequence of files (mcc1, mcc2, mcc3..mcc$pttcount), every file
got variable name shop.
I want shop change to shop1 in mcc1, shop change to shop2 in mcc2
 ...etc..

after compile

syntax error at pl line 34, near ""perl -p -i -e "s/shop/shop$ptt/g"
syntax error at pl line 34, near "" mcc$ptt")"
Execution of pl aborted due to compilation errors.

any solution ???

Thanks in advance!

johnvun


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

Date: 21 Apr 1998 16:42:47 GMT
From: lvirden@cas.org
Subject: Re: suggested research methods?
Message-Id: <6hiia7$a1e$1@srv38s4u.cas.org>


According to John Porter  <jdporter@min.net>:
:Bill 'Sneex' Jones wrote:
:> 
:
:> I try to 'read' CPAN as often as possible...(I printed out the 'long'
:> version...)
:
:YOU PRINTED IT OUT?

Of course, Bill wasn't specific as to _what_ he printed out.  However,
note that he didn't say "I printed out the stuff and then deleted the
online version" - printing is not necessarily useless.  Having online
searchable text is useless to me when I have no keyboard/processor/monitor/modem
handy or with the data on the disk...  Sometimes, having paper
to read is useful.

Bill, do you mean that you printed out every pod on CPAN?  Or the long
version of the 'catalog' of CPAN modules that are available?  I suspect
the latter...
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Mon, 20 Apr 1998 23:43:58 +0100
From: fergus@twig.demon.co.uk (Fergus McMenemie)
Subject: using unpack to generate checksums.
Message-Id: <1d7t5f4.1tnc72u1kdljrcN@twig.demon.co.uk>

Hello,

        The perl books describe how the unpack function can be
        used to generate checksums. Both the chamel books provide
        an example that is claimed to emulate the UNIX SYS5 sum 
        command.

        I gave this a go but cant get the perl generated checksum
        to match either the BSD or SYS5 sum commands or the cksum
        command.

        Any ideas or comments?

-- 
======================================================================
Fergus McMenemie                      Email: fergus@twig.demon.co.uk
Technical Basis
======================================================================


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

Date: 20 Apr 1998 12:01:26 GMT
From: TC100@t-online.de (Steve)
Subject: VB DLL and Perl
Message-Id: <6hfdem$8di$1@news02.btx.dtag.de>

I wrote a xxx.DLL in Visual Basic. Now I have  to use this program for
my server.
What  I need is the access to this xxx.DLL like this.

Set myobj=Server.CreateObject("xxx.dll")

object1=myobj.method1
object2=myobj.method2
 .
 .
 .

I know that look like ASP. But I need the same for perl. I must open
the xxx.dll, an then I need the access to the methods an objects
defined in the xxx.dll.
This is no pipe or ODBC or DB ...
Can't find any help in CPAN.



Sorry about the bad english.


Thanks Jens



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

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

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