[17553] in Perl-Users-Digest
Perl-Users Digest, Issue: 4973 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 27 14:05:51 2000
Date: Mon, 27 Nov 2000 11:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975351910-v9-i4973@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 27 Nov 2000 Volume: 9 Number: 4973
Today's topics:
Re: Accessing Microsoft SQL <dwilgaREMOVE@mtholyoke.edu>
Re: Can't install modules in ActiveStates v5.6.0 for Wi <jeff@vpservices.com>
Re: CGI & user 'nobody' problems <dwilgaREMOVE@mtholyoke.edu>
Re: Compiling Curses-1.05 Module <dickey@saltmine.radix.net>
Re: Cookieless operation <fchanny@lbl.gov>
Re: Newbie question concerning columns (David Wall)
Re: Newbie question concerning columns nobull@mail.com
Parsing DSP files with perl, part II <dross@iders.ca>
Re: Perl not executing from Cron job (Chris Fedde)
Re: Posting Guidelines? (Chris Fedde)
PPM Error <mesarch@ee.net>
Re: PPM Error (Garry Williams)
Re: PPM Error <Petri_member@newsguy.com>
Re: REGEXP Help! Trying to parse funky time format... (Chris Fedde)
Taint mode question <vrdoljak@uclink.berkeley.edu>
Re: Welcome to Tri-State Perl Jobs <numberwhun@hotmail.com>
Re: What if $SIG{__DIE__} is occupied by other module? nobull@mail.com
Re: What if $SIG{__DIE__} is occupied by other module? <iltzu@sci.invalid>
Re: Why wont the graphics show (Flint Slacker)
Re: Why wont the graphics show <dwilgaREMOVE@mtholyoke.edu>
Re: Why wont the graphics show nobull@mail.com
Re: Will most servers know/have access to DATE-CALC and <clarityassoc@earthlink.net>
Re: Will most servers know/have access to DATE-CALC and (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 27 Nov 2000 17:03:48 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: Accessing Microsoft SQL
Message-Id: <dwilgaREMOVE-DBDAA4.12034727112000@news.mtholyoke.edu>
In article <8vkci3$3tv$1@nnrp1.deja.com>, felrodian@my-deja.com wrote:
> What perl mod will work with Microsoft SQL? Due to its popularity, I
> know there must be tons. Does DBI work with it? We don't have the server
> set up yet to test, they(employers) want me to gather everything I need
> first ie perl modules.
>
We use DBI and DBD::ODBC, along with drivers from www.openlinksw.com.
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: Mon, 27 Nov 2000 08:08:39 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Can't install modules in ActiveStates v5.6.0 for Win32
Message-Id: <3A228707.C6FC3C1E@vpservices.com>
Helgi Briem wrote:
>
> Don't try to install the tar.gz packed modules
> under Activestate Perl unless you have a
> C/C++ compiler in your path and edit
> the Makefile to use that.
That is incomplete advice. The proper advice is 1) Use ppm for modules
that are available through ppm (.ppd or .zip); 2) Use nmake or some
other make or simple file copy for modules that are not available via
ppm but which do not have an XS (C/C++) component (which includes many
tar.gz files); and 3) for modules that are not accessible by ppm and
which do have an XS portion, then you either need to find a binary
compiled for your platform, or go the route of the compiler and Makefile
editing that Helgi mentioned.
If you leave out that middle group of files that have only a .tar.gz
file on CPAN and don't have a .ppd or .zip file, but also don't require
XS, then you miss out on many many fine modules (like most of Damian
Conway's stuff) that work perfectly fine on windoze without a C/C++
compiler.
--
Jeff
------------------------------
Date: Mon, 27 Nov 2000 17:02:13 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: CGI & user 'nobody' problems
Message-Id: <dwilgaREMOVE-4240D3.12021327112000@news.mtholyoke.edu>
Your question has nothing to do with Perl, and isn't likely to be answered
here. Try comp.infosystems.www.servers.unix .
In article <3A1E55B7.9EBDA5F4@tssg.wit.ie>, Paul Malone <pmalone@tssg.wit.ie>
wrote:
> I have not posted to this group before and am a relative newcomer to
> many security issues. I am hoping that some of you regular subscribers
> can give me a answer to my problem, which is outlined below...
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: 27 Nov 2000 17:41:04 GMT
From: Thomas Dickey <dickey@saltmine.radix.net>
Subject: Re: Compiling Curses-1.05 Module
Message-Id: <8vu6bg$gnn$1@news1.Radix.Net>
Eric Rountree <rountree@cs.queensu.ca> wrote:
> I made the following changes to my Makefile.PL (the file that creates
> the Makefile) in the Curses source directory:
> my $inc = "-I/usr/local/include/ncurses";
> my $libs = "-L/usr/local/include -lncurses -lmenu -lform";
my $libs = "-L/usr/local/include -lmenu -lform -lncurses";
> my $p_inc = "-I/usr/local/include/ncurses";
> my $p_libs = "-L/usr/local/include -lpanel";
> Now I get far fewer "function <xxx> not found" messages when I run
> make, but I still get these few, which appear to be crucial:
> function 'getsyx' NOT found
> function 'getsyx' returns void
> function 'setsyx' NOT found
> function 'setsyx' returns void
these are macros (not functions)
> ...
> function 'flusok' NOT found
this is misspelled (flushok, perhaps)
> function 'getcap' NOT found
> function 'touchoverlap' NOT found
these don't exist in ncurses...
(perhaps some flavor of BSD curses)
--
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com
------------------------------
Date: Mon, 27 Nov 2000 10:08:20 -0800
From: Frank Hanny <fchanny@lbl.gov>
To: Vipul Ved Prakash <vipul@shell2.ba.best.com>
Subject: Re: Cookieless operation
Message-Id: <3A22A314.E3C0F197@lbl.gov>
Vipul,
Yes, it works just fine.
I had to do a little fiddling when installing Digest::MD5, on which it
depends, as the distribution included two versions of MD5.pm, and the
working one was not at the directory level I would have expected.
(Perhaps the make process handles this?) I made no effort to implement
the C version of MD5. Digest::Perl::MD5 is fine for this purpose.
Potential users should pay close attention to the following warning in
the documentation:
"Important note: Attributes that are NOT explicitly delete()ed will lurk
about and come back to haunt you. Remember to clear control attributes
and other context dependent fields that need clearing."
Precisely because of the persistence, behavior is very different from
CGI.pm, and coding styles must adjust. For example, once a submit button
is pressed, it is pressed forever, unless exlicitly deleted.
It is also a bit less than obvious to me when to call the delete_all()
method, without which the persistent object lingers interminably. Some
sort of garbage collection for old persistence files might be a
desirable add on.
Nevertheless, quite a nice module.
Frank Hanny
Vipul Ved Prakash wrote:
>
> In article <3A12E377.AE89D6CF@lbl.gov>, Frank Hanny wrote:
> >Sounds promising. Does CGI::Persistent work in a Windows NT server
> >environment, as for example with MS IIS or is it strictly a Unix
> >critter? (Note, this is not a request for advice and comments as to the
> >superiority of Apache/Unix.)
> >
> >Thanks,
> >
> >Frank Hanny
>
> Dunno. Why don't you try it? And if it works, drop me a note.
>
> best,
> vipul.
>
> --
>
> Vipul Ved Prakash, http://www.vipul.net/
> PGP Fingerprint d5f78d9fc694a45a00ae086062498922
------------------------------
Date: 27 Nov 2000 11:50:04 -0500
From: darkon@one.net (David Wall)
Subject: Re: Newbie question concerning columns
Message-Id: <8FF97EFFBdarkononenet@206.112.192.118>
dcfor3@hotmail.com (dcfor3@hotmail.com) wrote in
<3A227866.CDC1DCC8@hotmail.com>:
>I have a file that contains a entries for a quiz. It takes everyone's
>answers and appends it to the end of the file. There are 18 questions
>that each participant answers. each week I have a different number of
>users who access the poll so the number of columns vary. I would pass
>that to the script on how many columns to make. The entries in the file
>are stored as such:
>
>abc <==== start of first entry for user a
>def
[... snip]
>fff
>ggg <===== start of second entry for user b
>hhh
[... snip]
>xxx
>etc <==== start of third entry for for user c
[... snip]
>Is there any way to get the data in to columns separated by a tab? I
>want to get the data into a file with columns (ie.):
>
>userA user B, User C, etc
>abc<tab>ggg
>def<tab>hhh
[... snip]
I think the easiest way would be to read the answers into an array of
arrays, like this:
#!/usr/bin/perl -w
use strict;
my @answers;
my $question = 0;
while (<DATA>) {
chomp;
push @{$answers[$question]}, $_;
if ( $. % 18 ) { $question++ } else { $question = 0 }
}
foreach $question (@answers) {
print join("\t", @$question), "\n";
}
--
David Wall
darkon@one.net
------------------------------
Date: 27 Nov 2000 17:51:11 +0000
From: nobull@mail.com
Subject: Re: Newbie question concerning columns
Message-Id: <u9vgt9paq0.fsf@wcl-l.bham.ac.uk>
"dcfor3@hotmail.com" <dcfor3@hotmail.com> writes:
> Subject: Newbie question concerning columns
Please put more thought into your subject lines. Save valuable space
by omitting words that carry no useful information "Newbie question
concerning". Use the space you save to add words that carry
infomation.
Subject: Wrapping text file into columns
> I have a file that contains a entries for a quiz. It takes everyone's
> answers and appends it to the end of the file. There are 18 questions
> that each participant answers.
> Is there any way to get the data in to columns separated by a tab?
TMTOWTDI:
my @rows = [] x 18;
until ( eof FILE ) {
push @$_ => scalar(<FILE>) for @rows;
}
for (@rows) {
chomp @$_;
print join("\t" => @$_),"\n";
}
> I would pass that to the script on how many columns to make.
I don't understand. I thought you said there were always 18 rows. If
so then the number if columns is implied by the number of lines in the
input file.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 27 Nov 2000 17:23:13 GMT
From: Derek Ross <dross@iders.ca>
Subject: Parsing DSP files with perl, part II
Message-Id: <3A2297EA.45BE@iders.ca>
Hello,
It's me again!
Last week I asked if it would be easy to extract variable names from
a DSP file. I was stunned and amazed that several people had
solutions within a few minutes. I figured it would take several hours
to do that thing.
That may have been a mistake on your part... now I'm back with even
more outlandish requests!
Well, that question was part of a larger project I'm (tentatively)
working on. What I'm trying to do is HTML-ize these DSP files we have
so that it is easier to follow what's going on with all the
functions.
Basically, I am trying to make all functions/variables/defines into
hyperlinks which point to the original definition of the said
function/variable/define. Feed .DSP file(s) to the parser,
and it creates a crosslinked .HTML file as an output.
Now, I'm not asking anybody to do this for me (although if you feel
motivated to do so, then don't let me stop you).
What would help is an overall "game plan" of how to approach this
problem.
There are some conflicting (in my mind) requirements here. For
example, comments can't be stripped out because they're needed
in the output file. And definitions of a var/func/define need
to be tagged with an <a name>, but references have to be tagged
with an <a href>.
Here's a brief list of the "rules"
- C style #defines are possible
- variable names are preceded by .global
- Function names are uppercase, flush to the left and followed
by a colon.
- An entire directory of about 20 DSP files will be processed
as a batch and
produce a single HTML file.
- C style comments can be anywhere.
- C style comments should be present in the output HTML file.
Like I said before, I'm not asking anyone to solve the whole thing
for me. Just some advice on the organization of the whole thing
would be nice.
Thanks,
Derek Ross.
(an example of an input file and the output generated, done by hand so
there might be a typo or two).
-----INPUT FILE------
#define INCREMENT(var) var=var+1
.global a_variable;
FUNCTION_A:
..stuff.
rts;
/* comments anywhere */
ANOTHER_FUNC:
...stuff...
rts;
MAINLINE:
call FUNCTION_A;
call ANOTHER_FUNC;
INCREMENT(a_variable);
jump MAINLINE;
rts;
--------OUTPUT FILE (html). <br> at end of every line----------
<a name="INCREMENT"></a>
#define INCREMENT(var) var=var+1<br>
<br>
<a name="a_variable"></a>
.global a_variable;<br>
<a name="FUNCTION_A"></a>
FUNCTION_A:
..stuff.
rts;
/* comments anywhere */
<a name="ANOTHER_FUNC"></a>
ANOTHER_FUNC:
...stuff...
rts;
<a name="MAINLINE"></a>
MAINLINE:
call <a href="#FUNCTION_A">FUNCTION_A</a>;
call <a href="#ANOTHER_FUNC">ANOTHER_FUNC</a>;
<a href="#INCREMENT">INCREMENT</a>(<a
href="#a_variable">a_variable</a>);
jump <a href="#MAINLINE">MAINLINE</a>;
rts;
------------------------------
Date: Mon, 27 Nov 2000 16:25:14 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Perl not executing from Cron job
Message-Id: <KVvU5.107$QX6.135467008@news.frii.net>
In article <3a220f90@grissom>,
Paul Mulloni <paul@NOSPAM.multibase.com.au> wrote:
>This is the cron job entry.
>
>SHELL="/usr/bin/perl"
>* * * * * /usr/local/ereport/burst.pl
>
>The crontab enrty is created under the user ereport. If the SHELL variable
>is missing the cron job produces an error.
>
Well I'm not a Redhat expert so I can't answer authoritatively.
But that behavior seems wrong. Cron should fork burst.pl and load
the program listed at the #! line. Obvious things to check are
permissions and ownership of the burst.pl file. Read the documentation
for the cron command. Maybe there is something odd there that
explains this behavior.
Another thing to try is to remove the SHELL variable and use a line that
invokes perl directly as follows.
* * * * * /usr/bin/perl /usr/local/ereport/burst.pl
Since this is not realy a perl problem you might want to try posting your
question to a news group that has linux, redhat, or cron somewhere in the
title.
good luck!
chris
--
This space intentionally left blank
------------------------------
Date: Mon, 27 Nov 2000 18:11:23 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Posting Guidelines?
Message-Id: <ftxU5.111$QX6.178749952@news.frii.net>
In article <8vfq93$1v4$1@nnrp1.deja.com>, <jbuff1856@my-deja.com> wrote:
>
>Several months ago, I polled the regular contributors at the newsgroup
>where I am most active (alt.dbs.echostar), and wrote
>http://www.echostaruser.org/openfaq/general/4.html .
>
For whatever reason the faq postings and such that used to appear
in this group have been somewhat abated of late. Tom Christiansen
used to post the FAQ on a regular basis and Nate Torkington used
to post a minifaq. Add to this the fact that news.newusers seems
to have fallen into near complete disuse. New posters just don't have
anywhere to go to find out what's acceptable. I think that your
intentions are great. Personally I'd like to see these things restored.
BTW I can't reach the URL that you listed above.
chris
--
This space intentionally left blank
------------------------------
Date: Mon, 27 Nov 2000 11:28:29 -0500
From: "Mike Mesarch" <mesarch@ee.net>
Subject: PPM Error
Message-Id: <8vu27p$krl$1@sshuraab-i-1.production.compuserve.com>
I just installed the latest perl version (ActivePerl-5.6.0.613.msi) and now
I get this error running ppm.
Any ideas?
-Mike
C:\>ppm
PPM interactive shell (2.0) - type 'help' for available commands.
PPM> search glob
not well-formed at line 1, column 1, byte 1 at
C:/Perl/site/lib/SOAP/Parser.pm line 73
------------------------------
Date: Mon, 27 Nov 2000 17:41:26 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: PPM Error
Message-Id: <a1xU5.1978$xb1.117919@eagle.america.net>
On Mon, 27 Nov 2000 11:28:29 -0500, Mike Mesarch <mesarch@ee.net> wrote:
>I just installed the latest perl version (ActivePerl-5.6.0.613.msi) and now
>I get this error running ppm.
>Any ideas?
>-Mike
>
>C:\>ppm
>PPM interactive shell (2.0) - type 'help' for available commands.
>PPM> search glob
>
>not well-formed at line 1, column 1, byte 1 at
>C:/Perl/site/lib/SOAP/Parser.pm line 73
Works for me:
d:/garry $ ppm
PPM interactive shell (2.1.1) - type 'help' for available commands.
PPM> search glob
PPM> exit
Quit!
d:/garry $ perl -v
This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2000, Larry Wall
Binary build 620 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 18:31:05 Oct 31 2000
...
--
Garry Williams
------------------------------
Date: 27 Nov 2000 09:18:49 -0800
From: Petri Oksanen <Petri_member@newsguy.com>
Subject: Re: PPM Error
Message-Id: <8vu51p016pl@edrn.newsguy.com>
In article <8vu27p$krl$1@sshuraab-i-1.production.compuserve.com>, "Mike says...
>I just installed the latest perl version (ActivePerl-5.6.0.613.msi) and now
>I get this error running ppm.
Build 620 is the latest version.
Get it from the source:
http://www.activestate.com/Products/ActivePerl/
The early 600 builds had quite a few bugs, so I would suggest you upgrade to the
latest version.
Petri Oksanen
------------------------------
Date: Mon, 27 Nov 2000 17:55:01 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: REGEXP Help! Trying to parse funky time format...
Message-Id: <VdxU5.110$QX6.173920256@news.frii.net>
In article <t1lsiaostpnga2@news.supernews.com>,
Liam Furniss <liam@nethelpnow.com> wrote:
>Hello Perlish Types,
>
>I have a some time data in the form XXd,XX:XX.XX (e.g. 5d,23:55.07), and I
>can't seem to craft a regexp the will extract just the numbers into
>variables that will be useful to me. Currently, I'm trying
>/(\d*d,)?(\d*:)?(\d*\.)?(\d*)?/, but it reports the minutes in $4 and $3 is
>empty...The other problem of course is making it work when the no day or
>hour data (e.g. 5.23)...Anyone feel kind enough to work their regexp mojo
>for me? This script could help save a struggling dot com! Hehe.
>
Here is my solution. Note that it takes a different approach than you've
been using.
#!/usr/bin/perl
use strict;
use warnings;
my @u = reverse (3600*24, 3600, 60, 1);
my $s;
while (<DATA>) {
my @c = reverse(split /[d,:]+/);
$s += $c[$_] * $u[$_] for (0..$#c);
print "$s\n";
}
__END__
34.66
55:23.5
23:56:12.2
3d,20:32:55.34
56d,23:59:55.99
--
This space intentionally left blank
------------------------------
Date: Mon, 27 Nov 2000 10:52:21 -0800
From: Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
Subject: Taint mode question
Message-Id: <3A22AD65.F5ED8EE8@uclink.berkeley.edu>
Hello,
I am writing a cgi script in perl that takes in information from a form on a web
page (name, date, time, etc) and then reads in a schedule from another file as a
hash. It checks for open times, and signs up people for using our microscope.
I have been told to run it in taint mode (-T option), but perl complains with
the following error:
Insecure dependency in glob while running with -T switch at
/home/httpd/cgi-bin/sched1.cgi line 71.
I tried reading the section on Taint mode and communicating with strangers in
the perl books from O'reilly, but I think I need more basic information. Can
someone give me some advice?
Here are some sections of the code where I pull in information from outside the
program (an html form, a text file for encrypted passwords, read in weekly
schedule file names, and a text file with the actual week's schedule). Do I
need to check each variable somehow, or is there a way of telling Perl that the
files are safe?
Thank you for any advice.
Gordon.
(line numbers are for reference).
9 $firstname = param("firstname");
10 $lastname = param("lastname");
11 $emailadd = param("emailadd");
12 $password = param("password");
13 $month = param("month");
14 $date = param("date");
15 $year = param("year");
16 $starttime = param("starttime");
17 $duration = param("duration");
21 open (PWD, 'pwd');
22 @lines = <PWD>;
23 close (PWD);
24 foreach $line (@lines) {
25 chop $line;
26 }
40 open IN, "format.txt" or die " Cannot open format.txt :$!\n";
41 my $match = 0;
42 while (<IN>)
43 {
44 my ($first, $last,$phone,$email,$address,$labphone,$super)
45 = split (/,/,$_);
46 if ($last =~ /$lastname/i)
47 {$match = 1;}
48 }
71 @schedfiles = <SCHED*>;
72
73 #now remove the SCHED header and split it up into day month year array
74 foreach $i (@schedfiles) {
75 $i =~ s/SCHED-//;
76 @tempdate = split(/-/, $i);
77 # convert the Month day - years into epoch seconds (I use 5 sec 5min 5
hours
78 # as arbitrary numbers so timelocal won't gripe
79 $i = timelocal(5, 5, 5, $tempdate[1], $tempdate[0]-1,
80 $tempdate[2]-1900);
81 }
132 open(SCHEDULE, "$file") || die "Could not create open scedule.";
133
134 while (my $line = <SCHEDULE>) { # line refers to each line from the
schedule
135 (my $time, my $user) = split(":", $line); # line is parsed by time
and user
136 $sched{$time} = $user;
137 }
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Gordon Ante Vrdoljak Electron Microscope Lab
ICQ 23243541 http://nature.berkeley.edu/~gvrdolja 26 Giannini Hall
vrdoljak@uclink.berkeley.edu UC Berkeley
phone (510) 642-2085 Berkeley CA 94720-3330
fax (510) 643-6207 cell (510) 290-6793
------------------------------
Date: Mon, 27 Nov 2000 12:08:01 -0600
From: Numberwhun <numberwhun@hotmail.com>
Subject: Re: Welcome to Tri-State Perl Jobs
Message-Id: <2l852ts76q5teung3i5pom6244ujfu6o95@4ax.com>
Please make all future job postings and the like to newsgroups
specifically geared toward such topics. You could even post to pages
like <http://www.pm.org/mailing_lists.shtml>. Just please keep our
technical discussion area free of this junk mail. It really is not
needed. Thank you!
Jeff
On Fri, 24 Nov 2000 12:23:18 -0500, triperljobs-owner@egroups.com
wrote:
--->
--->=> Looking for a Perl Programmer in the tri-state area?
--->=> Looking for a Perl Job in the tri-state area?
--->
--->=> A place where tri-state companies and recruiters can post
available
--->Perl Programming positions, both full time and contract.
--->
--->=> A place where tri-state Perl job seeking candidates can come to
find
--->available positions and post their resumes and/or portfolios.
--->
--->To subscribe to the list, send en email to:
--->triperljobs-subscribe@egroups.com
--->
--->After you subscribe, to post your job or resume, send to:
--->triperljobs@egroups.com
--->
--->http://www.egroups.com/group/triperljobs
------------------------------
Date: 27 Nov 2000 18:01:41 +0000
From: nobull@mail.com
Subject: Re: What if $SIG{__DIE__} is occupied by other module?
Message-Id: <u9wvdppat2.fsf@wcl-l.bham.ac.uk>
Bart Lateur <bart.lateur@skynet.be> writes:
> >eval{} is the proper (stackable) way to catch exceptions.
>
> No: eval() is the CAUSE of the problem.
No - mixing the two mechanisms of trapping __DIE__ exceptions is the
cause of the problem. If you had used only eval{} you'd not have a
problem.
> ... the stuff in the sub for $SIG{__DIE__} is *still executed*, even in
> an eval!
> eval() really should have localized (and cleared) $SIG{__DIE__}.
The "official" line (from "perldoc -f die") on the fact that eval
doesn't localize $SIG{__DIE__} is:
"Because this promotes action at a distance, this counterintuitive
behavior may be fixed in a future release."
> So: I am pretty sure there is code in that module, that uses eval() to
> do a test. Despite the eval(), it kills the program. The same problem
> occurs with the MIME::Lite module, which uses eval() to test if the
> module MIME::base64 is installed. If $SIG{__DIE__} is set and that
> module doesn't exist: bye bye, program.
So do not set $SIG{__DIE__}, use eval {} and all will be well.
Alteratively follow the advice given in "perldoc -f die":
Note that the $SIG{__DIE__} hook is currently called even inside
eval()ed blocks/strings! If one wants the hook to do nothing in such
situations, put
die @_ if $^S;
as the first line of the handler (see perlvar/$^S).
> IMO, that is a bug in eval(),
Bug is a strong word, I think "counterintuitive behavior" is better.
> and it ought to be fixed.
It is all well documented, as is the $^S work-round so I see no urgent
need to fix it even if the docs warn that one day it may be fixed.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 27 Nov 2000 18:41:00 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: What if $SIG{__DIE__} is occupied by other module?
Message-Id: <975349354.16281@itz.pp.sci.fi>
In article <u9wvdppat2.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:
>
>So do not set $SIG{__DIE__}, use eval {} and all will be well.
And if you're running under mod_perl? HTML::Mason?
>Alteratively follow the advice given in "perldoc -f die":
>
> Note that the $SIG{__DIE__} hook is currently called even inside
> eval()ed blocks/strings! If one wants the hook to do nothing in such
> situations, put
>
> die @_ if $^S;
>
> as the first line of the handler (see perlvar/$^S).
You know, that doesn't really fix the problem. What if you're already
inside an eval when you want to set the handler? A piece of code from
CGI::Carp might help illustrate the problem:
sub ineval { _longmess() =~ /eval [\{\']/m }
# The mod_perl package Apache::Registry loads CGI programs by calling
# eval. These evals don't count when looking at the stack backtrace.
sub _longmess {
my $message = Carp::longmess();
my $mod_perl = exists $ENV{MOD_PERL};
$message =~ s,eval[^\n]+Apache/Registry\.pm.*,,s if $mod_perl;
return $message;
}
sub die {
realdie @_ if ineval;
Needless to say, the hack only works in the specific case of mod_perl.
>> IMO, that is a bug in eval(),
>
>Bug is a strong word, I think "counterintuitive behavior" is better.
If it were only counterintuitive, I wouldn't mind that much. The
problem is that it's also a real pain to work around. Or, a bit more
specifically, the problem is that the burden of implementing (as well
as discovering the need for) the workaround is frequently _not_ on the
people that caused the need for it, but on some unsuspecting end-user.
In that sense, it reminds me a lot of the problem with AUTOLOAD in a
class unconditionally halting recursive method lookup. It _can_ be
worked around, but if multiple inheritance is involved, the workaround
must be done in the subclass rather than in the problem class itself.
I hear that one's going to be fixed, at least. Yes, I figure that
fixing eval to localise SIG{__DIE__} would break some existing code.
But given how many people in my experience have this problem without
really being aware of it, I'd say it would _fix_ more existing code
than it would break.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: Mon, 27 Nov 2000 16:23:50 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: Why wont the graphics show
Message-Id: <3a2789e7.224801124@news.tcn.net>
Try adding a basename:
print qq{<base href="http://somedomain.com">};
or maybe the full URL to the image
print qq{<img src="http://somedomain.com/pictures/millwall.jpg">};
Not sure if that will help, but its worth the time.
Flint
On Mon, 27 Nov 2000 15:58:41 +0000, Dave Clews
<Dave@inner-realm.co.uk> wrote:
>I have produced a perl script to return a thank you html document and
>send an email to the correct person, but none of the graphics are being
>seen. What is confusing me is the space is being allocated but the
>graphics cannot be found.
>
>I am developing this on solaris 2.6 with apache 1.3.7, the code to
>produce the graphics is below. I have left out all the other bits as
>they work.
>
>print"Content-type: text/html";
>print"\n\n";
>print"<img src='pictures/millwall.jpg' alt='Top of division'>
><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
>codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0'
>
>id=button width=155 height=80>
> <param name=movie value='swf/home_button.swf'>
> <param name=quality value=high>
> <param name=bgcolor value=#ffffff>
> <embed src='swf/home_button.swf' quality=high bgcolor=#ffffff
>width=155 height=80 type='application/x-shockwave-flash'
>pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>
>
> </embed>
> </object>\n";
>
>
------------------------------
Date: Mon, 27 Nov 2000 16:56:16 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: Why wont the graphics show
Message-Id: <dwilgaREMOVE-F988B9.11561627112000@news.mtholyoke.edu>
These questions are really not Perl-related, but here goes...
In article <3A2284B1.E8708113@inner-realm.co.uk>, Dave Clews
<Dave@inner-realm.co.uk> wrote:
> I have produced a perl script to return a thank you html document and
> send an email to the correct person, but none of the graphics are being
> seen. What is confusing me is the space is being allocated but the
> graphics cannot be found.
[...]
> print"<img src='pictures/millwall.jpg' alt='Top of division'>
If this is part of script that is in another location (like /cgi-bin) which
does not have a "pictures" directory, then this will not work. You need to use
an absolute URL in this case.
Another possibility is that if you actually have a "pictures" directory in the
same place as this script, and the script is in a ScriptAlias directory, then
Apache won't show you images, for reasons of security. You should put your
images outside cgi-bin or other ScriptAlias directories.
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: 27 Nov 2000 18:09:33 +0000
From: nobull@mail.com
Subject: Re: Why wont the graphics show
Message-Id: <u9u28tp9r6.fsf@wcl-l.bham.ac.uk>
Dave Clews <Dave@inner-realm.co.uk> writes:
> I have produced a perl script to return a thank you html document and
> send an email to the correct person, but none of the graphics are being
> seen.
Your question is about the HTML not about the Perl. Please only post
here if you have reason to suspect that your question may be Perl related.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 27 Nov 2000 17:02:18 GMT
From: "Alan Mailer" <clarityassoc@earthlink.net>
Subject: Re: Will most servers know/have access to DATE-CALC and DATE-MANIP?
Message-Id: <uswU5.11294$nh5.935887@newsread1.prod.itd.earthlink.net>
Thanks so much for responding, Tad. I looked up the information you
suggested in the Perl FAQ. Unfortunately, I've found once again that, much
like a lot of Perl literature, the Perl FAQ is not written with the Perl
newbie strongly in mind (at least not this one <grin>). The suggested code:
perl Makefile.PL PREFIX=/u/mydir/perl
...means next to nothing to me; in the sense that it gives me no idea how I
might take an existing module on my system (Date::Calc in my case) and make
it ready for upload to my webserver so that my online perl scripts can
either 'use' or 'require' it when they run. If you (or anyone reading this)
could take another moment to help me through this, I'd sure appreciate it.
And thanks again!
Tad McClellan <tadmc@metronet.com> wrote in message
news:slrn923q1g.cdd.tadmc@magna.metronet.com...
> Alan Mailer <clarityassoc@earthlink.net> wrote:
>
> >Please excuse the complete naivete of this question but: since I may be
> >deploying my perl scrips on a Unix based web server... am I able to
assume
> >that most servers know how to deal with my use of the Calc and Manip
> >modules?
>
>
> Doesn't matter.
>
> If they don't have it, you can install it (if you have shell access).
>
> Perl FAQ, part 8:
>
> "How do I keep my own module/library directory?"
>
>
> --
> Tad McClellan SGML consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
>
------------------------------
Date: Mon, 27 Nov 2000 11:56:26 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Will most servers know/have access to DATE-CALC and DATE-MANIP?
Message-Id: <slrn9254hq.ebf.tadmc@magna.metronet.com>
[ Please put your comments *following* the quoted text that you
are commenting on. A backwards time sequence is unnatural.
Please do not quote entire articles. Quote only enough to
establish the context for your comments.
Please never quote .signatures.
Please visit news.announce.newusers
Jeopardectomy performed.
]
Alan Mailer <clarityassoc@earthlink.net> wrote:
>
>Tad McClellan <tadmc@metronet.com> wrote in message
>news:slrn923q1g.cdd.tadmc@magna.metronet.com...
>> Alan Mailer <clarityassoc@earthlink.net> wrote:
>>
>> >am I able to
>assume
>> >that most servers know how to deal with my use of the Calc and Manip
>> >modules?
>>
>>
>> Doesn't matter.
>>
>> If they don't have it, you can install it (if you have shell access).
>>
>> Perl FAQ, part 8:
>>
>> "How do I keep my own module/library directory?"
>Thanks so much for responding, Tad. I looked up the information you
>suggested in the Perl FAQ. Unfortunately, I've found once again that, much
>like a lot of Perl literature, the Perl FAQ is not written with the Perl
>newbie strongly in mind (at least not this one <grin>). The suggested code:
>
>perl Makefile.PL PREFIX=/u/mydir/perl
>
>...means next to nothing to me;
Because you have skipped a step.
(errr, two steps actually. The very first step would be to see
if the webmaster will install the module for you :-)
You should first learn how to install Perl modules:
perldoc perlmodinstall
Then figure out what you need to do differently to install
somewhere besides the default places.
You normally just have 4 steps to install a Perl module
(with the "test" step optional, but don't skip it):
perl Makefile.PL
make
make test
make install
To install someplace of your own choosing, you need to modify
the first step as described in the FAQ answer.
>in the sense that it gives me no idea how I
>might take an existing module on my system (Date::Calc in my case) and make
^^^^^^^^^^^^^^^^^^^
>it ready for upload to my webserver so that my online perl scripts can
>either 'use' or 'require' it when they run. If you (or anyone reading this)
>could take another moment to help me through this, I'd sure appreciate it.
You do not take modules "on your system" nor "make them ready"
on your system.
You get the proper module distrubution from CPAN where it is
already ready to upload and install.
perldoc -q CPAN
Hope that helps!
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4973
**************************************