[12402] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6001 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 12:07:43 1999

Date: Tue, 15 Jun 99 09:00:28 -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, 15 Jun 1999     Volume: 8 Number: 6001

Today's topics:
    Re: a thread on threads <gbartels@xli.com>
    Re: Address Resolution Using Perl to Query Exchange (Pedro Miguel Raposo)
    Re: Afraid to ask about Y2K! finsol@ts.co.nz
    Re: Afraid to ask about Y2K! (Bart Lateur)
    Re: another href extraction question! <tchrist@mox.perl.com>
    Re: Backtits and tainting <rootbeer@redcat.com>
    Re: better way? (Filip M. Gieszczykiewicz)
    Re: Binary File Uploading - Part 2 (Filip M. Gieszczykiewicz)
        call to dll, from cgi perl, anybody??? <aavendano@ocs.es>
    Re: call to dll, from cgi perl, anybody??? <gellyfish@gellyfish.com>
    Re: Case select statements: are they in Perl? <rootbeer@redcat.com>
    Re: Case select statements: are they in Perl? (Kvan)
        Check URL (Twarren10)
    Re: Check URL <gellyfish@gellyfish.com>
        Date format with Foxpro <eyounes@aol.com>
    Re: Date format with Foxpro <gellyfish@gellyfish.com>
    Re: Date format with Foxpro <gellyfish@gellyfish.com>
    Re: Dynamic Regular Expression (Bart Lateur)
    Re: Efficiency utils for Perl scripts on Unix and Windb (Larry Rosler)
    Re: ENV Question doug_brough@my-deja.com
        Environment variables. <berntr@persbraten.vgs.no>
    Re: Environment variables. <gellyfish@gellyfish.com>
    Re: Environment variables. <rootbeer@redcat.com>
    Re: File Processing (Larry Rosler)
    Re: function to retrieve number of members in list (M.J.T. Guy)
    Re: Get last execution time for a cron job <silee@hk.super.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 15 Jun 1999 09:41:27 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: a thread on threads
Message-Id: <37665807.ED751BBB@xli.com>

Uri Guttman wrote:

quoting code because its referenced below.

> >>>>> "GB" == Greg Bartels <gbartels@xli.com> writes:
>   GB> sub first_sub
>   GB> {
>   GB>   $string .= "Abott";
>   GB>   MySleep(5);
>   GB>   $string .= "costello \n";
>   GB> }
> 
>   GB> sub second_sub
>   GB> {
>   GB>   MySleep(1);     #make sure first_sub actually goes first
>   GB>   $string .= " and ";
>   GB>   MySleep(20);
>   GB>   print $a ;
>   GB> }
>
>   GB> $a = '';
>   GB> Schedule(\&first_sub, 'now');
>   GB> Schedule(\&second_sub, 'now');
>   GB> EventHandler();   # executes all schedule events, 
>   GB>   # wont return until all events are finished.
>  
> that is not guaranteed to execute sequentially. without mutex locks

let me back up a bit. 
first, I think I'm mangling the terminology, trying to 
describe what happens in a hardware language such as
VHDL or Verilog.  

I dont need the two subs to run in parrallel, 
I actually do _not_ want them to do that. 
the Schedule routine takes the code ref and pushes
it onto an array, in the order that Schedule was called.
so there is an array somewhere that has first_sub at index 0 
and second_sub at index 1. a two dimensional array, actually.
[
  [\&first_sub, 0],
  [\&second_sub, 0]
]
the second element is when in simulation time the subroutine
will be called.

EventHandler goes through the array and calls each sub, 
one at a time, in sequence. when the subroutine call 
returns, then EventHandler goes onto the next item in
the array.

But this only works when the subroutines execute in zero 
simulation time, i.e., they have no MySleep calls.

this is currently what Hardware::Simulator does.
What it is missing is the ability for a subroutine
to make a call to MySleep.

what I was thinking was something like this:

EventHandler goes through the array of code references
and forks a process for each one, but does not actually
call the code reference. it then steps through each one in
sequence, allowing each process to run, one at a time.
when a subroutine calls MySleep, that causes the 
current process to be rescheduled for execution at
a later simulation time, and then halts the current
process. 

the event array would look something like this, after
first_sub was called and hit the first MySleep call.
[
  [\&second_sub, 0],
  [\&first_sub, 5]
]

then EventHandler takes over, looks at the event array,
and lets the process with second sub run.

>   GB> All I need is execution control, all the data is shared.
> 
> you haven't shown why you have to share the data. and i have shown you
> can with pipes or shared memory.

in the above code, the processes for first_sub and
second_sub share the $a variable. Apparantly this
is answered by using IPC::Sharable. I'll have to look at that.

===

the important thing is this: I'm not trying to have
processes run in parallel. I simply need a mechanism
to call a subroutine, halt it in the middle of 
execution, call a different subroutine, and then
allow the first subroutine to resume execution.

it seems the only way to do this is via threads
or forks or whatever, and then set up control
so that I can start/stop each process as needed.

===

all data is shared because there is no need to have
locks or pipes, or whatever. since event handling
will allow only one subroutine to execute at a time,
there is no need for separate data space.

if race conditions occur in this setup, they
will also occur in VHDL or Verilog.
the hardware languages used by the industry 
allow designers to write code that may simulate
differently depending on how the simulator
schedules the order of execution. it is
left to the designer to write code not
subject to race conditions. it is not the
simulator's job to prevent them. 

===

I'm concerned about overhead, not for speed reasons
so much as I am for memory reasons. at a gate level
simulation of an asic, every individual gate gets
its own process or thread, or whatever.

simulating gate level chip designs in VHDL or Verilog
will generally take hours to run a single test.
days to run a full suite of tests. so, run time
is expected to be slow.

my concern is that separate data or separate pipes,
or separate memory for a million different processes,
will thrash the memory requirements. I dont expect
Hardware::Simulator to actually be used for
gate level, but it would be useful if it can 
handle many, many, processes (threads, whatever).

just trying to simulate a high level design for
a system (ie. not gate level) could easily
have hundreds of processes (threads, whatever).

===


Greg

 
> 
> BTW there is no need to quote my entire post. and it is better
> netiquette to interlace you replies with the quoted posts.

sorry.


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

Date: Tue, 15 Jun 1999 14:01:50 GMT
From: Pedro.Raposo@tmn.pt (Pedro Miguel Raposo)
Subject: Re: Address Resolution Using Perl to Query Exchange
Message-Id: <7k5mce$7u09c_002@news.telepac.pt>

In article <7jmjcd$he$1@gellyfish.btinternet.com>, Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>In comp.lang.perl.misc Sitaram Chamarty <sitaram@diac.com> wrote:
>> On Mon, 7 Jun 1999 16:18:14 -0500, Michael J. McKinlay
>> <Mike.McKinlay@hboc.com> wrote:
>>>I've seen some hints and ideas floating around -- is there anyone actually
>>>using perl LDAP to query an Exchange server to resolve an address?
>> 
>> I use "ldapsearch", a neat little command line thingie, to grab
>> all the email addresses every Monday morning and populate my email
>> client (mutt)'s aliases file.  Works great.
>> 
>>>We have an app on IIS that can generate SMTP mail, but you have to know the
>> 
>> Aaah!  Now I see what you mean.  Perhaps ldapsearch and its
>> associated tools will compile on NT...?
>> 
>
>one might be able to use Net::LDAP on NT - Cant recall ever having seen
>it in the Activestate repository though.
>
>/J\
>

The Netscape PerLDAP module works just fine with Activestate Perl.

Go to http://developer.netscape.com/tech/directory, and check it out ...



Pedro Miguel Raposo


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

Date: Tue, 15 Jun 1999 14:22:49 GMT
From: finsol@ts.co.nz
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7k5njd$nbp$1@nnrp1.deja.com>

In article <slrn7m9t5s.jp8.mgm@unpkhswm04.bscc.bls.com>,
  mmorris@mindspring.com wrote:
<SNIP>
 I'll put on my instructor's hat and pass along a few tidbits.
>
> The best way to audit code written in Perl is to find several people
who are
> experienced in both Perl and code auditing and have them audit the
code
> (duh). This is, by the way, the same way you would audit code written
in any
> language ... Perl isn't magic in this regard.
<SNIP>
Thankyou for being one of the contributors to this newsgroup to
acknowledge that Perl programs do need to be audited for Y2K problems.
Mostly the response has been:

a) Only idiots would make Y2K errors and they shouldn't be programming
anyway and they deserve everything they get if they get it wrong.
b) Why just check for Y2K problems - what about all the others? Might as
well not bother.
c) Nothing significant is programmed in Perl.
d) Perl is Y2K compliant so therefore the code will not require a Y2K
audit.

I would also like to thankyou for your very comprehensive an exhaustive
instructions on how to perform a Y2K audit on Perl code.  Unfortunately
it seems that you have very limited experience of the real world -
perhaps you are an academic?  Few, if any, IT departments have the
luxury of a team of competent programmers assigned to task of
application familiarisation, regular meetings to discuss strategy,
findings, documentation etc. etc. Get real!

Your typical case will be for the Y2K project manager to tick off items
in his software inventory by getting a single programmer to give
assurance that everything is OK. This will be required to be done ASAP,
with minimal expense and with no disruption to normal work loads.
Anything more than that will require a lot of justification.  It would
certainly be rare that a team would be assigned to a single application.

The method of manually checking masses of code is inefficient and also
poses the very real problem of loss of concentration.  It is simply not
practical.


>
> In your case, you could just "find . -type f -print | xargs grep -l
> localtime" and complain about each result printed. Since it appears
you
> aren't doing anything but churning the panic anyway, this should be a
> tremendous time savings to you.

A routine to scan code is the most efficient method of processing a lot
of program code but it will need to include more than just 'localtime'
in its list of trigger values to search for. Granted, the localtime
booby-trap is more likely to catch out programmers than some of the
other Y2K hiccups, but there are plenty of other Y2K gotchas.

For some examples, check out the following URL:
http://www.idg.co.nz/WWWfeat/Y2000/ja190499.htm

> That will be $5, please, for consulation services rendered.
$5 seems very inexpensive but if the advice you have given causes some
to take a very narrow view of the Y2K problem in Perl code, it could
prove a very costly mistake.


> Deja.com (a.k.a. DejaNews) is the mechanism whereby these usenet
postings are
> archived.

You seem to have a very narrow understanding of newsgroups and newsgroup
reader software. Deja.com is just another tool (of which there are many)
to view newsgroup items - it is not *the* mechanism.

According to the great Perl guru himself, Tom Christiansen we, who call
ourselves programmers, are displaying our ignorance by using software
such as Deja.com - in his words "Web browsers masquerading as lame
excuses for real newsreaders are notoriously bad ...".  I don't agree,
of course, and I have far more important things to do with my time than
keep up to date on every piece of whizz bang software that hits the
market. But the guru has spoken and perhaps his pearls of wisdom won't
be squandered on yourself and the rest of his devoted flock.

> Thank you for your analysis of all companies over all the face of the
planet.
> Surely your intellect must be towering to so grasp that these are all
> universal truths. I humbly prostrate myself before you.
>
> Sarcasm is always free.
>

If you have personal knowledge of things being different from what I
have stated then, please by all means, refute my summation.  Sarcasm
enlightens no-one.

My 22 years experience in computing has given me a broader perspective
than most of the IT industry.  I have worked on-site for at least 100
organisations of all sizes, in several countries, working on various
mainframes, mid-range systems and networked PC systems in more than a
dozen programming languages and with numerous software packages. I have
developed several successful software products - both as a sole
developer and as part of a development team. Two of these products
(non-Y2K related) are now sold internationally.

I have recently developed, and am sucessfully selling, Y2K scan software
- not for Perl however!. I am currently actively working on (mostly
teleworking) Y2K assignments with several organisations - three very
large and six smaller ones in the USA, one in Australia and three
locally in New Zealand.  I also donate my time and software to
non-profit organisations, in particular USA based hospitals and
educational institutions.

> >
> >For those who are interested in Y2K problems that can occur in Perl &
> >other programming languages, check out:
> >
> >http://www.y2kinfo.com/journal/features/0499_amona.html
> >
> >http://www.y2kinfo.com/journal/features/0599_amon.html

Jocelyn Amon

--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


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


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

Date: Tue, 15 Jun 1999 15:42:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <37687326.33785850@news.skynet.be>

finsol@ts.co.nz wrote:

>The method of manually checking masses of code is inefficient and also
>poses the very real problem of loss of concentration.  It is simply not
>practical.

There's too much hype, anyway. If your code doesn't use dates, it is not
sensitive to Y2K bugs. Period.

Many people really seem to think that civilisation will end at jan 1,
2000, 12 AM.

>According to the great Perl guru himself, Tom Christiansen we, who call
>ourselves programmers, are displaying our ignorance by using software
>such as Deja.com - in his words "Web browsers masquerading as lame
>excuses for real newsreaders are notoriously bad ...".

I doubt if TomC is really referring to use of Deja.com or DejaNews.com.
I'd rather think he means the "news reader" that's built into a web
browsers like as Netscape, and which, even when compared to for example
(Free) Agent, is pretty crappy.

	Bart.


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

Date: 15 Jun 1999 08:45:31 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: another href extraction question!
Message-Id: <3766670b@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, abigail@delanet.com writes:
:;; I am trying to extract 'a hrefs' from html files...yes I know the
:;; answer is to use the Parser HTML::Parser but that is not available to
:;; me.
:
:Huh? All CPAN mirrors deny you access?

Odd though it may sound, this can appear to happen.  If you cannot do ftp,
or not do so in the right mode (active/passive), then the muxxer might
not make you happy.  I've seen this happen.  The best thing to do in that
case is to use http://www.perl.com/CPAN-local/ as your preferred mirror.

--tom
-- 
Down that path lies madness.  On the other hand, the road to hell is
paved with melting snowballs. --Larry Wall in <1992Jul2.222039.26476@netlabs.com>


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

Date: Tue, 15 Jun 1999 07:44:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Backtits and tainting
Message-Id: <Pine.GSO.4.02A.9906150734140.4196-100000@user2.teleport.com>

On Tue, 15 Jun 1999, Peter Staab wrote:

> Ist it possible to disable the tainting.

There's no way to turn taint checking on or off during the running of a
program.

> I want to to something like
> 
> $out = ` $com`;
> 
> and $com is delivered from a file.

If you _know_ that the file can be trusted, see the IO::Handle manpage. 

If it may not be trusted, but you can identify a safe command by examining
it, the methods of the perlsec manpage should help you.

> I get the error : 'Insecure dependency...'
> I try to solve it with .
> 
> if ($com=~ /\w/)
>  {
>   $com = $1;
>  }

You haven't read the perlsec manpage carefully enough. And you need a
better understanding of how those memory variables work.

> But then I get the error:
> 'Insecure $ENV{PATH} while running setuid '

See the perlsec manpage again. When dealing with security issues, you can
never be too careful. Cheers!

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



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

Date: 15 Jun 1999 15:22:34 GMT
From: fmgst+@pitt.edu (Filip M. Gieszczykiewicz)
Subject: Re: better way?
Message-Id: <7k5r3q$407$1@usenet01.srv.cis.pitt.edu>

In Article <3763C880.73FD4779@home.com>, through puissant locution, Rick Delaney <rick.delaney@home.com> soliloquized:
>Tad McClellan wrote:
>> 
>> foreach ( @tmpstack[$#tmpstack-4 .. $#tmpstack] ) {
>...
>> foreach ( @tmpstack[-5, -4, -3, -2, -1] ) {
>
>Also:
>
>    foreach ( @tmpstack[-5 .. -1] ) {

Thank you to both Tad and Rick - this is much better!

-- 
Filip "I'll buy a vowel" Gieszczykiewicz  |  http://www.repairfaq.org/

                   Always and everything for the better!
 Now exploring whatever, life, and the meaning of it all... and 'not' :-)


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

Date: 15 Jun 1999 15:44:27 GMT
From: fmgst+@pitt.edu (Filip M. Gieszczykiewicz)
Subject: Re: Binary File Uploading - Part 2
Message-Id: <7k5scr$47p$1@usenet01.srv.cis.pitt.edu>

In Article <FD4F8t.Duy@csc.liv.ac.uk>, through puissant locution, ijg@csc.liv.ac.uk (I.J. Garlick) soliloquized:
>In article <01beb326$79e91480$fe31a2d1@ryano-ke>,
>"Ryan" <dfs@thegrid.net> writes:
>> sub print_results{
>>      open (NEWPIC,">../submits/$newname") || 		#open existing or create the
>
[snip]
>this will also have the added advantage of not dieing before that 500
>error occurs which in my experience generally means the prog stops running
>before a header is received, or that output was encountered before a
>header occured.
[snip]

For this reason, when I get any of the fun fun 500 errors I output a partial
header in the first line of code and then if I get an error (as long as it's
not a perl compile err - like a module not being found), I actually get a
browser error not the useless 500-series. Give it a whirl. I've found modules
I was using generating debugging messages this way - grrr.

Cheers,
Fil.
-- 
Filip "I'll buy a vowel" Gieszczykiewicz  |  http://www.repairfaq.org/

                   Always and everything for the better!
 Now exploring whatever, life, and the meaning of it all... and 'not' :-)


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

Date: Tue, 15 Jun 1999 16:14:26 +0200
From: "antonio" <aavendano@ocs.es>
Subject: call to dll, from cgi perl, anybody???
Message-Id: <7k5mf9$282$1@talia.mad.ttd.net>






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

Date: 15 Jun 1999 15:18:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: call to dll, from cgi perl, anybody???
Message-Id: <376660a9@newsread3.dircon.co.uk>

antonio <aavendano@ocs.es> wrote:
> 
> 
> 

Win32::API

/J\
-- 
"My codpiece layeth awkwardly across the nadgers" - Declan Donnelly


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

Date: Tue, 15 Jun 1999 07:55:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Case select statements: are they in Perl?
Message-Id: <Pine.GSO.4.02A.9906150748590.4196-100000@user2.teleport.com>

On Tue, 15 Jun 1999 armchair@my-deja.com wrote:

> since O'Reilly is into Perl big time, why don't
> they come out with a book version of the "perl manual".

That's a great idea. When you pitch it to them, you should suggest that
they put a camel on the cover. :-)

> Have you ever considered that if you had a comp.lang.perl.beginner and
> a comp.lang.perl.guru 

Yes, pretty much everyone who has been around c.l.p.* for more than a year
or two has considered that. Cheers!

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



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

Date: Tue, 15 Jun 1999 14:49:52 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: Case select statements: are they in Perl?
Message-Id: <37666615.431186974@news.newsguy.com>

On Tue, 15 Jun 1999 10:14:24 GMT, armchair@my-deja.com wrote:

>Regarding "documentation that comes with Perl" and the "documentation
>write in front of you", since O'Reilly is into Perl big time, why don't
>they come out with a book version of the "perl manual".

They more or less have--"Programming Perl" is very much like the
manual. They haven't come out with a book version of the FAQ, though.
Maybe they should.

>Have you ever considered that if you had a comp.lang.perl.beginner and a
>comp.lang.perl.guru you wouldn't have to spend your "valuable time"
>hectoring people trying to learn Perl. 

Yes he would. Many newbies would post in .guru because they'd expect
better answers there: Most newbies are not only newbies to Perl, but
also to Usenet (and in many cases to programming too). The only viable
solution is a moderated group, which is why we have clp.moderated.

And I still don't see how anybody could be angry at being pointed to
an extensive reference which will answer not only their current
question, but also many future ones.

Kvan, clarifying.

-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- |  dumb, panicky, dangerous animals
                                 |  and you know it.'
                                 |        - "K" in Men in Black.


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

Date: 15 Jun 1999 14:27:51 GMT
From: twarren10@aol.com (Twarren10)
Subject: Check URL
Message-Id: <19990615102751.11866.00000055@ng-fn1.aol.com>

Hey Guys,
   Is there any simple way in perl to check a list of
URL's to make sure they are still current? Not
to get info from the page or anything, just to check to see if 
it's not a dead link?


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

Date: 15 Jun 1999 15:38:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Check URL
Message-Id: <37666555@newsread3.dircon.co.uk>

Twarren10 <twarren10@aol.com> wrote:
> Hey Guys,
>    Is there any simple way in perl to check a list of
> URL's to make sure they are still current? Not
> to get info from the page or anything, just to check to see if 
> it's not a dead link?

You can use the module LWP::UserAgent available from CPAN to do this.

/J\
-- 
"When the boys in the playground found out that I had a potentially
fatal peanut alergy they would shove me up against a wall and make me
play Russian roulette with a bag of Revels" - Milton Jones


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

Date: Tue, 15 Jun 1999 16:45:30 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Date format with Foxpro
Message-Id: <7k5ovq$l42@news.vtcom.fr>

hi all,

i'm using DBD::XBase to access DBF files.

In a table i have a 'date' field, and, in a "select" query i want it to
return only the year and month...something like this :

Select distinct to_char(TheDate, 'YYYYMM') from Planning;  ( works with
Oracle...)

is there anybody to give me the rigth syntax ? or is the DBD::XBase unable
to do this ?

Thanks everybody

Eric




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

Date: 15 Jun 1999 15:55:52 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Date format with Foxpro
Message-Id: <37666978@newsread3.dircon.co.uk>

Ysteric's <eyounes@aol.com> wrote:
> hi all,
> 
> i'm using DBD::XBase to access DBF files.
> 
> In a table i have a 'date' field, and, in a "select" query i want it to
> return only the year and month...something like this :
> 
> Select distinct to_char(TheDate, 'YYYYMM') from Planning;  ( works with
> Oracle...)
> 
> is there anybody to give me the rigth syntax ? or is the DBD::XBase unable
> to do this ?
> 

I doubt if you can do this straigntforwardly - you will need to get the
date out in whatever format it comes as and then manipulate it later.

/J\
-- 
"Pat was wondering if he could put his massive tool in my box" - Mrs
Doyle, Father Ted


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

Date: 15 Jun 1999 16:01:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Date format with Foxpro
Message-Id: <37666ae2@newsread3.dircon.co.uk>

Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> Ysteric's <eyounes@aol.com> wrote:
>> hi all,
>> 
>> i'm using DBD::XBase to access DBF files.
>> 
>> In a table i have a 'date' field, and, in a "select" query i want it to
>> return only the year and month...something like this :
>> 
>> Select distinct to_char(TheDate, 'YYYYMM') from Planning;  ( works with
>> Oracle...)
>> 
>> is there anybody to give me the rigth syntax ? or is the DBD::XBase unable
>> to do this ?
>> 
> 
> I doubt if you can do this straigntforwardly - you will need to get the
> date out in whatever format it comes as and then manipulate it later.
> 

This is also mentioned in the XBase FAQ :

  <http://www.fi.muni.cz/~adelton/perl/man3/XBase::FAQ.html>

/J\
-- 
"William Hague, the world's favourite hairline" - Rory Bremner


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

Date: Tue, 15 Jun 1999 15:28:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Dynamic Regular Expression
Message-Id: <376670a3.33142953@news.skynet.be>

Rick Delaney wrote:

>Regardless, you still don't need eval for these.
 ...
>Combining ands and ors is a different story.  But a couple of posts have
>pointed to a module that would deal with that.

I really don't understand the aversion for eval(). A module is ok, but
eval() is bad? Why? 

Speedwise, I expect eval() to be FASTER than the module. After all,
use() is a superset of eval().

	use  <-  require  <-  do FILE  <- eval

	Bart.


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

Date: Tue, 15 Jun 1999 08:09:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Efficiency utils for Perl scripts on Unix and Windblow$?
Message-Id: <MPG.11d00c62fe37f6fa989be7@nntp.hpl.hp.com>

In article <x7r9nef3ny.fsf@home.sysarch.com> on 15 Jun 1999 01:12:17 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "MB" == Marc Bissonnette <dragnet@internalysis.com> writes:
> 
>   MB> So, I'm wondering if there are any utils out there that will tell
>   MB> me the efficiency/resource uses of a perl script. I know (well, I
>   MB> think, since I'm not a Unix wiz) there's a system command in unix
>   MB> that will tell you stuff like CPU usage, time to process, etc, but
>   MB> I don't know what it is.
> 
> use Benchmark ;

That module relies on these Perl functions, which you can use directly 
if more appropriate:

perldoc -f time
perldoc -f times

>   MB> so a) can someone tell me how to find that out on a unix machine? 
>   MB> b) is there some way of finding out the same information on a
>   MB> windblow$ machine?

Same difference. 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 15 Jun 1999 13:33:15 GMT
From: doug_brough@my-deja.com
Subject: Re: ENV Question
Message-Id: <7k5kmr$m56$1@nnrp1.deja.com>

I'm not totally tracking with you.  Let me (try to) rephrase the
problem.

In the Unix shell, ORACLE_HOME and LD_LIBRARY_PATH are set to point to
the Oracle Web Server Oracle Home.  But, I compiled Oraperl with Oracle
7.3.4 and this is the instance I want to point to - hence trying to
change the environment.

When I execute my little test script, I get the error message:

  relocation error: file /home/orca/rfadba/oas4.0/lib/libclntsh.so.1.0

But since I reset LD_LIBRARY_PATH, why is it even pointing to
/home/orca/rfadba/oas4.0?   What am I doing wrong?

Thanks!

doug


In article
<Pine.GSO.4.02A.9906101714190.26349-100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Thu, 10 Jun 1999 doug_brough@my-deja.com wrote:
>
> > #!/home/orca/rfadba/perl5/bin/perl
> > BEGIN {
> >
$ENV{LD_LIBRARY_PATH}="/usr/openwin/lib:/home/orca/rfadba/oracle7.3.4/lib";
> > $ENV{ORACLE_HOME}="/home/orca/rfadba/oracle7.3.4";
> > }
>
> Now, you do know that those are the right variable names and values
you
> want. Right? (Just checking... :-)
>
> > eval 'use Oraperl; 1' || print "error with Oraperl $@ $]\n";
>
> I think that's not what you want. Here's a better way:
>
>     use Oraperl;	# :-)
>
> If you really need it, here's another way.
>
>     {
> 	# Print extra info upon failure
> 	my $success;
>
> 	END {
> 	    print "Error occurred when loading Oraperl via perl $]\n"
> 		unless $success;
> 	}
>
> 	use Oraperl;
>
> 	BEGIN {
> 	    $success = 1;	# get here only upon success
> 	}
>     }
>
> Good luck with it!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>


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


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

Date: Tue, 15 Jun 1999 17:10:19 +0200
From: Bernt Rygg <berntr@persbraten.vgs.no>
Subject: Environment variables.
Message-Id: <37666CDA.52D4C352@persbraten.vgs.no>

Hi,
where can I find a listing of available environment variables like
REMOTE_HOST, REMOTE_ADDR etc.?
(Does that set depend on Perl or the operating system - in this case
RedHat Linux?)

Specifically I am interested in finding out if there is any
possibilities of accessing user names...

(BTW: Why does REMOTE_HOST not always hold a value ?)

Thanks,
Bernt.




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

Date: 15 Jun 1999 16:22:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Environment variables.
Message-Id: <37666fbb@newsread3.dircon.co.uk>

Bernt Rygg <berntr@persbraten.vgs.no> wrote:
> Hi,
> where can I find a listing of available environment variables like
> REMOTE_HOST, REMOTE_ADDR etc.?

I like 'set' :


BASH=/bin/bash
BASH_VERSION=1.14.7(1)
COLUMNS=80
EUID=1022
HISTFILE=/home/tdcjs/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/home/tdcjs
HOSTNAME=fatmog.dircon.co.uk
HOSTTYPE=i386
HUSHLOGIN=FALSE
HZ=100
IFS= 	

LESS=-M
LESSOPEN=|lesspipe.sh %s
LINES=24
LOGNAME=tdcjs
LS_OPTIONS= --color=auto -F -b -T 0
MAIL=/var/spool/mail/tdcjs
MAILCHECK=60
MANPATH=/usr/local/man:/usr/man/preformat:/usr/man:/usr/X11R6/man:/usr/openwin/man
MINICOM=-c on
NNTPSERVER=news.dircon.co.uk
OLDPWD=/usr/lib/perl5
OPENWINHOME=/usr/openwin
OPTERR=1
OPTIND=1
OSTYPE=Linux
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.
PPID=19835
PS1=\h:\w\$ 
PS2=> 
PS4=+ 
PWD=/home/tdcjs
REMOTEHOST=admin2.dircon.net
SHELL=/bin/bash
SHLVL=1
TERM=vt100
UID=1022
USER=tdcjs
_=set
ignoreeof=10

> (Does that set depend on Perl or the operating system - in this case
> RedHat Linux?)
> 
> Specifically I am interested in finding out if there is any
> possibilities of accessing user names...
> 

$ENV{LOGNAME} ?

> (BTW: Why does REMOTE_HOST not always hold a value ?)
> 

Ah.  You're talking about CGI.

Check out :

   <http://hoohoo.ncsa.uiuc.edu/cgi/env.html>

And also the CGI FAQ :

   <http://www.webthing.com/tutorials/cgifaq.html>

CGI issues are discussed in the newsgroup comp.infosystems.www.authoring.cgi

/J\
-- 
"Tony Blair is reported to be detained indefinitely under plans unveiled
by the Home Secretary" - Corrupt Teletext Page


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

Date: Tue, 15 Jun 1999 08:44:57 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Environment variables.
Message-Id: <Pine.GSO.4.02A.9906150840200.4196-100000@user2.teleport.com>

On Tue, 15 Jun 1999, Bernt Rygg wrote:

> where can I find a listing of available environment variables like
> REMOTE_HOST, REMOTE_ADDR etc.?

Check in the manpages for the programs which use them. But it looks as if
you're doing something with the Common Gateway Interface. You should check
the docs, FAQs, and newsgroups about CGI programming, and the CGI spec.

    http://hoohoo.ncsa.uiuc.edu/cgi/
    http://hoohoo.ncsa.uiuc.edu/cgi/env.html

Cheers!

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



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

Date: Tue, 15 Jun 1999 08:22:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: File Processing
Message-Id: <MPG.11d00f85d347183c989be8@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37661890@newsread3.dircon.co.uk> on 15 Jun 1999 10:10:40 
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
 ...
>     my $r
>     while($r = <FILE>)
>      {
>        print $r;
>      }

You are missing a semicolon there.  But what you really want for those 
five lines is:

       print while <FILE>;

See how many characters that saved!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 15 Jun 1999 14:01:28 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: function to retrieve number of members in list
Message-Id: <7k5mbo$1lr$1@pegasus.csx.cam.ac.uk>

In article <7k3nv3$ip6$5@fcnews.fc.hp.com>, Andrew Allen <ada@fc.hp.com> wrote:
>dalehend@flash.net wrote:
>
>For a list, it's a little more tricky.
>
>  scalar(()=(8,9,0))
>
>yields 3

But beware that, for example

   scalar(()=split /,/, 'a,b,c,d,e')

doesn't yield 5.


Mike Guy


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

Date: Tue, 15 Jun 1999 22:36:20 +0800
From: "Simon Lee" <silee@hk.super.net>
Subject: Re: Get last execution time for a cron job
Message-Id: <7k5oo2$kvl$1@hfc.pacific.net.hk>

Sorry, My question is how to implement it in Perl ? :-)

I use Solaris, the cron log files are root owned.

Why I need this info is I need to check if the Unix backup are complete for
our machines. (Get this date and then check it with the time in
/etc/dumpdates)


Thanks,
Simon


Malcolm Ray wrote in message ...
>On Tue, 15 Jun 1999 18:59:39 +0800, Simon Lee <silee@hk.super.net> wrote:
>>Hi all,
>>
>>
>>Does anyone know how to get the last execution time for a cron job ? For
>>example, I get a cron job entry:
>>
>>0 23 * * * /opt/scripts/unix_backup.sh
>>
>>If the current time is 'Tue Jun 15 18:57:08 1999', the last execution
should
>>be 'Mon Jun 23:00:00 1999' <-- I just want to get this.
>>
>>
>>
>>Any idea ?
>
>And your perl question is...?
>
>Some flavours of cron can be persuaded to log their actions - consult
>your cron manpage.  You *could* read that logfile, though this is rather
>non-portable.  A better method would be to modify the cron job to write
>a timestamp to a file, which you could then read.
>--
>Malcolm Ray                           University of London Computer Centre












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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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