[12793] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 203 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 20 16:07:18 1999

Date: Tue, 20 Jul 1999 13:05:14 -0700 (PDT)
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, 20 Jul 1999     Volume: 9 Number: 203

Today's topics:
    Re: basename regexp? <marshalc@americasm01.nt.com>
    Re: basename regexp? <sariq@texas.net>
    Re: basename regexp? <marshalc@americasm01.nt.com>
        beginner needs some help ross@nauticos.com
        Check if 2 dates are in the same week skyfaye@my-deja.com
    Re: DOS Hidden File Attribute <david@temss2.isr.temple.edu>
        Gtk+ and Perl shawnporter@my-deja.com
        Hashes 05317@stblaw.com
    Re: How can I do a case insensitive search? (Alan Curry)
    Re: How should I sort by different fields? <cassell@mail.cor.epa.gov>
    Re: How to compare fields (Marcel Grunauer)
    Re: How to get total line numbers in a text file ? <cassell@mail.cor.epa.gov>
    Re: how to get total matched lines number ? (I R A Darth Aggie)
    Re: HTTP PUT method (Dan Wilga)
    Re: HTTP PUT method (brian d foy)
    Re: Need help with socket loop? <dbohling@pacbell.net>
        OLE & EXCEL hemant_gandhi@hotmail.com
    Re: Perl and Personal Web Server (Win98) <tzadikv@my-deja.com>
    Re: Perl and Personal Web Server (Win98) <mlopresti@bigfoot.com>
    Re: Perl and Personal Web Server (Win98) <emschwar@rmi.net>
    Re: Perl and Personal Web Server (Win98) <kperrier@blkbox.com>
        Perl on IIS <bennett_j@yahoo.com>
    Re: Perl on IIS (Todd Tolhurst)
        Perl Programmer Wanted Urgently <webmaster@accessx.com>
        Perl/CGI Question <mmamidi@cup.hp.com>
        perl_call_* and multiple instances of PerlInterperater (K. William Young)
    Re: Prime Factorization (Alan Curry)
    Re: reading from a file and THEN! <posern@informatik.uni-marburg.de>
    Re: reading from a file and THEN! <emschwar@rmi.net>
        Reading from a file and THEN!? <posern@informatik.uni-marburg.de>
    Re: reading sections of a file by markers (Steve .)
    Re: regular Expression <tchrist@mox.perl.com>
    Re: regular Expression <dgris@moiraine.dimensional.com>
    Re: regular Expression <tchrist@mox.perl.com>
    Re: regular Expression <tchrist@mox.perl.com>
    Re: Trapping Intr, Exec, Stty - Sample code (perl 4&5) ben@spectrumwireless.net
    Re: Wanted Programing <marshalc@americasm01.nt.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 20 Jul 1999 13:20:22 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: basename regexp?
Message-Id: <3794BDE6.9F3BA0E0@americasm01.nt.com>

>
> How bout' this?
>
> $len = length($0);
>
> for ($i=0; $i<$len; $i++) {
>     $char = substr($0,$i,1);
>     if ($char =~ /\//) { $k = $i }  ## make it /\\/ for DO$
> }

eww...you used a for loop for something that is easily done with regexp :)
chant with me.."regexp is your friend.."

> $name = substr($0,$k);
> print "$name\n";
>
> W

perl is widely known for its text manipulation abilities...not its for
loops :)
~Marshall

--
----------------------------------
just another guy trying to save the world
----------------------------------





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

Date: Tue, 20 Jul 1999 14:01:57 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: basename regexp?
Message-Id: <3794C7A5.D60E6ADA@texas.net>

Marshall Culpepper wrote:
> 
> Jona Andersen wrote:
> 
> > Hi,
> >
> > I need to know the name of my script.
> > So, how do I strip the full path?
> >
> > Thanks,
> >
> > Joe
> 
> $script=$0;
> $script=~ s/\/+\w+\///;
> print $script
> #$script is now the name of your script
> 
> :)

Do you have access to Perl?  Obviously not.  This is not the first time
you have posted untested garbage.

*plonk*

And I suggest all newbies do likewise, assuming they want correct
answers.  I'd guess non-newbies already have *plonk*'ed.

- Tom


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

Date: Tue, 20 Jul 1999 14:12:30 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: basename regexp?
Message-Id: <3794CA1E.7B13BCEA@americasm01.nt.com>

Larry Rosler wrote:

> > $script=$0;
> > $script=~ s/\/+\w+\///;
> > print $script

oops forgot the semicolon :)

>
> > #$script is now the name of your script
> >
> > :)
>
> Is the smiley to show that the code is wrong, wrong, wrong???

wrong, wrong, wrong? I tested it pretty rigorously on my HPUX 10.20 and it
seems to work just perfect with the 10 or more examples I've put it
through...

>
>
> > ~Marshall
> >
> >
> > ----------------------------------
> > just another guy trying to save the world
> > ----------------------------------
>
> Still trying to save the world with untested code (or inadequately
> tested, to give you the benefit of the doubt)?  Please give the world a
> break.

it says 'trying'..not all coders are 100% perfect besides...It's not like I
do perl for a living or anything...
didn't mean to offend you if I did...but I am still to find an example that
doesn't work with the code I've posted....(unless of course it's a windows
platform...)

~Marshall



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

Date: Tue, 20 Jul 1999 19:27:03 GMT
From: ross@nauticos.com
Subject: beginner needs some help
Message-Id: <7n2ihn$5q6$1@nnrp1.deja.com>

Hey All ---

  Just wondering if you could help me figure out what this code does:

print "Content-type: text/html", "\n\n";

open(OUT,">boxpatchout.txt") || die "Can't open file for xml'd form
output";
$buffer="";
$howmany= $ENV{CONTENT_LENGTH};

read STDIN,$buffer,$howmany;
print OUT "Check File\n";
cntnu: @pairs= split(/&/, $buffer);
foreach $pair (@pairs) {print OUT "$pair\n";}
print OUT "Check after loop...\n";
close OUT;


   I understand the majority of this script except for the line:
$howmany= $ENV{CONTENT_LENGTH};
and
cntnu: @pairs= split(/&/, $buffer);

   Can someone shed some light on these statements for me....
Thanks in advance!

   --- Ross P.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 18:36:45 GMT
From: skyfaye@my-deja.com
Subject: Check if 2 dates are in the same week
Message-Id: <7n2fjs$4f0$1@nnrp1.deja.com>

$old_mon=11; $old_day=27; $old_year=1998; #Dec 27, 1998
$new_mon=0; $new_day=8; $new_year=1999;   #Jan 8,  1999

I need to find out if 2 dates are in the same week, one week apart, 2
weeks apart, and s
o on.  For me, Monday is the beginning of the week.
I know how to find the number of days between 2 dates but that doesn't
help this problem.

Thanks,
Hung


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 15:47:18 -0400
From: "David Forrest Tucker" <david@temss2.isr.temple.edu>
Subject: Re: DOS Hidden File Attribute
Message-Id: <7n2jnu$oah$1@cronkite.ocis.temple.edu>


I must have "passed-over" that bit of info.

Thanks a lot for your patience!!!!

elephant wrote in message ...
>David Forrest Tucker writes ..
>>Is there a perl function or method by which a script can identify and/or
set
>>the DOS "hidden file" attribute?
>
>the standard (with ActiveState's port) Win32::File module has exactly
>what you're looking for .. check your help for more details
>
>--
> jason - remove all hyphens for email reply -




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

Date: Tue, 20 Jul 1999 19:32:02 GMT
From: shawnporter@my-deja.com
Subject: Gtk+ and Perl
Message-Id: <7n2iri$5uf$1@nnrp1.deja.com>

I've started a little website about using Gtk+ and Perl.  I'm very new
to it myself so it is very basic.

-> http://rit.net/sporter/gtkplusperl/

Right now all I've got is a short FAQ and some sample code.  The example
I give has the C and Perl code that do the same thing, which I think is
very useful because most Gtk+ documentation is written for C
programmers.

Enjoy.

If you know of any other good resources about using Gtk+ with Perl,
please let me know.

--
Shawn Porter
sporter@ritMSWINDOWSFROMYOURPC.net

(remove MSWINDOWSFROMYOURPC to email me.)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 19:30:32 GMT
From: 05317@stblaw.com
Subject: Hashes
Message-Id: <7n2iop$5tn$1@nnrp1.deja.com>

In using Hashes, every once in a while I get, Odd number of elements in
hash.  What am I doing wrong ?

these hashes have at least 4500 items in them.

Thanx
Mindy


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 19:33:50 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: How can I do a case insensitive search?
Message-Id: <ya4l3.1474$J3.38569@news15.ispnews.com>

In article <37909904.D46BD64D@home.com>,
Rick Delaney  <rick.delaney@home.com> wrote:
>Jim wrote:
>> capital "i" is for case insensitive
>
>I thought capital "i" is for
>
>    I don't test code before posting it.
>    I don't read the manual.
>    I think .sigs are as important as the message.
>    I always get stuff backwards.  Question before answer, "I" for "i".

I am, I am Superman
  and I can post everywhere
I am, I am Superman
  and I don't read anything
I am, I am Superman
  the rules don't apply to me

R6.4


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

Date: Tue, 20 Jul 1999 11:20:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How should I sort by different fields?
Message-Id: <3794BDD1.28689368@mail.cor.epa.gov>

Floyd Morrissette wrote:
> [snip of reponse]
> The fact that they read this message means there is a good chance they
> are already connected to the internet and if they click on the link then
> a browser starts for them. It may not be true of everybody but I think
> most.

True for me right now.  Not true in general.  You're making the same
sort of assumption that you're chiding Jonathan for making.

> I know I don't have the FAQ on my hard disk so I cannot assume that

But you *should* have the FAQ locally.  It makes life so much easier.
And you should encourage posters to do likewise.  Search this ng's
archive's and you'll find tons of 'I cannot get to the FAQ now so answer
this' questions.  And a local FAQ+docs provides an incentive to write
effective searching and indexing tools, for which Perl is of course
ideal.

> someone else does. But I can assume they have an internet connection.
> And the link I provided gives a lot more than the person asked for. They
> are exposed to the various answers that can be found and may not have to
> come back to ask more questions.

An internet connection is much better than nothing.  But IMHO this ng 
should encourage more people to download a copy of the FAQ from CPAN
or wherever, rather than telling them where they can read a small portion
of the FAQ.
 
> But just stating "it's in the faq", what faq, where? Obviously the
> person doesn't know that it may be on the hard because if he did he
> would not have come here to ask. And he doesn't know that it is
> available on the web. I know I had to ask where the faq was after
> receiving such a response. Its like asking where to buy something and
> somebody says its at the store. What kind of store? Where is it at?
> Newbies need specific direction.

Agreed.  So sometimes the best advice is to explain how to get to the
FAQ which should be on their hard disk.  Then follow that up with 
advice on how to get a copy if they are FAQ-deficient.  Or is that
FAQ-challenged?  :-)
 
HAND,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 20 Jul 1999 17:27:01 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: How to compare fields
Message-Id: <379eb159.3300726@enews.newsguy.com>

On 19 Jul 1999 18:37:40 -0500, abigail@delanet.com (Abigail) wrote:

>Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCXLVIII
>September MCMXCIII in <URL:news:37939659.67816C0A@ccrs.nrcanDOTgc.ca>:
>|| What's the best way to compare two given fields in a text file,
>|| outputting the differences, after reading in the file from the command
>|| line?
>
>
>That depends on your definition of 'difference'.  What is the difference
>between "a blue fish" and "19.2857" ?

At least three of the two say "hello".



Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: Tue, 20 Jul 1999 11:10:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to get total line numbers in a text file ?
Message-Id: <3794BB8A.33D5FAFF@mail.cor.epa.gov>

V. Balaji wrote:
> 
> How about using wc(1) instead of perl?

Or how about using wc as *written* in Perl?  That way it's a
bit more portable.  Check out the Perl Power Tools at
http://language.perl.com/ppt/

<Don Pardo>
Another fine product from The House Of Christiansen!
</Don Pardo>

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 20 Jul 1999 18:13:20 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: how to get total matched lines number ?
Message-Id: <slrn7p9f68.lho.fl_aggie@thepentagon.com>

On Tue, 20 Jul 1999 10:07:30 -0700, Steve Laybourn
<laughingotter@foxinternet.net>, in
<3794ACD2.CDAD359E@foxinternet.net> wrote: + Hmmm...let's try this:

+ $mtx=0;
+ chomp @stuff; # this would be your array of stuff
+ foreach $clam(0 .. $#stuff) {
+  $line=@stuff[$clam];
         ^$, since you're refering to a scalar element of an array

+  ($ex0, $categorys, $ex2) = split(/&&/, "$line");
+  if ($categorys eq "001") { $mtx++; } }

Alternative: $count{$categorys}++; will count *all* $categorys. Then you
can do some KEWL analyses. Well, ok, maybe frequency counts isn't that
sexy...

+ print "001 matches a total of $mtx lines ";

$key='001'; # a bit more flexible
print "$key matches a total of $count{$key}\n";

+    I will probably get blasted from the rest of the group for lack of
+ programming style, but who cares?

Because it makes it hard to follow along? I was about to query you about
a missing } when I found a pair of 'em.

foreach $clam(0 .. $#stuff) {
[snip]
  if ($categorys eq "001") { $mtx++; } 
}

is a little easier to follow.

But if you want compactness:

foreach $clam(0 .. $#stuff) { [snip] ; if ($categorys eq "001") { $mtx++; } }

Which is way harder to follow... :)

James


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

Date: Tue, 20 Jul 1999 14:12:01 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: HTTP PUT method
Message-Id: <dwilgaREMOVE-2007991412010001@wilga.mtholyoke.edu>

In article <7n281i$on$1@nnrp1.deja.com>, keydet89@yahoo.com wrote:

> Does anyone have a working example of using the HTTP PUT method
> in Perl?
> 
> I've done searches on the 'groups, and the AS listserver.  I have
> also checked the CPAN scripts archive.
> 
> All I want to do is post a particular file on a web server, and
> read back the response code (ie, automate web site updating and
> log responses).

One thing to be sure of before you bother trying this is that your Web
server supports it. For instance, by default, Apache doesn't. You have to
add a special module.

I haven't done this in Perl, myself, or I'd post a snippet.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Tue, 20 Jul 1999 15:29:58 -0400
From: brian@pm.org (brian d foy)
Subject: Re: HTTP PUT method
Message-Id: <brian-ya02408000R2007991529580001@news.panix.com>

In article <7n281i$on$1@nnrp1.deja.com>, keydet89@yahoo.com posted:

> Does anyone have a working example of using the HTTP PUT method
> in Perl?
> 
> I've done searches on the 'groups, and the AS listserver.  I have
> also checked the CPAN scripts archive.
> 
> All I want to do is post a particular file on a web server, and
> read back the response code (ie, automate web site updating and
> log responses).

there's Apache::Roaming on CPAN, and if you search the Netscape docs
set you'll find a page called "Publishing with PUT".  the Apache
docs (www.apache.org) will tell you about mod_put. there are a 
few examples to be found on DejaNews as well.  if you want a book,
the new "Writing Apache Modules in Perl & C" will explain
everything you need to know.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Tue, 20 Jul 1999 11:08:52 -0700
From: Daniel Bohling <dbohling@pacbell.net>
Subject: Re: Need help with socket loop?
Message-Id: <3794BB33.B0556B76@pacbell.net>

Thanks for the info...will do. Hope you get this message. Having problems with
news server. Many thanks. Probably missed any other replys, but thanks to
anyone else who did.

Ala Qumsieh wrote:

>
> No ... your problem is called deadlock. In a client/server
> environment, great care has to be taken in establishing a
> good protocol where the client(s) can communicate back and forth with
> the server. If you fail to do this, a deadlock situation will likely
> occur where both a client and a server are sitting indefinitely
> waiting for each other to send messages, which will never arrive.

The messages are going through but only after a ^d at the terminal. Would you
happen to know why? $/ or something? Thanks

>

>
>
> The above while() loop never terminates. It just stays there waiting
> for the server to say something. If the server is silent, the above
> while() loop just hangs until the server sends a message. The same
> thing happens on the server side.

> Side note: Typically a server never attempts to initiate requests; it
> listens to incoming calls from clients and simply responds to them.
>
> You solution is to use the 4-argument form of select(). An easier
> solution would be to use IO::Select, which is simply an object wrapper
> around the select() function. Typical usage goes something like this:
>
>     my $readable_handles = new IO::Select();
>     my $writable_handles = new IO::Select();
>     $readable_handles->add($sock);
>     $readable_handles->add(\*STDIN);
>
>     while (1) {
>         my @ary = IO::Select->select($readable_handles,
>                                      $writable_handles,
>                                      undef,
>                                      1);
>
>         for my $nsock (@{$ary[0]}) {
>             do_something();
>         }
>     }
>
> Check out the docs for IO::Select. Also, have a look at chapter 12 of
> the panther (Advanced Perl Programming).
>
> HTH,
> Ala



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

Date: Tue, 20 Jul 1999 19:18:51 GMT
From: hemant_gandhi@hotmail.com
Subject: OLE & EXCEL
Message-Id: <7n2i2d$5ir$1@nnrp1.deja.com>

Hi all,
Can anyone please tell me how to use the search and replace feature of
Excel using OLE commands from a perl script. Can we remove new line
character among the cells of Excel sheet using the search and replace or
by some other method.


Thanks,
Hemant.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 18:31:15 GMT
From: Tzadik Vanderhoof <tzadikv@my-deja.com>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <7n2f9j$4ai$1@nnrp1.deja.com>

In article <37709A4A.E79125AD@dave.org.uk>,
  Dave Cross <dave@dave.org.uk> wrote:
> chitown34@my-deja.com wrote:
> >
> > I'm trying to configure ActivePerl for use with
> > Microsoft's Personal Web Server on a Windows98.
> >

> Presumably the people a Windows web server newsgroup will be able to
> help you.
>
> Here, we discuss Perl.
>
> Good luck,
>
> Dave...
>

--

Well, *presumably* there are people on the perl ng who have experience
with this, and *presumably* this *is* a perl-related question since it
involves getting perl set up properly on the guy's system.  And
*presumably* if we had as much people posting useful info as posting ng-
police stuff, we'd be in much better shape here!

Tzadik


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 14:59:06 -0400
From: matt <mlopresti@bigfoot.com>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <3794C6F9.C822260C@bigfoot.com>

I have experience with this, but I can't find the orginal post. If you have
specific questions I will help, and if you want, you can email me at my
email address.

Tzadik Vanderhoof wrote:

> In article <37709A4A.E79125AD@dave.org.uk>,
>   Dave Cross <dave@dave.org.uk> wrote:
> > chitown34@my-deja.com wrote:
> > >
> > > I'm trying to configure ActivePerl for use with
> > > Microsoft's Personal Web Server on a Windows98.
> > >
>
> > Presumably the people a Windows web server newsgroup will be able to
> > help you.
> >
> > Here, we discuss Perl.
> >
> > Good luck,
> >
> > Dave...
> >
>
> --
>
> Well, *presumably* there are people on the perl ng who have experience
> with this, and *presumably* this *is* a perl-related question since it
> involves getting perl set up properly on the guy's system.  And
> *presumably* if we had as much people posting useful info as posting ng-
> police stuff, we'd be in much better shape here!
>
> Tzadik
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.






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

Date: 20 Jul 1999 13:06:59 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <xkfaesrm97w.fsf@valdemar.col.hp.com>

Tzadik Vanderhoof <tzadikv@my-deja.com> writes:
> Well, *presumably* there are people on the perl ng who have experience
> with this,

Not a good assumption-- people here write Perl programs.  Some of us may
or may not administer web sites, and some proportion of those may use
IIS.  But just because we use Perl, that says nothing about our
competence as webmasters.

> and *presumably* this *is* a perl-related question since it
> involves getting perl set up properly on the guy's system.

No it doesn't.  If you read carefully, you'll notice the problem is not
in getting ActivePerl set up on his system, it's getting it to work with
IIS.  If Perl is working fine, and the problem is in getting it to work
with a given webserver, don't you think the likeliest place to find the
answer is in a webserver-related newsgroup?

> And *presumably* if we had as much people posting useful info as
> posting ng-police stuff, we'd be in much better shape here!

I find it amusing that you think that referring someone to the proper
newsgroup (politely, too!) is "ng-police stuff".  Should we just answer
any question that comes along, as long as the word "Perl" is in there
somewhere?

"Hi, my name is Alex, and my girlfriend spends too much time writing Perl 
scripts.  She calls them `programs', but I know better-- programs have
dialog boxes and stuff, and these just read in stuff and print it out
again.  What should I do?"

-=Eric


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

Date: 20 Jul 1999 14:28:40 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <7923EB0022F15F9C.BF8D2D80A9CD3D3D.2A5409A348243B23@lp.airnews.net>

Tzadik Vanderhoof <tzadikv@my-deja.com> writes:

> 
> Well, *presumably* there are people on the perl ng who have experience
> with this, and *presumably* this *is* a perl-related question since it
> involves getting perl set up properly on the guy's system.  And
> *presumably* if we had as much people posting useful info as posting ng-
> police stuff, we'd be in much better shape here!

You *presume* too much.  The only thing you can *presume* is that the 
people in this newsgroup program in perl.  You cannot *presume* that they know 
a hill of beans about setting up/installing perl.  That is the task of a systems
administrator.  Those kind of questions should go to people who use the said 
operating system and have installed and configured the personal web server.  
They can most definately be found in the newsgroup that deals with Windows 
based web servers, such as comp.infosystems.www.servers.ms-windows

Kent


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

Date: Tue, 20 Jul 1999 19:39:26 GMT
From: Bennett <bennett_j@yahoo.com>
Subject: Perl on IIS
Message-Id: <7n2j9c$64c$1@nnrp1.deja.com>

I need to run a Perl script on a box using IIS 4.0.  The system
administrator is too scared to install an interpreter.  However, he
seems to think that I can run the script without having to put perl on
the server.  I am doubtful that it is possible, but if anyone can help
me out, I would appreciate it.

FYI- The script is a generic one that returns the results of form
fields via e-mail.  With Perl I can only use one script for all 15
forms.  If there is another way to do this without writing a separate
script for each form and not using Perl, I would appreciate that advice
as well.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 20:03:38 GMT
From: toto@toto.com (Todd Tolhurst)
Subject: Re: Perl on IIS
Message-Id: <3794d56b.20654481@news-server>

On Tue, 20 Jul 1999 19:39:26 GMT, Bennett <bennett_j@yahoo.com> wrote:

>I need to run a Perl script on a box using IIS 4.0.  The system
>administrator is too scared to install an interpreter.  

  Pay no attention to him, as he is an imposter.  A true sysadmin is
fearless.  A true sysadmin also shuns IIS and kin.

> However, he
>seems to think that I can run the script without having to put perl on
>the server.  
 
   Hmm.  Let me know when he's done setting that up.

--
Todd Tolhurst
toto@toto.com
http://www.w3xpert.com/toto/



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

Date: Tue, 20 Jul 1999 20:20:11 +0100
From: The Main Man <webmaster@accessx.com>
Subject: Perl Programmer Wanted Urgently
Message-Id: <3794CBDB.2FE6E174@accessx.com>

We are still in need for a Perl Programmer(s) to work on a variery of
exciting
new projects in the adult entertainment biz.

Candidate must have own equipment and be ok to work on his/her own and
to strict deadlines.

Good Fun Company and good rates of pay + bonuses.

Email resume /experience to webmaster@accessx.com

Thanks for the responses so far.



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

Date: Tue, 20 Jul 1999 11:22:15 -0700
From: "Murthy V. Mamidi" <mmamidi@cup.hp.com>
Subject: Perl/CGI Question
Message-Id: <3794BE57.212B232E@cup.hp.com>

Hello

Pl. explain how I do this.

I have a perl script, say first.cgi put in cgi-bin. It generates a html
file on the fly and
sends it out to client side. Before it does so, it (tries to) create
another html file, say
second.html and (tries to) store (say in cgi-bin, stupid me!) it.
Basically I need the
on-the-fly-crearted html file to download the second.html  after
first.cgi has sent the
on-the-fly-html file to the client browser. More over the constructed
second.html
would have some APPLET tags. I need the browser to look for the applet
in the correct
place, not in cgi-bin (where from the on-the-fly html look to have
originated, from the
browser point of view).

How do I do this. Or if it can not be done, how else could I do.

I would appreciate your help in this regard. If possible cc my email in
your reply
posting.

regards
--
Murthy

mmamidi@cup.hp.com



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

Date: 20 Jul 1999 15:11:16 -0400
From: will@mindspring.net (K. William Young)
Subject: perl_call_* and multiple instances of PerlInterperater
Message-Id: <m3vhbfjfvv.fsf@bofh.ems.mindspring.net>

Let's say I have

int func(void)
{

 static PerlInterperater *foo
 static PerlInterperater *bar

 ...

They get properly perl_alloc'd, perl_construct'd, and
perl_parse'd. argv[1] is foo.pl for *foo and bar.pl *bar. Now when

perl_call_pv("baz", FLAG);

Is called, which function is called, the one in foo.pl or bar.pl?

Is this all threadsafe?

Thanks for any thoughts or pointers. The perlembed and perlcall
manpages don't mention anything, and and Altavista search contained a
bunch of links to the man pages.

Will






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

Date: Tue, 20 Jul 1999 19:30:25 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Prime Factorization
Message-Id: <l74l3.1473$J3.38446@news15.ispnews.com>

In article <slrn7p0hh0.c9j.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>See sig for a script that finds one prime factor smaller than the 
>number itself.

>-- 
>perl -wle 'print length $1 if (1 x shift) !~ /^1?$|^(11+?)\1+$/' <number>
                                           =~

-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: 20 Jul 1999 18:36:59 GMT
From: "K. Posern" <posern@informatik.uni-marburg.de>
Subject: Re: reading from a file and THEN!
Message-Id: <37948914.377A753F@informatik.uni-marburg.de>

Hi.

And SORRY for the "faults" in my hasty written perl-code... ;-)

And THANKs for the lot of thoughts you made about my question (really)!

And SORRY again for not clearly formulating what I want.

So again:

There is a logfile. The logfile grows and grows and then from time to
time (automatically) it happens that the logfile will be zipped and
moved to an archive.
Furthermore there is a tool (= little perl program) which opens the
logfile and always waits for and then reads the new input (in/to the
logfile).

And at this point I wondered if it is SOMEHOW possible (in perl) to
NOTICE that the "old" logfile was zipped and moved away and to close and
reopen the filehandle, so that is now attached to the "new" logfile
(with the same name in the same directory, but starting at size 0).

I hope this time my description/question will be better to understand.

Knuth.





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

Date: 20 Jul 1999 13:37:11 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: reading from a file and THEN!
Message-Id: <xkf7lnvm7tk.fsf@valdemar.col.hp.com>

"K. Posern" <posern@informatik.uni-marburg.de> writes:
> And at this point I wondered if it is SOMEHOW possible (in perl) to
> NOTICE that the "old" logfile was zipped and moved away and to close and
> reopen the filehandle, so that is now attached to the "new" logfile
> (with the same name in the same directory, but starting at size 0).

I can't think of anything offhand-- you'll get EOF after it's moved, of
course, but unless you can count on your logfile being updated on a
regular basis, that won't necessarily tell you anything.

Why not have whatever program that archives the logfile stop and restart
the monitoring perl program?  It seems the easiest solution.

-=Eric


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

Date: 20 Jul 1999 19:23:56 GMT
From: "K. Posern" <posern@informatik.uni-marburg.de>
Subject: Reading from a file and THEN!?
Message-Id: <3794CC83.B5A94608@informatik.uni-marburg.de>

Hi.

And SORRY for the "faults" in my hasty written perl-code... ;-)

And THANKs for the lot of thoughts you made about my question (really)!

And SORRY again for not clearly formulating what I want.

So again:

There is a logfile. The logfile grows and grows and then from time to
time (automatically) it happens that the logfile will be zipped and
moved to an archive.
Furthermore there is a tool (= little perl program) which opens the
logfile and always waits for and then reads the new input (in/to the
logfile).

And at this point I wondered if it is SOMEHOW possible (in perl) to
NOTICE that the "old" logfile was zipped and moved away and to close and
reopen the filehandle, so that is now attached to the "new" logfile
(with the same name in the same directory, but starting at size 0).

I hope this time my description/question will be better to understand.

Knuth.


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

Date: Tue, 20 Jul 1999 18:06:18 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: Re: reading sections of a file by markers
Message-Id: <3794ba6d.245855824@news.enteract.com>

One other note, I meant to put it in an array(@).  That would probably
be more appopriate.  Thanks.

On Tue, 20 Jul 1999 16:10:57 GMT, syarbrou@nospam.enteract.com (Steve
 .) wrote:

>Say I've got a text file that has something like this:
>
>-- text file example snip --
><- start ->
>bla bla
>bla bla bla
>bla bla
>bla
>
><- e1 ->
>
><- start e2 ->
>bla bls a sfd
>sfd
>
>ddfsf
>df
><- end e2 ->
>
>-- end text file example --
>
>How would I basically say something like take everything starting
>after <- start -> and before <- e1 -> and put it in variable $start,
>and take everything after <- start e2 -> and before <- end e2 -> and
>put it in variable $end ?  Thanks.
>
>Steve



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

Date: 20 Jul 1999 12:27:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regular Expression
Message-Id: <3794bf86@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Daniel Grisinger <dgris@perrin.dimensional.com> writes:
:Good thing I don't waste my time looking at the faq anymore.  I
:might have been so worried about the fact that this can't be done
:that I wouldn't have any code doing it.  :-)

Too bad you didn't send us a patch.

--tom, who still thinks a parser is easier to understand
-- 
 And I haven't even touched on I/O performance.  It doesn't do much good to
 have a Gigaflop on your desk if you are still trying to feed it with a
 Megabyte/sec I/O system. :-) --Patrick F. McGehearty


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

Date: 20 Jul 1999 12:49:43 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: regular Expression
Message-Id: <m3u2qz40mw.fsf@moiraine.dimensional.com>

[cc'd to Tom]

Tom Christiansen <tchrist@mox.perl.com> writes:

> In comp.lang.perl.misc, 
>     Daniel Grisinger <dgris@perrin.dimensional.com> writes:
> :Good thing I don't waste my time looking at the faq anymore.  I
> :might have been so worried about the fact that this can't be done
> :that I wouldn't have any code doing it.  :-)
> 
> Too bad you didn't send us a patch.

The perlfaq* documents are primarily political pieces espousing
a certain view of the perl language and perl users that I don't
agree with.  Thus I feel that I am not the best person to be
providing patches for those documents.

Note that this is not a criticism of you or your work.  I have argued
at length with many people--defending your right to say whatever you
want in your docs.  I just don't think you'd be interested in my
perlfaq patches.  *shrug*

dgris, who sometimes calls his regexen parsers
-- 
A hacker is a machine that turns caffeine into code.


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

Date: 20 Jul 1999 12:48:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regular Expression
Message-Id: <3794c485@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Daniel Grisinger <dgris@perrin.dimensional.com> writes:
:The perlfaq* documents are primarily political pieces 

I cannot believe that you believe that.  But if they are, they should
be deleted from the distribution.  Before we do that, do you consider
Larry's TMTOWTDI a political statement, or not?

--tom
-- 
"If you can spend a perfectly useless afternoon in a perfectly useless manner,
 you have learned how to live."
				- Lin Yutang


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

Date: 20 Jul 1999 12:50:39 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regular Expression
Message-Id: <3794c4ff@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Daniel Grisinger <dgris@perrin.dimensional.com> writes:
:# snipped straight from perlre
:$re = qr{ \(
:            (?:
:             (?> [^()]+ )  # non-parens, no backtracking
:            |
:             (?p{$re})     # me, again

And perlre (that's 5.005_57, mind you) also brands these "very
experimental".  I don't think it's fair to chastise someone
for not using a "very experimental" feature.

--tom
-- 
    X-Windows: Flakey and built to stay that way.
	--Jamie Zawinski


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

Date: Tue, 20 Jul 1999 18:29:33 GMT
From: ben@spectrumwireless.net
Subject: Re: Trapping Intr, Exec, Stty - Sample code (perl 4&5)
Message-Id: <7n2f5p$47t$1@nnrp1.deja.com>

Sample code (problem applicable to perl5 as well):
In directory /tmp/m:
main-menu.pl:
#!/usr/bin/perl

# Make sure you have . in your path

system("stty intr ^[ erase ^H");
$SIG{INT} = 'catch_zap';
sub catch_zap { exit;}

while(1) {
	print "1) Next menu";
	print "> ";
	chop($choice = <STDIN>);

	if($choice==1) {
		chdir("/tmp/m/sub");
		print "Heading for the submenu...\n";
		exec("sub-menu.pl") || die "Dead: $!\n";
	}


in subdirectory /tmp/m/sub
sub-menu.pl:
[root@lepton sub]# cat sub-menu.pl
#!/usr/bin/perl

# Make sure you have . in your path

system("stty intr ^[ erase ^H");
$SIG{INT} = 'catch_zap';
sub catch_zap {
	chdir("/tmp/m");
	exec("main-menu.pl");


while(1) {
	print "<esc> exits to main menu";
	print "> ";
	chop($choice = <STDIN>);
}


In article <7n2cl2$2vu$1@nnrp1.deja.com>,
  ben_hoyt@my-deja.com wrote:
> Hi comp.lang.perl,
> 	I have an interesting problem that I'm trying to
> work through.  I have a series of three perl
> scripts that represent, basically, text-based
> menus.  A user moves from one menu to a sub menu
> by choosing a option number.  Once the input is
> recieved, the "main" menu exec()s out into the new
> submenu.  In all the sub menus, I'm trapping INTR
> to exec() back to the main menu.  I have mapped
> INTR to the escape key (^[) for user
> friendliness.  Here is the problem: I can leave
> the main menu for a sub menu, play around in the
> submenu, then  I can escape (exec()) back to the
> main menu.  Then, I once again exec() into the
> same sub menu that I just left.  Now I'm in the
> submenu for the second time.  However, this time
> when I SIG(INTR) (press escape), the submenu
> script doesn't trap the signal, like it doesn't
> see it.
>
> I'm using perl4.036 (space constraints) on Linux
> 2.0.37 GLIBC.  The main menu and the sub menu are
> both separate scripts.  The environment variables
> all check out, and a system call to stty --all
> from both the main menu and the sub menu show that
> the INTR signal is still ^[ in all cases, even
> where it fails to trap in the second running of
> the sub menu.
>
> Does anyone have any ideas?  This has really been
> bothering me for awhile!  Or, does anyone have a
> better, functional, method in 4.036 to exec from
> one program to the next and be able to break out
> of successive scripts back to the one that
> exec()ed the sub menu, without leaving additional
> Perl or shell processes running?
>
> If anyone has some good ideas, please let me know
> via email: ben@spectrumwireless.net
>
> Thanks in advance!
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 13:21:13 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Wanted Programing
Message-Id: <3794BE18.4C1BFDFD@americasm01.nt.com>

js34508@my-deja.com wrote:

> Looking for someone to write scripts, mainly working with flat txt
> files and formating output of files to specfic html.  Cross
> referenceing and comparing flat txt files.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

is this for a web site or what? i might be interested....

~marshall

--
----------------------------------
just another guy trying to save the world
----------------------------------





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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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


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