[10664] in Perl-Users-Digest
Perl-Users Digest, Issue: 4256 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 19 14:07:22 1998
Date: Thu, 19 Nov 98 11:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 19 Nov 1998 Volume: 8 Number: 4256
Today's topics:
Re: A PAGE WITH: HTML,JAVA,JAVASCRIPT,PERL,PHISH,AND MO <montyt@bestnet.com>
Re: a RE for email addresses? <*@qz.to>
Re: ActiveState & Xitami <burt.adsit@gte.net>
Calling functions from a hash <bruce.w.mohler@saic.com>
Re: Faking flock in MacPerl (Randy Kobes)
HELP: how to prompt for input from command line? <mblase@ncsa.uiuc.edu>
Re: How do i trim a string in Perl?? <montyt@bestnet.com>
Re: How do i trim a string in Perl?? (Larry Rosler)
Re: how to execute <perlguy@technologist.com>
Re: How to parse a <SELECT ... MULTIPLE> list in script <mblase@ncsa.uiuc.edu>
Re: make ref to copy of data <r28629@email.sps.mot.com>
Re: Need equivalent to a sh's export command. <hendrik.woerdehoff@sdm.de>
Re: Oracle Longs - Malloc Problem (Jacqui Caren) (Jacqui Caren)
Re: perl 5.005_02 (Greg Ward)
Re: Perl Array Question? Anybody... (Andrew M. Langmead)
Re: perl documentation date (Greg Ward)
Re: Perl script to automatically find dependencies (Clinton Pierce)
Re: Perl script to automatically find dependencies (David B. White)
Re: Perl script to automatically find dependencies (Larry Rosler)
Re: pod2man and Y2K <uri@sysarch.com>
Re: reverse comma operator in the camel <Kien_Ha@Mitel.COM>
Re: Sounds easy when I type it fast <burt.adsit@gte.net>
Re: Stop and start program within Perl (Greg Ward)
Tracking Subroutines <dolezal@mrms.navy.mil>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Nov 1998 10:13:34 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Re: A PAGE WITH: HTML,JAVA,JAVASCRIPT,PERL,PHISH,AND MORE
Message-Id: <731n4t$1ev3@roc344.ghc.org>
Don't post about a page unless there is actually information there...
especially the perl link if your posting to clpm.
And if you're going to use frames, that one on the left needs a scrollbar as
well.
--
--------------------------------------------------------------
Monty Taylor
Best Consulting -- Seattle, WA
montyt@bestnet.com
<cooldude7892@yahoo.com> wrote in message
news:3650C287.83362077@yahoo.com...
>COME TO MY PAGE AND SIGN MY GUESTBOOK!!!!
>
>http://www.gettysburg.edu/~jmcmilla/
>
------------------------------
Date: 19 Nov 1998 18:41:05 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: a RE for email addresses?
Message-Id: <eli$9811191331@qz.little-neck.ny.us>
In comp.lang.perl.misc, Matthew Bafford <dragons@scescape.net> wrote:
> Randal Schwartz > <merlyn@stonehenge.com> pounded in the following:
> => >>>>> "Clay" == Clay Irving <clay@panix.com> writes:
> => Clay> I tried your examples with the Email::Valid module:
> => Really? Where is this mythical potentially-quite-useful module?
> http://www2.classmates.com/~maurice/
> # This module is based on:
> #
> # addrcheck - mail address checker
> # by tchrist@perl.com
Then it is probably broken. Email addresses do not lend themselves
to checking, since some RFC-invalid forms are widely enough accepted
to generally usable. (Eg addresses of the form: <foo.@example.com>
are forbidden by spec since there is not text on both sides of the
<.>.)
Sendmail and a few other Unix mailers I have played with are also
quite happy to accept control characters in the username. (I have
not tried high-bit set characters, I suspect they will have more
problems.)
For cgi, etc, stuff any checker should probably not be stricter
than m/.@../;.
Elijah
------
<@qz.to> (with a <ctrl-H>) is a working address for me
------------------------------
Date: 19 Nov 1998 17:53:37 GMT
From: Burt Adsit <burt.adsit@gte.net>
Subject: Re: ActiveState & Xitami
Message-Id: <731lv1$fb7$0@205.138.137.59>
Install Apache and the GS Perl port. Your results will vary.
Alistair Calder wrote:
>
> Has anyone tried ActiveState's Perl setup with Xitami Web Server? I am
> running a very busy Intranet that is using up loads of processor time for
> all the Perl scripts that are going on. I want to use ActiveState, but I am
> a little wary of installing it if it isn't going to work.
>
> Has anyone had any experiences they can share?
>
> Thanks,
> Alistair
>
> "Uh, do you want that to go?"
> - recently heard at a fast-food drive thru window
--
Burt Adsit
Earthenware
http://www.featurefarm.com
lat n43.10' lon w86.2'
------------------------------
Date: Thu, 19 Nov 1998 10:30:41 -0800
From: Bruce Mohler <bruce.w.mohler@saic.com>
Subject: Calling functions from a hash
Message-Id: <365463D0.B54F556C@saic.com>
I've done this before but it's not working in the script that I'm
currently writing, therefore I'm doing something stupid and just
can't see it. I'm providing an example of what I'm trying to do
and I'm hoping someone can spot what I'm doing wrong in the
source below (and tell me what it is).
The goal is to store function references into a hash. Two other
arrays ("Categories" and "Subcategories") then provide the order
that the functions are called out of the hash. The functions are
almost always called from a Perl module located in the same
directory as the Perl source.
Somehow, I can print the values out, but when it comes to actually
calling the script, it believes that the variables (or the resulting
hash
reference) is undefined. I don't understand this. Here's the source.
Thanks to Microsoft Outlook for the nice reformatting job.
------------------------ begin ant.pl ---------------------------
#!/usr/local/bin/perl -w
use bee;
$Debug = 1;
@Categories = (
"General",
);
@General = (
"Info",
);
%General = (
Info => \&AddDummyField,
);
sub ProcessAllCategories
{
print "ProcessAllCategories()...\n" if $Debug;
print "\nKeys in General hash:\n" if $Debug;
foreach $Key (keys %General) {
print "\t$Key\n" if $Debug;
}
foreach $Category (@Categories) {
print "\nProcessing category $Category...\n" if $Verbose;
foreach $Subcategory (@{$Category}) {
print "Processing subcategory $Subcategory...\n" if $Verbose;
# call the function to collect the information
print "\tcalling $Category\{$Subcategory\}\($Subcategory\) " if
$Debug;
my $Response = &{$Category{$Subcategory}}($Subcategory);
print "which returned $Response\n" if $Debug;
}
}
return;
}
ProcessAllCategories();
exit 0;
------------------------ end ant.pl ---------------------------
------------------------ begin bee.pm ---------------------------
package bee;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(
&AddDummyField
);
sub AddDummyField
{ my $Subcategory = $_[0];
print "AddDummyField(\"$Subcategory\")...\n" if $main::Debug;
return "DUMMY";
}
1;
------------------------ end bee.pm ---------------------------
This is what I get when I run ant.pl:
Use of uninitialized value at ./ant.pl line 35.
Undefined subroutine &main:: called at ./ant.pl line 35.
ProcessAllCategories()...
Keys in General hash:
Info
calling General{Info}(Info)
What I don't understand is why it can print the key from the hash
and print out the values in the "calling..." line, but not call the
function.
You can tell from the file names that this really has me bugged.
Thanks, in advance, for any help.
Bruce Mohler
--
Bruce W. Mohler 619-458-2675 (voice)
SAIC/ITS/Server Support 619-535-7806 (fax)
Sr UNIX system administrator 888-781-5697 (pager)
mailto:bruce.w.mohler@saic.com
Of course my password is the same as my pet's name.
My dog's name is Q47pY!3, but I change it every 90 days.
------------------------------
Date: 19 Nov 1998 17:10:37 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Faking flock in MacPerl
Message-Id: <slrn758kpb.fgs.randy@theory.uwinnipeg.ca>
On Thu, 19 Nov 1998 10:31:55 -0600, Mary E Tyler <dejahvu@erols.com> wrote:
>The Macintosh doesn't support explicit file locking so Mac Perl doesn't
>either. But the unix web server that i use at my web host *does.* What
>
>The problem stems from my inherent laziness (a virtue!). I don't want to
>have to comment out the calls to flock every time I want to check syntax
>or run the script on my mac. Is there a mechanism where by I can put in
>some separate file somewhere something like:
>
>sub flock($$) {} #does nothing
>
>Then I can either comment that line out when i upload it or i can do
>something even stupider and put a file with the same name as the fake
>one with something like:
>
>sub flock($$) {Blah...} #code which actually calls flock
>
Hi,
If it's worth the trouble, you could look at the module
LockFile::Simple, available at
http://www.perl.com/CPAN/authors/id/RAM/
which might provide a reasonable alternative when flock isn't
available. Then in your script, you could test the value of
$OS, and if it matches /^Mac/i, use the lock() method of
LockFile::Simple, otherwise use flock(). Alternatively, you
could just call flock() only if $OS doesn't match /^Mac/i, and
if it does match /^Mac/i, do nothing - for this you should
make sure there wouldn't be other processes trying to access
the same file, which is probably a reasonable assumption on a
single user machine most of the time.
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Thu, 19 Nov 1998 11:42:53 -0600
From: Marty Blase <mblase@ncsa.uiuc.edu>
Subject: HELP: how to prompt for input from command line?
Message-Id: <3654589D.8DEA2FA2@ncsa.uiuc.edu>
The subject says it all, really. I need to step through an existing data
file and prompt the user to enter a new value in the row of data, based on
the data already there. In other words, for each line of data it needs to
display the data to the command line and prompt the user for new data to
append.
I've never had to do this in Perl before. What's the most straightforward
way?
Thanks for any suggestions --
- Marty Blase
mblase@ncsa.uiuc.edu
------------------------------
Date: Thu, 19 Nov 1998 10:07:16 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Re: How do i trim a string in Perl??
Message-Id: <731mp3$1ev2@roc344.ghc.org>
First of all, go buy a book, or read the docs, or take a class, or
SOMETHING!
Second ...
($string =~ s/^\s*//) =~ s/\s*$//;
--
--------------------------------------------------------------
Monty Taylor
Best Consulting -- Seattle, WA
montyt@bestnet.com
xxx <xx@xxx.com> wrote in message news:72q6c3$pih$1@supernews.com...
>Hi,
>How do i trim a string in Perl??
>
>I need to get rid of leading and trailing spaces in a string!
>
>Thanks in advance !
>
>
------------------------------
Date: Thu, 19 Nov 1998 10:51:37 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do i trim a string in Perl??
Message-Id: <MPG.10be08974fa50149989881@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <731mp3$1ev2@roc344.ghc.org> on Thu, 19 Nov 1998 10:07:16 -
0800, Monty Taylor <montyt@bestnet.com> says...
> First of all, go buy a book, or read the docs, or take a class, or
> SOMETHING!
The docs to read include perlfaq4: "How do I strip blank space from the
beginning/end of a string?"
> Second ...
>
> ($string =~ s/^\s*//) =~ s/\s*$//;
Did it occur to you to test this before subjecting thousands of readers
to it?
Can't modify substitution in substitution at try.pl line 5, near
"s/\s*$//;"
Execution of try.pl aborted due to compilation errors.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 19 Nov 1998 16:42:45 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: how to execute
Message-Id: <36544A85.C5E8B8EA@technologist.com>
Casema wrote:
>
> I made this tiny little script, called stats.pl which I want executed
> everytime someone requests a document.
> It puts the requester's IP, Date, Time, Colordepth, Screenresolution and
> platform in a database and returns no html at all. Just does as stated.
> How do I call this script?
>
Take a look at some documentation on Server Side Includes (SSI's). Your
web server *should* have some documentation on this subject. Also,
DejaNews, Yahoo and the others have information on SSIs if you do the
searching...
Good luck!
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 19 Nov 1998 11:45:53 -0600
From: Marty Blase <mblase@ncsa.uiuc.edu>
Subject: Re: How to parse a <SELECT ... MULTIPLE> list in script using a foreach loop?
Message-Id: <36545951.BD1F27BE@ncsa.uiuc.edu>
dave@mag-sol.com wrote:
>
> Of course, if you're using CGI.pm then you have no problems at at all. If
> you're expecting multiple values then the 'param' function will return a list
> of values that can be assigned to an array.
But if you're not, and you're using ACTION=POST in your form, then you
should just be able to split the submitted value into an array by \0 (that's
a zero) to separate the selections.
@values = split(/\0/,$value);
- Marty
------------------------------
Date: Thu, 19 Nov 1998 12:05:20 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Xah <xah@best.com>
Subject: Re: make ref to copy of data
Message-Id: <36545DE0.86954E6E@email.sps.mot.com>
[posted to c.l.p.m and copy emailed]
Xah wrote:
>
> I (xah) wrote:
> >I want to make a reference to a copy of a data. What is the idiomatic way?
> >
> >Here's what I do now
> > &{sub {my @aa = @{$_[0]}; return \@aa;}}($ref_data)
>
> I think I found the answer: use [@array].
>
> The difference between "$ref = \@array" and "$ref2 = [@array]" is that
> the former is a reference to @array, while the latter is a reference
> to a copy of @array. The effect is that changes to @$ref will change @array,
> but not so with @$ref2.
$ref2 = [@array] creates an anonymous array, stuff it with the values of
@array, an assign its reference to $ref2. Look up for anonymous array
composer in Camel.
-TK
------------------------------
Date: Thu, 19 Nov 1998 18:25:27 +0100
From: Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de>
Subject: Re: Need equivalent to a sh's export command.
Message-Id: <36545487.7751@sdm.de>
Thomas Jordan wrote:
> On Thu, 19 Nov 1998 09:17:22 GMT, dave@mag-sol.com wrote:
> >In article <36532a40.623599749@news.alpha.net>,
> > *ace*@programmer.net (Thomas Jordan) wrote:
> >> How do you modify the parent shell's environment?
> >>
> >> $ENV{CVSROOT}="/cvsroot";
> >>
> >> only changes the variable in the perl process.
> >>
> >> The following:
> >>
> >> system('export CVSROOT=/cvsroot');
> >>
> >> doesn't seem to work either.
> >
> >You can't. This is nothing to do with Perl, but a feature of the operating
> >system. In general a child process can't alter the environment of its parent.
> >
> >(You can't do it in the shell either. The export command you were trying makes
> >the variable available to child processes, not the parent.)
>
> Ok.
> I was confusing export with bash's source command.
> Given a file like .profile, you can mod it and then do:
> . ~/.profile
> and all of the export commands get reflected into the
> calling process' environment.
Not quite correct. The shell itself interprets the .profile and applies
the changes to its environment. The changes will _not_ appear in any
other process, especially not in the environment of the caller of the
shell. Only child processes of the shell started after this action will
inherit the changed environment.
> I'm trying to do the same thing by calling a perl script
> but source it's environmental changes into the calling process.
You cannot do this. Neither on UNIX nor on NT. Period.
If your calling process happens to be a shell you might be able to write
the shell commands to change the environment to a file. Then the shell
could source this file. But that's the _only_ way to do it.
Yours
Hendrik
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
any and all unsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500
US (per infraction). E-mailing denotes acceptance of these terms.
--
Hendrik W"ordehoff |s |d &|m | software design & management
| | | | GmbH & Co. KG :
woerdehoff@sdm.de | | | | Thomas-Dehler-Str. 27 >B)
Tel/Fax (089) 63812-337/515 81737 M"unchen :
------------------------------
Date: Thu, 19 Nov 1998 17:36:05 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Oracle Longs - Malloc Problem
Message-Id: <F2oJK5.K9q@ig.co.uk>
In article <362BA51E.2C39105D@anitesystems.be>,
Paul O'Driscoll <paul.odriscoll@anitesystems.be> wrote:
>Does anyone have any experience selecting LONGS
>from an Oracle database with PERL.
Yes - do it all the time.
>I get a malloc panic error !!
Really, well done that man! :-)
Well assuming this is some form of guessing game;
my first guess is that you are running HP-UX. The fix is
to upgrade HP-UX, install a clean perl, DBI and DBD::Oracle,
or even go buy Solaris or Linux ;-)
The second guess is that you are running Solaris and have gcc.
In this case make sure that you are not using the gcc linker
(gld?) as this has some nasty effects.
Sorry, thats all the guess-time I have free :-)
Seriously, try the dbi-users mailing list, but before emailing
these kind folks try providing some information about
platform hardware
platform operation system and patches
version of Oracle server
version of PRO*C
...
version of perl (perl -V)
version of DBI
version of DBD::Oracle
a small (10 line) test case with DBI_DEBUG set to 2. i.e.
use DBI;
my $dbh= DBI->connect('dbi:Oracle:tnsname','user','pass',{
RaiseErrors=> 1, AutoCommit => 1 });
...
$dbh->debug(2);
my $sth = $dbh->prepare('select long_field from table');
$sth->execute();
my $val;
while (($val) = $sth->fetchrow_array()) {
print length($val)."\n";
}
$sth->finish();
$dbh->disconnect();
Also before asking, make sure that the version you are using
is up to date. There is nothing worse telling the world
you have a problem you cant fix then finding out a freely
available upgrade (obvious answer #1) fixes it.
Of course, you could contact TPC - thay way you get people such
as Tim Bunce (Mr DBI and DBD::Oracle) helping you, but remember
that it is a *commerical* service - you pay to use it...
Hope this helps...
Jacqui
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: 19 Nov 1998 18:00:09 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: perl 5.005_02
Message-Id: <731mb9$3i5$1@news0-alterdial.uu.net>
On Wed, 18 Nov 1998 12:21:08 +0000, Balazs Rauznitz <prauz@sprynet.com> wrote:
>I've just compiled and installed Perl 5.005_02 on my linux box. My
>qusetion is where can I find some docs on what's new in Perl 5.005. I
>know there are the Changes files in the distribution, but I don't think
>they are docs. Also why is there not a Changes5.005 which would list the
>deltas from 5.004 to 5.005 ?
See the 'perldelta' man page distributed and installed with Perl.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Thu, 19 Nov 1998 18:42:35 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl Array Question? Anybody...
Message-Id: <F2oMMz.J6r@world.std.com>
lr@hpl.hp.com (Larry Rosler) writes:
>[Posted to comp.lang.perl.misc and copy mailed.]
>In article <730e5s$keb$1@nnrp1.dejanews.com> on Thu, 19 Nov 1998
>06:34:36 GMT, Patrick Timmins <ptimmins@netserv.unmc.edu> says...
>...
>> if (@{$type{$header}{$key}} eq undef) {
>This produces a warning if the '-w' flag is set. A more canonical way
>of stating this might be:
> unless (defined(@{$type{$header}{$key}})) {
Patrick's code doesn't do the right thing either. The value returned
from the undef() function gets converted to the string value "" in the
string comparison.
$foo = '';
print "undefined\n" if $foo eq undef;
And then to add to the problems, both code snippets are checking if an
array is defined, and perlfunc has this to say about checking the
defined-ness of arrays.
On the other hand, use of defined()
upon aggregates (hashes and arrays) is not
guaranteed to produce intuitive results, and
should probably be avoided.
--
Andrew Langmead
------------------------------
Date: 19 Nov 1998 18:11:12 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: perl documentation date
Message-Id: <731n00$3i5$2@news0-alterdial.uu.net>
On Thu, 19 Nov 1998 02:27:44 -0800, Xah <xah@best.com> wrote:
>Few questions on perl documentations:
>
>1. Is there a date stamp (version number) for on-line perl
>documentation? (e.g. I have access to Perl on several
>machines/OSes. Occasionally I noted that they are not identical. How do
>I know which is the latest? or which distributed with what version of
>Perl?)
If you're reading the online docs as man pages, check the bottom of
every page. For instance, if I run "man perl" on the main server here,
I scroll down a bit and find:
8/May/97 Last change: perl 5.004, patch 03 1
but if I run it on my workstation, I get:
24/Jul/98 Last change: perl 5.005, patch 02 1
So yes, both a version and date are available. The date seems to be the
last-update time for that particular man page, not the date for the
whole Perl release.
>3. Who is maintaining core on-line docs? Can user contribute?
> (perl on-line docs sucks big time.)
I believe Tom Christiansen has a lot to do with maintaining the docs,
but there must be other people involved -- there's such a huge amount of
high-quality documentation available that I have a hard time
believing one guy keeps on top of all of it.
If you're interested in contributing, you might want to join the Perl
Documentation mailing list. Find out more at
http://www.perl.org/maillist.html
The list has been pretty quiet since I joined a month or so ago, though.
(Incidentally, it's usually much nicer to give reasoned criticism rather
than saying something "sucks big time". Not many people listen to that
sort of flamage, but some do -- and are likely to bite your head off
for it. Look out.)
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Thu, 19 Nov 1998 16:15:07 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: Perl script to automatically find dependencies
Message-Id: <365a4398.606339305@news.ford.com>
[cc to poster sent in E-Mail]
On Thu, 19 Nov 1998 09:44:44 -0600, "Mark Wright"
<markscottwright@hotmail.com> wrote:
>I'd like to be able to use perl without installing the full (20 meg)
>package. I'm using the win32 package, and it appears that if I
>install perl.exe, perl.dll and cw3230mt.dll, I've got all the
>executable code I need. Now all I need is a way to recurse the
>'require' statements to get the list of perl scripts/libraries I need
>for my application. Is there a perl script that will do this
>automatically for me?
Isn't this an FAQ by now?
What you want is "perl2exe". It will give you an executable, and a
couple of DLL's that will run your script as a self-contained EXE
application under Win32.
http://www.demobuilder.com
------------------------------
Date: 19 Nov 1998 17:49:39 GMT
From: dbwhite@btv.ibm.com (David B. White)
Subject: Re: Perl script to automatically find dependencies
Message-Id: <731lnj$lro$1@mdnews.btv.ibm.com>
In article <36543cf2.0@news2.uswest.net>,
"Mark Wright" <markscottwright@hotmail.com> writes:
> executable code I need. Now all I need is a way to recurse the
> 'require' statements to get the list of perl scripts/libraries I need
> for my application. Is there a perl script that will do this
> automatically for me?
Mark,
Copy (or add) the END block shown below
END { foreach ( sort keys %INC ) { print "$_\n" } }
to your application, then run the application and terminate. It will
print the list of modules that have been 'use'd or 'require'd by your
application.
While you're running your application, it's up to you to insure that
you've gone down all the code paths that do conditional 'require's...
--
David B. White
IBM Microelectronics, Circuit Verification & Design Tools
Internal: dbwhite@btv Internet: dbwhite@vnet.ibm.com
Phone: 802-769-5671 (TieLine: 446) Fax: 802-769-5722
------------------------------
Date: Thu, 19 Nov 1998 10:57:49 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl script to automatically find dependencies
Message-Id: <MPG.10be0a077aee379989882@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <731lnj$lro$1@mdnews.btv.ibm.com> on 19 Nov 1998 17:49:39
GMT, David B. White <dbwhite@btv.ibm.com> says...
> Copy (or add) the END block shown below
> END { foreach ( sort keys %INC ) { print "$_\n" } }
> to your application, then run the application and terminate. It will
> print the list of modules that have been 'use'd or 'require'd by your
> application.
@INC is an array, not a hash.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 19 Nov 1998 13:17:25 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: pod2man and Y2K
Message-Id: <x73e7f4kei.fsf@sysarch.com>
>>>>> "MW" == Morten Welinder <terra@diku.dk> writes:
MW> Is it just me, or is the pod2man converter broken? It contain this
MW> code, that will invent "Year 100" in about 400 days.
MW> my ($sec, <SNIP> $year,$wday,$yday,$isdst) = localtime($secs);
MW> return "$mday/$mname/$year";
looks y2k broken to me.
this is another reason to rewrite the pod2xxx progs with the pod::parser
modules. not that that was a pod bug, just an incentive to do a rewrite.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 19 Nov 1998 13:50:12 -0500
From: Kien Ha <Kien_Ha@Mitel.COM>
Subject: Re: reverse comma operator in the camel
Message-Id: <36546864.4A994CFC@Mitel.COM>
J.D. Laub wrote:
> On page 48 of the camel:
>
> # A "reverse comma operator".
> return (pop(@foo),pop(@foo))[0];
>
> On page 93, when discussing the comma operator, the book states that "in a
> scalar context it evaluates its left argument, throws that value away, then
> evaluates its right argument and returns that value." Given that, I would
> think a reverse comma operator would evaluate its RIGHT argument, then
> evaluate and return its LEFT argument. So, I'll plug in some values into the
> example. Stripping off the 'return' because I'm not in a subroutine or eval
> leaves me with:
>
> #!/usr/local/bin/perl -w
> my @foo = (101, 303);
> my $a = (pop @foo, pop @foo)[0];
^^^^^^^^^^^^^^^^^^^^ this is a slice of 2 elements.
first pop gives 303, second pop gives 101. So,
(pop @foo, pop @foo) becomes (303,101)
(pop @foo, pop @foo)[0] becomes (303,101)[0] which is 303.
if you write:
my $a = (pop @foo, pop @foo) #no index given;
then
print "a=$a.\n";
would print 101. The scalar will get the last element of a slice if you
are
assigning a slice to a scalar. That's the rules !
__
kh
------------------------------
Date: 19 Nov 1998 18:15:51 GMT
From: Burt Adsit <burt.adsit@gte.net>
Subject: Re: Sounds easy when I type it fast
Message-Id: <731n8n$i05$0@205.138.137.59>
Jenny, whatever you are doing stop. Stop now. You are just going to
sprain something. What is it you want done? Give me the specs and I'll
be happy to implement it. What you can imagine, can be done.
Jeez guys...
Jenny Brandis wrote:
>
> I know nothing about programming but would like to make my site
> interactive with a searchable database and maybe get some user stats.
>
> Sounds easy when I type it fast. <g>
>
> I have asked my ISP what is available in his cgi-bin and was told I
> should have my own. So I downloaded STABLE.ZIP to my hard drive.
>
> I made a directory called cgi-bin on my ISP server, above my public
> directory as he told me.
>
> Downloaded a couple of scripts that sound ok. (Matt's simple search,
> urlsrch.cgi, websearch and intermediate search.)
>
> But now what? I guess I need to upload the (unzipped) stable.zip to my
> cgi-bin, but do I need all those files? Or just some that run the bits I
> want?
>
> Is it true that with cgi I can't test drive it on my computer like I do
> HTML?
>
> Any (helpful) advise would be welcome.
>
> I guess I should have mentioned that I live in a very small town and to
> the best of my knowledge there is no one who can guide me in this. Even
> the school teachers are 'out of their area of expertise'.
>
> --
> Jenny Brandis Meekatharra, Western Australia
> Aussie and Kiwi Genealogy http://www.benet.net.au/~brandis/
> Research interests:
> http://carmen.murdoch.edu.au/community/dps/research/bra01.html
--
Burt Adsit
Earthenware
http://www.featurefarm.com
lat n43.10' lon w86.2'
------------------------------
Date: 19 Nov 1998 18:18:29 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Stop and start program within Perl
Message-Id: <731ndl$3i5$3@news0-alterdial.uu.net>
On Thu, 19 Nov 1998 11:21:20 GMT, Hawkwynd <hawkwynd@adelphia.net> wrote:
>What I would like to do is have Perl stop the service, perform the
>script, and then start the OmniHttpd again to resume activity. The
>access.log file is open while the server is running, and will not allow
>for file manipulation.
You didn't mention which OS this server runs under. You also didn't
mention anything about how the server stores information about itself.
A common convention in the Unix world is for daemons -- both the NCSA
and Apache http servers work this way -- to write their PID (process id)
into a small text file in a known location. Thus, an inefficient,
hard-coded, non-robust way to kill the currently running Apache server
is:
kill 'TERM', `cat /usr/local/etc/httpd/logs/httpd.pid`;
It's more efficient (and allows better error checking) to open and read
the httpd.pid file yourself, and of course the directory where it lives
should be a in a variable rather than hard-coded. And you should
check that kill succeeds too. Second pass:
$dir = '/usr/local/etc/httpd/logs';
$pid_file = "$dir/httpd.pid";
open (PID, $pid_file) || die "$0: couldn't open $pid_file: $!\n";
chop ($pid = <PID>);
die "$0: contents of $pid_file not a number\n"
unless $pid =~ /^\d+$/;
kill ('TERM', $pid) || die "$0: couldn't kill process $pid: $!\n";
How much of this is applicable to your situation, I don't know. But
that's the general way to kill a daemon under Unix.
BTW, it's nice if you keep USENET posts to under 80 columns (actually 72
is even better, to avoid overflow on quoting).
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Thu, 19 Nov 1998 16:00:52 GMT
From: Tim Dolezal <dolezal@mrms.navy.mil>
Subject: Tracking Subroutines
Message-Id: <365440B4.FD2B7841@mrms.navy.mil>
I would like to know if there is a variable or a module to track or display the
current subroutine the script is executing.
Tim
------------------------------
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 4256
**************************************