[9693] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3287 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 29 14:07:22 1998

Date: Wed, 29 Jul 98 11:02:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 29 Jul 1998     Volume: 8 Number: 3287

Today's topics:
    Re: pattern matching <John.Adams@BentonvilleAR.ncr.com>
    Re: pattern matching <simonf@conduit.co.uk>
        Perl + FP Web Server + Microsoft Web Server grumo@passosnet.net
        Perl in Unix to Oracle in NT <devnull@netchi.com>
    Re: Perl5.005: any good Thread::kill workaround ideas? <jhi@alpha.hut.fi>
        Prereqs for _understanding_ Perl [Was: Re: Y2K problem  lvirden@cas.org
        Problem with using open to run another program on NT jao@my-dejanews.com
        question about url <mtveermanAD@mindlessDOT.com>
    Re: Shell script returning statistics data <rootbeer@teleport.com>
    Re: Skipping dates (Abigail)
    Re: striphtml.pl and Win32 Perl 5.004 (Abigail)
    Re: Tcl is better than Perl lvirden@cas.org
        Threads with Perl 5.00501 <gp@atnet.at>
    Re: Using Perl Embed in Win32 C++ <ed@pdh.com>
    Re: Using Perl Embed in Win32 C++ <ed@pdh.com>
    Re: Y2K problem in PERL with localtime() (Michael J Gebis)
    Re: Y2K problem in PERL with localtime() <pholser@nortel.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 29 Jul 1998 11:32:13 -0500
From: John Adams <John.Adams@BentonvilleAR.ncr.com>
Subject: Re: pattern matching
Message-Id: <35BF4E8D.691D@BentonvilleAR.ncr.com>

quinn coldiron wrote:

> It has a fixed number of characters until the actual directory path is
> listed.  How can I chop this line up to get the data I want?

If I were you, I'd forget about the pattern matching (though something
like /^\d*\s*(.*)/$1/ should work, inefficiently) and use either split
or (my choice) substr on 'em.

In fact, I'd be looking up substr in perlfunc right now, if I were you.

You won't have any problems with this at all, once you do that.

	John A
	...speaking only for himself, and not his fine employer


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

Date: Wed, 29 Jul 1998 16:17:06 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: pattern matching
Message-Id: <35bf3c0c.0@nnrp1.news.uk.psi.net>

I assume you know what the 'du' command does, if not try a man on 'du'. You
definitely do not want to be using this, especially if all you want is a
list of directories, rather you should use either 'find . -type d' or better
still use the 'Find' perl module.

Simon

quinn coldiron wrote in message <35BF1ADB.DF6158C5@deal.unl.edu>...
>I am trying to build a tree of subdirectories on Linux and am currently
>using this procedure to do it.
>
>I issue the command
>@ret = `du -S`

>which gives me a dump of all the sub directories in the current
>directory, which I can then sequentially go through and print, or do
>what ever with.  The problem is the format of each returned line:
>
>114     ./citv-home/httpd/html/deal/4Hnew/images/frontpics
>14      ./citv-home/httpd/html/deal/4Hnew/images/front/.AppleDouble
>31      ./citv-home/httpd/html/deal/4Hnew/images/front
>34      ./citv-home/httpd/html/deal/4Hnew/images
>1       ./citv-home/httpd/html/deal/4Hnew
<SNIP>




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

Date: Wed, 29 Jul 1998 16:53:18 +0000
From: grumo@passosnet.net
Subject: Perl + FP Web Server + Microsoft Web Server
Message-Id: <35BF537E.F48@passosnet.net>

Sorry,

It is possible to make Perl to work with above home servers, period.

But, only the Content-Type: text/html seems to produce results in the
browser. For instance:

     $file = 'myfile.gif';
     print "Content-Type: image/gif\n\n";
     open(PIC,"$file");
     print <PIC>;
     close(PIC);


produces no image! Strange?!

Anyone, can give some input? I guess this is not a easy one.

Gromo


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

Date: Wed, 29 Jul 1998 12:13:07 -0500
From: "NSC" <devnull@netchi.com>
Subject: Perl in Unix to Oracle in NT
Message-Id: <6pnlb6$rph$1@news1.norlight.net>

Hello,


I was wondering if anyone has successfully bolted perl (5.004_04) running on
Unix (Debian) to an Oracle (8) database running on NT.  I've tried
installing a DBD-pNET agent to run on NT, but it fails since I couldn't find
an x86 port of its required pRPC modules.  I was hoping to connect using
DBI:pNET from Unix to the agent running on NT.  Does anyone know of a better
solution, or where I could find the binaries for NT's pNET agent ( I
couldn't find them at ftp.funet.fi... ).


Thanks in advance,

-Jonas





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

Date: 29 Jul 1998 20:13:39 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Perl5.005: any good Thread::kill workaround ideas?
Message-Id: <oeezpdsfum4.fsf@alpha.hut.fi>


ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> Create a pipe, and make the thread wait on this pipe too.  Then write
> something to this pipe when you need to wake the kid (This is
> a home-grown recipe).

Your home sounds familiar :-)  This is a well-known 'hack'.
Maybe this could be packaged, Thread::Wakeup?

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


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

Date: 29 Jul 1998 17:09:52 GMT
From: lvirden@cas.org
Subject: Prereqs for _understanding_ Perl [Was: Re: Y2K problem in PERL with localtime()
Message-Id: <6pnl10$a14$1@srv38s4u.cas.org>


According to Craig Berry <cberry@cinenet.net>:
:John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
:: In article <MPG.10246eb2933cb2a3989791@nntp.hpl.hp.com>,
:: is zero filled on the left. That it will actually return more than were
:: asked for is obvious to an experienced C programmer, but C is not a
:: prerequisite for perl programming, nor is the C result obviously the
:: best.
:
:True enough.  However, it does have the advantage of being widely used,
:well known, and also being the basis for a lot of working code.


Interesting that I encounter this today.  Just yesterday I was talking
to a co-worker.  He was talking about how he had never 'gotten' perl and
had dropped out of a class.  His first thought was that perl seemed to
assume that the user knew C.  I asked if perhaps it was the class
instructor assumed the programmer knew C and shell.  When I mentioned shell,
his eyes lit up and he indicated that maybe it wasn't C, but shell programming
he was missing.

I think while a certain subset of Perl _could be_ taught without preknowledge
of C and shell, a class on programming Perl on Unix needs to consider 
covering a lot of similar topics if the audience is without those particular
skills.

-- 
<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: Wed, 29 Jul 1998 17:03:06 GMT
From: jao@my-dejanews.com
Subject: Problem with using open to run another program on NT
Message-Id: <6pnkka$181$1@nnrp1.dejanews.com>

I'm in the process of porting a perl program from unix to NT 4.0.  I've
combed through any documentation I can find (including this newsgroup) but
haven't had any success with the suggestions.  I'm using a perl version
(5.004_02) that I got from CPAN for win32.

Here's a subset of the code:
#######################
$EXE = "perl csList.pl < output.seq.nom | C:\\PROGRA~1\\Tcl\\bin\\tclsh80.exe
csCheck.tcl output.api.cs";

print "--STATUS: BEGIN TEST: $ID ...\n";  #$ID is variable set previously

open TEMP, "$EXE |" or die "Trouble opening: $!\n";

while (<TEMP>) {
   print or die "Can't Print:$!\n";
}

close TEMP or die "Trouble closing: $!\n";

$csSuccess = $? == 0;  #evaluated with returned value from csCheck.tcl
print "--STATUS: END   TEST: $ID ", $csSuccess ? "PASSED" : "FAILED", ".\n\n";
###################

The program runs fine (doesn't die anywhere).  It gives me the correct pass
and fail message at the end that depends on the value returned from
csCheck.tcl. The problem is that the process doesn't seem to send anything to
the filehandle TEMP.  Thus, nothing that is sent from the other program gets
printed out in the while loop.	I've put in a if (-r TEMP) to see if I could
read the filehandle and it gave me indications that it couldn't.

I read from the newsgroup that this should work fine in 5.004_02, but I can't
seem to get anywhere with it.  Is this a problem with the perl on win32?  Is
it a problem with NT? Does anyone know of a quick workaround?

Thanks,
Andrew
andrew.old@gtri.gatech.edu


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 28 Jul 1998 20:22:57 +0200
From: "Maarten" <mtveermanAD@mindlessDOT.com>
Subject: question about url
Message-Id: <6pnep3$ooc$1@news.worldonline.nl>

Since people can provide a full url to a page for redirection after a card
has been sent, they need a BASE HREF in the document since I use the LWP get
method. I I don't want to bother people with that so I will place a BASE
HREF in the html file for them. But I need to know the following:
They provide me a url like:
http://www.yourdomain.com/postcards/birthday/13yearsold/cardsent.html
I need to get rid of the cardsent.html.........
Apache Guardian has a line which gets rid of all behind .com. But that is
not what I need. I should end up with
http://www.yourdomain.com/postcards/birthday/13yearsold/
Do you know a way to do this?

Thanks.
Maarten
Please email me!
mtveerman@mindless.com









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

Date: Wed, 29 Jul 1998 16:45:33 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Shell script returning statistics data
Message-Id: <Pine.GSO.4.02.9807290943520.19378-100000@user2.teleport.com>

On Wed, 29 Jul 1998, Gil wrote:

> I am running a Perl script that executes some shell commands. From time
> to time the script ends with the following (or similar) 
> statistics data:
> '86.67u 14.98s 2:25.42 69.9%'
> 
> Does someone knows what the origin of this message ? How can it be
> canceled ?

It sounds as if you're saying that the problem is with the shell commands.
If so, that's not Perl's fault! But if you think perl is doing that, step
through your code with the debugger until you find the line which is
causing it. Good luck!

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



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

Date: 29 Jul 1998 17:15:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Skipping dates
Message-Id: <6pnlap$aal$3@client3.news.psi.net>

Duncan Martin (dmarti81@ford.com) wrote on MDCCXCIII September MCMXCIII
in <URL: news:35BF30D5.DB3D1418@ford.com>:
++ 
++ So... any suggestions on how to implement this, data structures/methods
++ to store the bank holidays and ways to get the number of them between
++ times with the minimum amount of CPU waste, this algorithm is called
++ fairly often and I'd like to keep it effecient. i.e. minimum amount of
++ 'for' loops.


use Date::Manip;



Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


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

Date: 29 Jul 1998 17:16:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: striphtml.pl and Win32 Perl 5.004
Message-Id: <6pnld9$aal$4@client3.news.psi.net>

Martin (minich@globalnet.co.uk) wrote on MDCCXCIII September MCMXCIII in
<URL: news:6pna49$34n$1@heliodor.xara.net>:
++ >  <img src="foo.jpg" alt="-->" width=123 height=321>
++ 
++ 
++ Duh! I hadn't thought of that. What about this instead though:


No, that won't do either.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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

Date: 29 Jul 1998 14:59:25 GMT
From: lvirden@cas.org
Subject: Re: Tcl is better than Perl
Message-Id: <6pndcd$1d1$1@srv38s4u.cas.org>


According to Cameron Laird <claird@Starbase.NeoSoft.COM>:
:In article <6p6ah0$6gr$1@srv38s4u.cas.org>,  <lvirden@cas.org> wrote:
:>According to  <mrauschkolb@my-dejanews.com>:
:>:Read all about it here:
:>Well, actually, one only reads about one side of the issue there...
:So you think <URL:http://starbase.neosoft.com/~claird/comp.lang.misc/portable_scripting.html#bilaterals>
:might interest some of these readers?

I suspect that readers who have a genuine curiosity will find some of these
links useful.  Unfortunately, I have yet to see a systematic impartial
comparison of multiple scriptings languages using some sort of independant
and useful scale of comparitive features.  No insult intended towards
the various folk mentioned on your page.  Each person has their own
agenda - either conciously or subconcious.  Even if a massive comparitive
analysis were done, it's seems rather likely that someone would come along
and say 'yea, but how do these 3 compare in terms of AAA' where AAA is
some scale not envisioned by the massive analysis.

-- 
<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: Wed, 29 Jul 1998 19:59:14 +0200
From: Gerhard Poul <gp@atnet.at>
Subject: Threads with Perl 5.00501
Message-Id: <35BF62F2.1E191C37@atnet.at>

Hi,

I want to use threads with Perl 5.005xx

hmmm... how??

I know that I have to create a thread. But how to terminate it??

I tested a script where the thread simply ends at a }

Is this enough???

is this okay???

thanks for your help,
  gerhard


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

Date: Wed, 29 Jul 1998 10:21:36 -0700
From: Ed <ed@pdh.com>
Subject: Re: Using Perl Embed in Win32 C++
Message-Id: <35BF5A20.40BF1C8F@pdh.com>

Martien Verbruggen wrote:

> In article <35BE5F93.67CFA6F2@pdh.com>,
>         Ed <ed@pdh.com> writes:
> > To start out with, I am not a perl programmer and don't really know a
> > whole lot about perl, but was given the task to call a perl program from
> >
> > within my C++ code.  I have looked at the perl embed for win32 stuff but
>
> You should have asked this question on comp.lang.c++. You're asking
> how to call a program from within c++. That it's a perl program is
> irrelevant.

There is a specific perl embed structure on how to call perl directly from c
or c++.  Sure, I could exec a perl script, but that is not what I am trying to
do.  I am trying to use the perlembed stuff.

>
>
>
> > still don't have a good idea of how to do this.  Most of the programs
> > want to take the command line arguments which I do not want to use (from
> > void main(argc, argv)).  I will know the argument (single argument) and
> > the perl program name.  I have not seen any really good examples of how
> > to do this.  Does anyone have any ideas?
>
> In c you'd use the system(3S) function. It's part of the standard c
> library (stdlib). I suspect that c++ can use that as well, or has an
> equivalent. Check the documentation. Ask on a c++ group.
>
> Martien
> --
> Martien Verbruggen                      |
> Webmaster www.tradingpost.com.au        | "In a world without fences,
> Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
> NSW, Australia                          |
>



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

Date: Wed, 29 Jul 1998 10:22:08 -0700
From: Ed <ed@pdh.com>
Subject: Re: Using Perl Embed in Win32 C++
Message-Id: <35BF5A40.7CFAA98B@pdh.com>



Sean McAfee wrote:

> In article <35BE5F93.67CFA6F2@pdh.com>, Ed  <ed@pdh.com> wrote:
> >To start out with, I am not a perl programmer and don't really know a
> >whole lot about perl, but was given the task to call a perl program from
> >within my C++ code.  I have looked at the perl embed for win32 stuff but
> >still don't have a good idea of how to do this.  Most of the programs
> >want to take the command line arguments which I do not want to use (from
> >void main(argc, argv)).  I will know the argument (single argument) and
> >the perl program name.  I have not seen any really good examples of how
> >to do this.  Does anyone have any ideas?
>
> Just feed Perl your own arguments, like so:
>
> char *perl_argv[] = { "", "my_script_name", "my_arg" };
> // or, possibly:
> // char *perl_argv[3] = { "", "my_script_name" };
> // perl_argv[2] = get_my_arg();
> PerlInterpreter *perl = perl_alloc();
> perl_construct(perl);
> perl_parse(perl, xs_init, 3, perl_argv, 0);
> // and so on...
>
> --
> Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
>             | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
>             | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu
>

Thanks, I'll try that out.

--Ed



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

Date: 29 Jul 1998 16:15:33 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6pnhr5$hdg@mozo.cc.purdue.edu>

stanley@skyking.OCE.ORST.EDU (John Stanley) writes:

}I see nothing related to perl in the string 02-29-100. If I am your
}pointy haired boss and you hand me a report with that date in it, I
}have no way of knowing that you programmed in perl. "Dates will be the
}output of the 'localtime' perl funtion" is not how any company I know
}of standardizes its dates. "Dates will be expressed as the last two
}digits of the year" is.

Does the following program have a bug?

#!/usr/bin/perl -w
use strict;
print "Today's date is ",localtime;

If yes: Is it a bug in perl, or a bug in how I'm using localtime?

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Wed, 29 Jul 1998 12:38:55 -0500
From: Paul Holser <pholser@nortel.com>
To: Michael J Gebis <gebis@albrecht.ecn.purdue.edu>
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <35BF5E2F.6F1@nortel.com>

[courtesy mail sent]

Michael J Gebis wrote:
> Does the following program have a bug?
> 
> #!/usr/bin/perl -w
> use strict;
> print "Today's date is ",localtime;
> 
> If yes: Is it a bug in perl, or a bug in how I'm using localtime?

Can't tell whether you're being facetious, so...

-- Not a bug in Perl.
-- Not a bug in your usage if your desired output is
   something like

   Today's date is 733122969832091

Methinks you may want

   print "Today's date is ", scalar localtime, "\n";

See perlfaq4 for more details.

HTH,
pholser

-- 
// Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
// Wireless Automation Tool Development
// "The absence of fear is some sort of brain damage."
// -- M. Scott Peck


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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