[23277] in Perl-Users-Digest
Perl-Users Digest, Issue: 5497 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 13 09:05:44 2003
Date: Sat, 13 Sep 2003 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 13 Sep 2003 Volume: 10 Number: 5497
Today's topics:
Re: $SIG{__DIE__} doesn't make sense when using CGI::Ca <jwillmore@cyberia.com>
Re: .doc > .txt <member39405@dbforums.com>
Re: Matching { } braces ??? <bwalton@rochester.rr.com>
Mod_perl & do() <ppagee@yahoo.com>
Re: Mod_perl & do() (Jay Tilton)
Re: Mod_perl & do() <ppagee@yahoo.com>
Re: Mod_perl & do() <ak+usenet@freeshell.org>
Re: Mod_perl & do() (Jay Tilton)
Re: Mod_perl & do() <ppagee@yahoo.com>
Re: Perl DBMS <dave334234@inter.com>
Re: Perl DBMS <ge0rge@Talk21.com>
regex help! <geoff.cox@blueyonder.co.uk>
Re: regex help! <ak+usenet@freeshell.org>
Re: regex help! <mbudash@sonic.net>
Re: regex help! <geoff.cox@blueyonder.co.uk>
Re: regex help! <ak+usenet@freeshell.org>
Re: regex help! <geoff.cox@blueyonder.co.uk>
Re: regex help! <ak+usenet@freeshell.org>
Re: regex help! <geoff.cox@blueyonder.co.uk>
Which Perl files (other than modules) are used by a scr <jgowland@gena_NO_SPAM_PLEASE_ware.com>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Sep 2003 05:04:42 GMT
From: James Willmore <jwillmore@cyberia.com>
Subject: Re: $SIG{__DIE__} doesn't make sense when using CGI::Carp
Message-Id: <20030913010452.55947826.jwillmore@cyberia.com>
On Fri, 12 Sep 2003 22:37:34 +0200
Jo Oberman <johanoberm@gmx.de> wrote:
<snip>
> $SIG{__DIE__} = \&myDie;
> sub myDie {
> print "<b>ERROR-Message: $_[0]</b>";
Can be simplified and changed to:
$SIG{__DIE__} = sub{print "<b>ERROR-Message: $_[0]</b>\n";};
Notice the new line character at the end of the line. If it is
omited, then the line number of the error will be printed. Bad move
for a CGI script. The user does _NOT_ need that information.
> }
> eval {
> print "Content-type: text/html\n\n";
> print "Just some text<br>";
>
> die "I'm dying. Please help!";
>
> print "some text never shown";
> };
Why are you doing an 'eval' here? And, again, no new line in the
'die' statement - bad move.
If the 'eval' is done away with, you get your message .... if you use
the 'eval', you get your message .. so, what's the question again?
<snip>
> What is the way to undo the CGI::Carp handler definitions?
> Just wanna know 1.) why CGI::Carp::die handler is still active when
> I overwrite it with my own handler and 2.) how I can
> prevent it?
>
> By the way:
> The above example-script simplifies the core problem for discussion!
> In real life there are two scripts installed running under mod_perl.
> One of it uses CGI::Carp. The otherone defines the signal handler.
Use one or the other, but not both. I posted a similar question about
2 months ago. That's the way I handled it - because the effort to go
through was too much (although, my question related to a script having
a signal handler and the moudle it used and _I_ wrote used a signal
handler and one was over riding the other).
You can override one in favor of the other, but, IMHO, it's more
effort than it's worth.
An alterante method that _may_ work is ...
==untested==
BEGIN{
$SIG{__DIE__} = sub { print "<b>ERROR-Message: $_[0]</b>"; };
}
use CGI::Carp;
eval{
print "Content-type: text/html\n\n";
print "Just some text<br>";
die "I'm dying. Please help!";
print "some text never shown";
};
if($@){die "DIED";}
Here, you're using the BEGIN block to set up the error handling. It
_may_ do what you want it to do. Although, my first thoughts should
apply - use one or the other.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Certainly there are things in life that money can't buy, but it's
very funny-- Did you ever try buying them without money? --
Ogden Nash
------------------------------
Date: Sat, 13 Sep 2003 03:52:30 -0400
From: johnjc <member39405@dbforums.com>
Subject: Re: .doc > .txt
Message-Id: <3366081.1063439550@dbforums.com>
Thank you Brian for that Perl code. I have been using wvware to do my
conversions but have run across some files that cause it to hang. The
wvware pages on sourceforge are not helpful for figuring out how to use
it and the help forum there has 90% of its queries unanswered so I'm on
the verge of giving up on wvware and wv2.
However your Perl code yields results every bit as good as wvware does.
I just had to make two changes.
1. I got rid of $doc =~ s/\s+//sg;
You say it was fo rhtml formatting. I can't see the point of it as it
removes all the explicit spaces and in 99% of .docs that just joins up
all the words!
2. I changed $doc =~ s/\x0D//g;
to $doc =~ s/\x0D/x0A/g;
As a result I get beautifully clear text from .docs! It is
sufficiently formatted to make it easy to understand the text,
visually or by machine.
Thanks again, John
--
Posted via http://dbforums.com
------------------------------
Date: Sat, 13 Sep 2003 05:02:21 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Matching { } braces ???
Message-Id: <3F62A4D4.30607@rochester.rr.com>
Rodney wrote:
> Purl,
>
> I'm editing using conTEXT... It has a PERL syntax highlighter built in.
> When I paste the code I included ( as an example in the last post ) into
> conTEXT and highlight one of the braces... it is suppose to show me the
> matching brace by highlighting it too. This code is throwing it off.
>
> Also... this code is part of a larger code write. The problem started when
> I added the search for the { } braces. Now my error code tells me:
>
> "Missing right curly or square bracket at
> /u/web/XXXXXX/cgi-local/OPALconvert.pl line 485, at end of line
> syntax error at /u/web/XXXXXXXX/cgi-local/OPALconvert.pl line 485, at EOF
> /u/web/XXXXXXXX/cgi-local/OPALconvert.pl had compilation errors."
>
>
> Note: line 485 is the last line. This indicates to me that the problem is
> associated with the Braces.
...
Perl thinks your code as posted is fine (as regards compilation -- I
made no attempt to run it). Note that just because your editor's syntax
highlighting or brace searching screwed up doesn't necessarily mean
there is anything wrong with your code. There is a saying that "only
Perl can parse Perl".
Here is a simple piece of standalone code which illustrates the same
problem and also shows that Perl parses, compiles and executes it fine:
$_="{}";
if(/{/){
print "1match\n";
if(/}/){
print "2match\n";
}
}
If it is any consolation, VIM's color syntax highlighting highlights
correctly, but its brace-matching ability suffers the same problem your
editor has.
Regarding the problem with your larger piece of code, I suggest you look
in it rather than the piece you posted, as the problem is probably
somewhere in the other code. You can check brace matching by snipping
pieces out and running perl -c on them.
--
Bob Walton
------------------------------
Date: Sat, 13 Sep 2003 10:56:22 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Mod_perl & do()
Message-Id: <SZA8b.2557$2B6.601668@news.siol.net>
Hi!
I tryed to use do() function in mod_perl 1.27 but as I found out that
does not work. For example
test.pl:
#!/usr/bin/perl
my $test = 0;
do 'text.cf';
print "Content-type: text/html\n\n";
print $test;
test.cf:
$test = 1;
prints 0 and not 1. Files are in the same directory and there is '.' in
@INC.
scalar eval `cat test.cf` works but I really would not like to use this.
I use this for including configuration data.
Mike
------------------------------
Date: Sat, 13 Sep 2003 09:37:46 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Mod_perl & do()
Message-Id: <3f62e504.58288011@news.erols.com>
Mike Mimic <ppagee@yahoo.com> wrote:
: I tryed to use do() function in mod_perl 1.27 but as I found out that
: does not work. For example
:
: test.pl:
: #!/usr/bin/perl
: my $test = 0;
Declaring that $test with my() gives it file scope...
: do 'text.cf';
: print "Content-type: text/html\n\n";
: print $test;
:
: test.cf:
: $test = 1;
...so that $test is a completely different variable.
------------------------------
Date: Sat, 13 Sep 2003 11:57:31 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Re: Mod_perl & do()
Message-Id: <bTB8b.2563$2B6.601880@news.siol.net>
Hi!
> Declaring that $test with my() gives it file scope...
>
> : do 'text.cf';
> : print "Content-type: text/html\n\n";
> : print $test;
> :
> : test.cf:
> : $test = 1;
>
> ...so that $test is a completely different variable.
I think that it is not true.
do 'text.cf' should simply include code (like C++ include pragma) so
that the code of the program would be
#!/usr/bin/perl
my $test = 0;
$test = 1;
print "Content-type: text/html\n\n";
print $test;
I have changed the program slightly to show the problem (test.cf is not
loaded).
test.pl:
#!/usr/bin/perl
my $test = 0;
print "Content-type: text/html\n\n";
do 'text.cf';
print $test;
test.cf:
print "Loaded.\n";
$test = 1;
It prints only 0.
Mike
------------------------------
Date: Sat, 13 Sep 2003 10:02:33 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: Mod_perl & do()
Message-Id: <slrnbm5qpo.f1g.ak+usenet@vinland.freeshell.org>
In article <bTB8b.2563$2B6.601880@news.siol.net>, Mike Mimic wrote:
> Hi!
>
>> Declaring that $test with my() gives it file scope...
[cut]
> I think that it is not true.
[cut]
The manual for 'do' (perldoc -f do) says:
[...] code evaluated with "do FILENAME" cannot see lexicals
in the enclosing scope [...]
--
Andreas Kähäri
------------------------------
Date: Sat, 13 Sep 2003 10:09:37 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Mod_perl & do()
Message-Id: <3f62eb54.59903627@news.erols.com>
Mike Mimic <ppagee@yahoo.com> wrote:
: do 'text.cf' should simply include code (like C++ include pragma) so
: that the code of the program would be
:
: #!/usr/bin/perl
: my $test = 0;
: $test = 1;
: print "Content-type: text/html\n\n";
: print $test;
Actually, it would be like
#!/usr/bin/perl
my $test = 0;
$main::test = 1; # package variable, not lexical
print "Content-type: text/html\n\n";
print $test;
: I have changed the program slightly to show the problem (test.cf is not
: loaded).
:
: test.pl:
: #!/usr/bin/perl
: my $test = 0;
: print "Content-type: text/html\n\n";
: do 'text.cf';
^^^^^^^
^
: print $test;
:
: test.cf:
^^^^^^^
^
: print "Loaded.\n";
: $test = 1;
:
: It prints only 0.
It would help if the filenames were the same.
Including checks on whether the do() succeeds is always a good idea.
------------------------------
Date: Sat, 13 Sep 2003 12:37:18 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Re: Mod_perl & do()
Message-Id: <vsC8b.2566$2B6.601840@news.siol.net>
Hi!
Jay Tilton wrote:
> Actually, it would be like
>
> #!/usr/bin/perl
> my $test = 0;
> $main::test = 1; # package variable, not lexical
> print "Content-type: text/html\n\n";
> print $test;
Changing my $test to our $test does the trick.
> It would help if the filenames were the same.
> Including checks on whether the do() succeeds is always a good idea.
Ups. Thanks. It was only a test script but you are right.
Thanks, it works now.
Mike
------------------------------
Date: Sat, 13 Sep 2003 09:08:49 +0100
From: "Dave" <dave334234@inter.com>
Subject: Re: Perl DBMS
Message-Id: <mgA8b.1148$WI3.14388@newsfep4-glfd.server.ntli.net>
"Eric Bohlman" <ebohlman@earthlink.net> wrote in message
news:Xns93F4CDEB8C228ebohlmanomsdevcom@130.133.1.4...
> "Dave" <dave334234@inter.com> wrote in
> news:8as8b.1005$WI3.13044@newsfep4-glfd.server.ntli.net:
>
> > #!/usr/bin/perl
>
> Name the two things missing here...
I guess u mean -w ??
> > print "Content type:text/html\n\n";
> >
> > my $path = `pwd`;
> > chomp $path;
> >
> > opendir(DIR, $path) || print "Could not open $path";
> > @files = grep { /\.db$/ } readdir(DIR);
> > closedir(DIR);
>
> You know, don't you, that @files will contain *only* the base names of the
> matching files, *not* their full paths?
Yup
> > my $new_file ="";
> > my @databases;
> >
> > foreach $file (@files){
> >
> > @info = split(/\./, $file, 2);
> >
> >
> > if($info[0] ne $new_file){
> >
> > push(@databases, $info[0]);
> > }
> >
> > $new_file = $info[0];
> >
> >
> > }
>
> Why are you making separate passes over arrays, instead of doing this
> filtering as you read the filenames?
What other way can i do this?
> > foreach $file (@databases){
> >
> > print "$file\n\n";
> >
> > dbmopen(%hash, $file, 0666) || print "Could not open $file ($!)";
>
> Uh oh. Remember that bit about not having the full path names?
I know this is bad programming practice, but for now I'm running the script
in the same directory as the databases ( just till i get the thing
working). But that dosnt explain why I get the error below. If the path was
wrong then the dbm would create a new database with that name in the same
directory as the script (if the script WAS in a different dir), but instead
it says "Invalid Argument".
> > ## $! gives the error "Invalid Argument"
> >
> > foreach $key (keys %hash){
> >
> > print "$key : $hash{$key}\n";
> > }
> >
> > dbmclose(%hash);
> >
> > }
------------------------------
Date: Sat, 13 Sep 2003 10:24:57 +0100
From: "ge0rge" <ge0rge@Talk21.com>
Subject: Re: Perl DBMS
Message-Id: <bjunpf$nai8m$1@ID-175222.news.uni-berlin.de>
<OT>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
news:Pine.LNX.4.53.0309130126160.5502@lxplus002.cern.ch...
> On Fri, Sep 12, ge0rge inscribed on the eternal scroll:
>
> > Out of context? Perfectly clear to me. Here's another quote then - 'This
> > document is a description of the traditionally accepted "quoting style"
in
> > Usenet newsgroup postings. Please do not consider this to be a
"regulatory"
> > document ("Thou shalt do it this way because we say so!") ...'
>
> Indeed. The advice is to do it not because the FAQ or RFC says you
> must, but because the body of other serious participants expect it,
> and when they killfile you for ignoring the social mores of the group,
> you'll be lucky if one of them bothers to tell you about it.
Well, that would be a bit of an overkill. Don't you think so? Killfiling
someone because (s)he top post!
>
> > > > MS is the principal culprit IMO, not the newbees.
>
> There was (and may still be, for all that I know) an FAQ for
> microsoft.* groups which instructs participants to snip the quotage to
> the minimum needed for setting context, and place their responses
> after the relevant quoted parts. Does that sound familiar? For big-8
> usent groups, that is even more the expectation. As for other
> hierarchies, I recall an FAQ for alt.english.usage which explained to
> its participants that OE placed the cursor at the top of the quoted
> material because that was the natural place to start snipping
> irrelevant comments before placing one's responses below the relevant
> quoted parts to which one referred. Sounds familiar?
Can't understand why people (meaning us all, I guess) are so accommodating
with MS and are prepared to make excuses or go through all sort of
contortions to work with their software when clearly it is a stupid idea to
place the cursor at the top. At the very least, they could have put an
option to allow for the placement of the cursor.
>
> > BTW, you do realise this is a bit of a wind up.
>
> Oh yes.
>
> Did I mention that the best adjunct to participating in usenet is a
> well-tended killfile?
Whoaa! That's a bit below the belt. It was just a bit of harmless banter to
test the water in this NG.
BTW, I think the whole idea of a killfile is another OTT response to
something not worth a second thought... but then again there's no accounting
for what people feel passionate about.
Anyway, I shall do as suggested by another poster - when in Rome ... ('cos
top posters drive me nuts (well, rarely!)).
Now, time for me to shut up and start lurking awhile in this NG until I have
something worthwhile to ask or say!
</OT>
ge0rge
--
The more things change, the more they stay insane.
------------------------------
Date: Sat, 13 Sep 2003 06:41:02 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: regex help!
Message-Id: <lle5mvgf13133a618g0s3h560bpi1c535e@4ax.com>
Hello,
I am trying to extract email addresses from about 1000 htm files.
So far am trying
if ($line =~ /Mailto:(.*)"/ {
print OUT ("$1 \n");
where the line is
<a href="mailto:fred@aol.com"
problem is with the " after the email address and the "greedy" regex
characteristic which finds other " further along the line ...
can I stop at the first " mark?
Cheers
Geoff
------------------------------
Date: Sat, 13 Sep 2003 07:33:07 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: regex help!
Message-Id: <slrnbm5i1j.f1g.ak+usenet@vinland.freeshell.org>
In article <lle5mvgf13133a618g0s3h560bpi1c535e@4ax.com>, Geoff Cox wrote:
> Hello,
>
> I am trying to extract email addresses from about 1000 htm files.
E-mail address harvesting on your spare time, are you?
> if ($line =~ /Mailto:(.*)"/ {
> print OUT ("$1 \n");
[cut]
> problem is with the " after the email address and the "greedy" regex
> characteristic which finds other " further along the line ...
Read the perlre manual about changing the "greediness" of a
quantifier with "?".
--
Andreas Kähäri
------------------------------
Date: Sat, 13 Sep 2003 07:33:31 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: regex help!
Message-Id: <mbudash-F314ED.00333113092003@typhoon.sonic.net>
In article <lle5mvgf13133a618g0s3h560bpi1c535e@4ax.com>,
Geoff Cox <geoff.cox@blueyonder.co.uk> wrote:
> Hello,
>
> I am trying to extract email addresses from about 1000 htm files.
>
> So far am trying
>
> if ($line =~ /Mailto:(.*)"/ {
> print OUT ("$1 \n");
>
> where the line is
>
> <a href="mailto:fred@aol.com"
>
> problem is with the " after the email address and the "greedy" regex
> characteristic which finds other " further along the line ...
>
> can I stop at the first " mark?
/Mailto:(.*?)"/
you know that won't match your example don't you? unless you add the 'i'
flag (for 'i'gnore case):
/Mailto:(.*?)"/i
hth-
--
Michael Budash
------------------------------
Date: Sat, 13 Sep 2003 08:18:44 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: regex help!
Message-Id: <sfk5mvo202ccnl1b8tjv634fut1qvdo1nf@4ax.com>
On Sat, 13 Sep 2003 07:33:31 GMT, Michael Budash <mbudash@sonic.net>
wrote:
>/Mailto:(.*?)"/
>
>you know that won't match your example don't you? unless you add the 'i'
>flag (for 'i'gnore case):
Michael,
Thanks for the help - following code works now but I get the error
message "uninitialized value in string ne at ... the line with a **
below - do you knwo why?
Cheers
Geoff
use warnings;
use strict;
use File::Find;
open (OUT, ">>out");
my $dir = 'c:/atemp1/directory';
find ( sub {
open (IN, "$_");
my $line = <IN>;
** while ($line ne "") {
if ($line =~ /Mailto:(.*?)"/i) {
print OUT ("$1 \n");
}
$line = <IN>;
}
}, $dir);
close (OUT);
>
>/Mailto:(.*?)"/i
>
>hth-
------------------------------
Date: Sat, 13 Sep 2003 08:21:39 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: regex help!
Message-Id: <slrnbm5ksi.f1g.ak+usenet@vinland.freeshell.org>
In article <sfk5mvo202ccnl1b8tjv634fut1qvdo1nf@4ax.com>, Geoff Cox wrote:
[cut]
> Thanks for the help - following code works now but I get the error
> message "uninitialized value in string ne at ... the line with a **
> below - do you knwo why?
[cut]
> open (IN, "$_");
> my $line = <IN>;
> ** while ($line ne "") {
> if ($line =~ /Mailto:(.*?)"/i) {
> print OUT ("$1 \n");
[cut]
What happens at the end of a file? Well, <IN> will give you an
undefined value. This will also happen if the open() call failed.
--
Andreas Kähäri
------------------------------
Date: Sat, 13 Sep 2003 08:30:43 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: regex help!
Message-Id: <28l5mvovmurpbjk33goktp83ee2iv9e06f@4ax.com>
On Sat, 13 Sep 2003 08:21:39 +0000 (UTC), Andreas Kahari
<ak+usenet@freeshell.org> wrote:
>In article <sfk5mvo202ccnl1b8tjv634fut1qvdo1nf@4ax.com>, Geoff Cox wrote:
>[cut]
>> Thanks for the help - following code works now but I get the error
>> message "uninitialized value in string ne at ... the line with a **
>> below - do you knwo why?
>[cut]
>> open (IN, "$_");
>> my $line = <IN>;
>> ** while ($line ne "") {
>> if ($line =~ /Mailto:(.*?)"/i) {
>> print OUT ("$1 \n");
>[cut]
>
>
>What happens at the end of a file? Well, <IN> will give you an
>undefined value. This will also happen if the open() call failed.
Andreas,
ah! well the open call works so must be the end of file part - is
there a better way than using while ($line ne "" ) ? eof?
Geoff
------------------------------
Date: Sat, 13 Sep 2003 08:39:03 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: regex help!
Message-Id: <slrnbm5lt7.f1g.ak+usenet@vinland.freeshell.org>
In article <28l5mvovmurpbjk33goktp83ee2iv9e06f@4ax.com>, Geoff Cox wrote:
> On Sat, 13 Sep 2003 08:21:39 +0000 (UTC), Andreas Kahari
><ak+usenet@freeshell.org> wrote:
>>In article <sfk5mvo202ccnl1b8tjv634fut1qvdo1nf@4ax.com>, Geoff Cox wrote:
[cut]
>>> open (IN, "$_");
>>> my $line = <IN>;
>>> ** while ($line ne "") {
>>> if ($line =~ /Mailto:(.*?)"/i) {
>>> print OUT ("$1 \n");
>>[cut]
>>
>>
>>What happens at the end of a file? Well, <IN> will give you an
>>undefined value. This will also happen if the open() call failed.
>
> Andreas,
>
> ah! well the open call works so must be the end of file part - is
> there a better way than using while ($line ne "" ) ? eof?
Yes, a much much better way:
while(defined($line = <IN>)) {
... code ...
}
And personally I would say
open(IN, $_) or die "Failed in open(): $!";
Cheers,
Andreas
--
Andreas Kähäri
------------------------------
Date: Sat, 13 Sep 2003 08:48:31 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: regex help!
Message-Id: <vam5mvkg24sk0j6spkg1uuag4p6fjg0eg7@4ax.com>
On Sat, 13 Sep 2003 08:39:03 +0000 (UTC), Andreas Kahari
<ak+usenet@freeshell.org> wrote:
>Yes, a much much better way:
>
> while(defined($line = <IN>)) {
> ... code ...
> }
>
>And personally I would say
>
> open(IN, $_) or die "Failed in open(): $!";
will use both - thanks!
Geoff
>
>
>Cheers,
>Andreas
------------------------------
Date: Sat, 13 Sep 2003 11:44:25 GMT
From: Jonathan Gowland <jgowland@gena_NO_SPAM_PLEASE_ware.com>
Subject: Which Perl files (other than modules) are used by a script?
Message-Id: <tqD8b.99130$bo1.6200@news-server.bigpond.net.au>
I'm writing a software installer (in Perl, of course) which is
intended to run from a CD. Because it may be used on customer systems
where they don't have Perl installed (shame on them, I know, but they
pay the bills), I need to put enough of the Perl runtime environment
on the CD to allow the installer program to run. And because the
installer program is likely to be enhanced in future, with the use of
extra modules, I want to be able to generate the list of supporting
files (.pm files, shared libraries, etc.) automatically. Although I
can test (and have tested) things by temporarily renaming the
directory holding the system's Perl libraries, we support around six
different UNIX and Linux systems, so I'm after a method that can tell
me what needs to go onto the CD before I test it.
Using %INC, I can determine the list of module files nicely. To find
out which shared libraries are needed, I thought I could use
@DynaLoader::dl_modules, but on some platforms (e.g. Linux with Perl
5.6.1) this array is empty. (Any ideas?) So as a fallback, I look
under $Config{archlibexp} for any shared libraries whose name matches
a module in %INC. This seems to work for all platforms except one.
On Solaris 7 with Perl 5.005_03, when I run using the cut-down
environment, I get:
Can't locate auto/DynaLoader/dl_findfile.al in @INC (@INC contains
...
So is there a better way to determine which shared library and other
non-module files are needed by a script?
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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.
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 V10 Issue 5497
***************************************