[24121] in Perl-Users-Digest
Perl-Users Digest, Issue: 6315 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 28 06:05:38 2004
Date: Sun, 28 Mar 2004 03:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 28 Mar 2004 Volume: 10 Number: 6315
Today's topics:
Re: Appreciation for the importance of readability (was (Michele Simionato)
Re: cgi & javascript <Joe.Smith@inwap.com>
Re: Choosing Perl/Python for my particular niche <ville@spammers.com>
Re: Combinatorics of dual-language use <fma@doe.carleton.ca>
Re: converting an evaluated expression to a literal <Joe.Smith@inwap.com>
Re: cpu use in threads <tassilo.parseval@rwth-aachen.de>
Re: Does anyone know what this switch does? <Joe.Smith@inwap.com>
Re: Empty hash key produces funky results <Joe.Smith@inwap.com>
Re: Filehandles Referenced with a Variable <Joe.Smith@inwap.com>
fork and wait... <svetjNO@SPAMtiscali.it>
Re: fork and wait... <svetjNO@SPAMtiscali.it>
Re: get multiple html files and convert to pdf <Joe.Smith@inwap.com>
Re: Help: Deleting Entries in Flat File Database <Joe.Smith@inwap.com>
Help: Using the Reply-To: header on sending email <dns@lavasys.com>
Re: Help: Using the Reply-To: header on sending email <noreply@gunnar.cc>
losing data on socket (Vorxion)
Re: New module: Array::Each (Anno Siegel)
Re: sendmail/cgi issue <Joe.Smith@inwap.com>
shared libraries compatibility (Ittay Dror)
Re: shared libraries compatibility <noreply@gunnar.cc>
Re: shared libraries compatibility <tassilo.parseval@rwth-aachen.de>
Windows Multimedia Macro (Jeff Mott)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Mar 2004 23:42:39 -0800
From: michele.simionato@poste.it (Michele Simionato)
Subject: Re: Appreciation for the importance of readability (was: Choosing Perl/Python for my particular niche)
Message-Id: <95aa1afa.0403272342.242bae89@posting.google.com>
claird@lairds.com (Cameron Laird) wrote in message news:<106ce9eaed1sk61@corp.supernews.com>...
> Some scientists are very successful with "slash-and-burn"
> techniques. That manifests itself in this area as "con-
> science-free" coding: they write whatever programs get
> them the results they're after, and don't care that no
> one else can reproduce their results, nor can they them-
> selves, six months later. A LOT of that goes on.
>
> It makes me uncomfortable. A lesson I've learned over
> and over is that computer programs live far longer than
> you expect. It pays to do 'em better at the beginning,
> 'cause you're likely to live with them quite a while.
>
> I'm not a successful scientist, though; odds are long
> against me ever being one.
>
The relation between programming and science is rather complex.
There are still lots of sciences where the programming part is
very minor and the "slash-and-burn" technique is the right thing
to do. For instance, I have worked with very successful scientists
using "slash-and-burn". Their requirements were the following:
1. we want to spend at most 5% of our time doing coding and 95% doing
science;
2. our group is composed by two persons and our code will never be
released;
3. if a Ph. D. student reach the group and has to study the code, we
will explain it to him in person;
4. the largest program we will ever write is a thousand lines long;
for the rest we will use standard routines and write as little code
as possible;
5. we don't care at all about fancy graphics: the output will be a list
of numbers write on a file and displayed by gnuplot;
6. all we care is numerical performance in floating point computations;
the logic of the program will be trivial.
They actually used old fashioned Fortran 77 and I think they made the perfect
choice given their requirements; they essentially had to do numerical
integrations and solving differential equations, tasks were Fortran is
incredibly strong. Other persons I know doing particle Physics and doing a
good deal of programming (good deal means something like 50% of their time
spent on programming; spending more than 50% means that you are actually
a programmer, and scientists don't want to do that) were using a mixture
of Fortran and C. Here I am referring to people doing numerically
intensive tasks; I have seen a trend to switch to C++ for large projects,
since there is a perception than C++ scales better than Fortran. In
any case, the core routines are still in Fortran and always will be.
For scripting tasks, scripting languages are used; I know a few
astronomers who were using Perl to control the telescope movement.
Many physicists/astronomers use Python too. Specialized languages
and tools (Mathematica, Maple, Matlab, Octave, Yorick, etc. etc.)
have their place.
Finally, it may be weird in XXI century, but there are still scientists
not doing programming. For instance, the only programming language I used
for my scientific research was Latex, to write the papers; my reseach tools
were paper and pencil and blackboard, which are still as effective as
ever.
Michele Simionato
------------------------------
Date: Sun, 28 Mar 2004 05:20:02 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: cgi & javascript
Message-Id: <6gt9c.19015$gA5.272461@attbi_s03>
Luca Ferrari wrote:
> Hi,
> I'm developing some cgis using perl to access a database. Often I put a
> button (submit) to delete one or more rows in a table, but I'd like to
> ask the user before doing it. To do so I thought about using javascript,
> and in particular javascript:confirm(..) as onClick property of the
> submit button. The problem is that the form is submitted even if the
> user says no.
Did your confirmation function remember to return the appropriate
value that tells the browser to abort the submit?
Go re-ask your question in a Javascript newsgroup.
-Joe
------------------------------
Date: 28 Mar 2004 12:34:01 +0300
From: Ville Vainio <ville@spammers.com>
Subject: Re: Choosing Perl/Python for my particular niche
Message-Id: <du73c7ts4c6.fsf@lehtori.cc.tut.fi>
>>>>> "Cameron" == Cameron Laird <claird@lairds.com> writes:
>> Since you happily use Perl, Python or Tcl, I have a
>> question. How do you decided which one to use? :-)
>>
>> Robert
Cameron> Most often, whatever is already at hand. It'll be
Cameron> interesting some day to come across an organization that
Cameron> doesn't already have a standard in place.
Many organizations don't, esp. if the actual product they produce is
not written in either of the languages. Some code may exist, but there
is no "official" standard. And if there is, there is a good
possibility of changing it if you are able to demonstrate clear
technical superiority in skunkworks projects. And w/ Python, you
are. Been there, done that :-).
--
Ville Vainio http://tinyurl.com/2prnb
------------------------------
Date: 28 Mar 2004 05:16:11 GMT
From: Fred Ma <fma@doe.carleton.ca>
Subject: Re: Combinatorics of dual-language use
Message-Id: <406660A6.D6A96DF9@doe.carleton.ca>
Paul Prescod wrote:
>
> Neither Pyrex nor Inline::C are going to be great for C++. They were
> both created by C programmers for C programmers (I'd like to see this
> change about Pyrex some day). BOOST::Python, on the other hand, is
> probably a good fit.
I just checked out Boost (visited there before based on a pointer
by Scott Meyers, author of a book on the STL). I wasn't quite
prepared to put the time into getting to know libraries at
that time, and I really needed to get to know basic standard
C++ library before delving into expansions of them, but the
example for the python interface looks very cool. My current
use of a "P..." type scripting language, though, wouldn't be to
replace my matlab wrapper around C++ (the main engine until I
graduate). It would be to mulch data to get it in a palatable
form for the engine code. It's good to know about the python
interface, though, for future investigation. Thanks.
Fred
------------------------------
Date: Sun, 28 Mar 2004 08:47:28 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: converting an evaluated expression to a literal
Message-Id: <Aiw9c.111464$1p.1551769@attbi_s54>
Ashkan wrote:
> Hi,
>
> I'm performing pattern substitution and I'm having some problems when
> my pattern contains the following structure: "[3]".
>
> Here is a snippet of my code:
>
> while ($count ne 0) {
> $file[$count] =~ s#$value[$val_count]#sub[$val_count]#g;
> $count--;
> }
> Is there any way for the $value[$val_count] to be evaluated, then the
> output be treated as a literal?
That's a bit ambiguous. Could be
$temp = $value[$val_count]; # Evaluate an array reference
s/\Q$temp\E/sub[$val_count]/g;
or
$temp = $value . "[$val_count]"; # Include literal [] in search string
s/\Q$temp\E/sub[$val_count]/g;
> my search patterns will be things such as 'abc[2]'.
If $value='abc' and $val_count='2', then the second one is what you want.
-Joe
--
I love my TiVo - http://www.inwap.com/u/joe/tivo/
------------------------------
Date: 28 Mar 2004 07:37:52 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: cpu use in threads
Message-Id: <c45vcg$4js$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Angshuman Guin:
> I am trying to use the capabilities of a multi(4) processor system to split
> a task by using threads. But when I run the program I see only one cpu being
> used although I have spawned 2 threads.
I am not an expert for Perl's threading capabilities. However, the POSIX
thread library it uses (where available) isn't quite yet ready for SMP
and wont distribute the threads over the processors (AFAIK).
For a real multi-processor system you should be using something else.
One standard for parallel programming is MPI. See for instance
<http://www-unix.mcs.anl.gov/mpi/>
for an introduction on MPI and MPICH which is a very reasonable free
implementation of it.
Naturally, MPI (Message Passing Interface) is very different from
threads. No data is shared between processors and must be passed around
explicitely. As it is used in the field of scientific computing, the
libraries you find for it are for C and FORTRAN. With Parallel::MPI and
Parallel::MPI::Simple there are two Perl modules available.
[...]
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Sun, 28 Mar 2004 08:38:22 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Does anyone know what this switch does?
Message-Id: <1aw9c.21936$K91.66988@attbi_s02>
Rob Vunderink wrote:
> http://www.opstartpagina.nl/cgi-bin/ipadres.cgi
> It works.
Check.
> Now check out this url:
> http://angel.regioportals.nl/gelderlander/cgi-bin/ipadres.cgi
Opening ipadres.cgi
The file "padres.cgi is of type application/x-httpd-php, and Mozilla does no
know how to handle this file type. This file is located at:
http://angel.regioportals.nl/gelderlander/cgi-bin/
What should Mozilla do with this file?
( ) Open it with the default application
( ) Open it with ___________________________ [Choose...]
(*) Save it to disk
> It does not work, although the scripts are the same in both cases:
>
> = - = - = - = - = - = - = - = -
> #!/usr/bin/perl
>
> http://angel.regioportals.nl/gelderlander/cgi-bin/ipadres2.cgi
>
> It works. The script is:
> #!/usr/bin/perl --
Clearly an end-of-line upload problem.
It fails because "/usr/bin/perl^M" does not exist (where ^M represents
the Classic Mac end-of-line and one half of the MS-DOS end-of-line).
Changing the shebang line to include a space and any switch ("-w", "-T")
works because the program loader stops at the space, and therefore
knows the right interpreter to load.
It appears that the web server at angel.regioportals.nl is configured
to not produce a "500 Server Error" when the shebang line is bad, and
outputs "Content-type: application/x-httpd-php" instead.
I'd say the server is misconfigured, in that it does not invoke the
php-handler in this case.
The fix is to tell your FTP client to use ASCII mode instead if IMAGE
(binary) mode when uploading your scripts.
-Joe
------------------------------
Date: Sun, 28 Mar 2004 07:46:19 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Empty hash key produces funky results
Message-Id: <fpv9c.110951$1p.1551495@attbi_s54>
Aaron DeLoach wrote:
> I was assigning parameter values to a hash like so:
> 1=>param('one'), 2=>param('two') ... and so on.
>
> The problem arised when a parameter didn't exist - or - it had no value (see
> the post below).
> The solution:
> 1=>param('one')||"", 2=>param('two')||"" ... and so on.
You realize, of course, that will mess up any parameter with a value
of zero. Don't be surprised when your script transforms "0" to "".
-Joe
------------------------------
Date: Sun, 28 Mar 2004 10:06:19 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Filehandles Referenced with a Variable
Message-Id: <vsx9c.22532$K91.66915@attbi_s02>
Mike Flannigan wrote:
>>for my $st (@states)
>>{
>> open(my $fh, ">", "$st.txt") or die "Cannot open $st.txt: $!";
>> $type{$st} = $fh;
>>}
>>
>>As others pointed out, %type is not a good name.
>
> Obviously I'm must incapable of figuring out what you guys
> are saying. It did not work for me at all, and I'm kinda
> glad it didn't, cause it makes more sense to me if it doesn't
> work. I'm not using a hash here,
But you should be.
our %handles; # Open file handles, indexed by state
foreach (@states) {
my $fh; # Start with a scalar variable whose value is undef
open $fh, '>', "$_.txt" or die "Cannot open $_.txt - $!\n";
$handles{$_} = $fh; # open() magically makes $fh into a filehandle!
}
Notice the third paragraph in "perldoc -f open" where it says
If FILEHANDLE is an undefined scalar variable (or array or hash
element) the variable is assigned a reference to a new anony-
mous filehandle ...
so the open() could be written as
open $handles{$_}, '>', "$_.txt" or die;
Note that this uses a freshly created anonymous handle that is stored
in a hash indexed by state name, as Uri said over and over.
The print() section can be written as
my $fh = $handles{$st};
print $fh $line;
or
print {$handles{$st}} $line;
-Joe
P.S. The autovivification of file handles for undef values was added
during the development of perl version 5.6, back in 1999.
------------------------------
Date: Sun, 28 Mar 2004 08:40:54 GMT
From: "svetj" <svetjNO@SPAMtiscali.it>
Subject: fork and wait...
Message-Id: <qcw9c.140965$O31.5983134@news4.tin.it>
Hi,
I wrote a perl script that do one query to many db at the same time.
this is the code with fork (from "Programming Perl"):
my @countries=('IT'
,'BE'
,'ES'
,'NL'
,'NO)
foreach my $ct (@countries) {
FORK: {
if ($pid = fork){
#codice processo padre
print "$ct - $pid\n";
#waitpid($pid,80);
} elsif (defined $pid) {#qui $pid è zero se è definito
&report ($ct);
print "\n sono $ct figlio!!!\n";
} elsif ($! =~ /No more process/) {
#errore recuperabile
sleep 5;
redo FORK;
} else {
#strano errore di fork
die "$ct - Nn riesco a fare il fork: $!\n";
}
}
}
So, if I uncomment "waitpid($pid,80);" parten process wait for the end of a
child,
and if child don't stops, can't start next child..
But i want to start all childs at the same time,
and after the parent process must wait end of all childs for 80 seconds (for
example).
So where I must write waitpid?
Exuse for my poor english.
Thanks a lot ;-)
------------------------------
Date: Sun, 28 Mar 2004 09:24:15 GMT
From: "svetj" <svetjNO@SPAMtiscali.it>
Subject: Re: fork and wait...
Message-Id: <3Rw9c.141145$O31.5988205@news4.tin.it>
"svetj" <svetjNO@SPAMtiscali.it> ha scritto nel messaggio
news:qcw9c.140965$O31.5983134@news4.tin.it...
> Hi,
> I wrote a perl script that do one query to many db at the same time.
> this is the code with fork (from "Programming Perl"):
> my @countries=('IT'
> ,'BE'
> ,'ES'
> ,'NL'
> ,'NO)
>
> foreach my $ct (@countries) {
>
> FORK: {
> if ($pid = fork){
> #codice processo padre
> print "$ct - $pid\n";
> #waitpid($pid,80);
>
> } elsif (defined $pid) {#qui $pid è zero se è definito
> &report ($ct);
> print "\n sono $ct figlio!!!\n";
> } elsif ($! =~ /No more process/) {
> #errore recuperabile
> sleep 5;
> redo FORK;
> } else {
> #strano errore di fork
> die "$ct - Nn riesco a fare il fork: $!\n";
> }
> }
> }
>
> So, if I uncomment "waitpid($pid,80);" parten process wait for the end of
a
> child,
> and if child don't stops, can't start next child..
> But i want to start all childs at the same time,
> and after the parent process must wait end of all childs for 80 seconds
(for
> example).
> So where I must write waitpid?
Excuse me: all thoes things are to avoid zombie childs..
bye ;-)
------------------------------
Date: Sun, 28 Mar 2004 09:06:10 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: get multiple html files and convert to pdf
Message-Id: <6Aw9c.19987$gA5.278837@attbi_s03>
AB wrote:
>>> 1. Download all files in a given web server directory
No need for you to re-invent the wheel here.
There are oodles of web mirroring programs out there, find one
and use it. (Web mirroring programs will parse the first URL,
locate embedded URLs, download the ones on the same server as
the original, and repeat until no more unresolved URLs).
>>> 2. convert html into pdf
>> http://www.google.com/search?q=html2pdf
Yes, step two is completely distinct from step one.
Be sure to conquer the first step (which does not necessarily
require a perl solution) before contemplating the second.
-Joe
------------------------------
Date: Sun, 28 Mar 2004 08:55:56 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Help: Deleting Entries in Flat File Database
Message-Id: <wqw9c.111552$1p.1551985@attbi_s54>
TP wrote:
> Hi all, i am a newbie in Perl and have been playing around with FFD,
> and i have succefully scripts for add, read and search for my database. I
> have some problem writing the scripts for deleting entries from my database.
...
> #check for match
> foreach $line (@array){
> if($line=~ /$del1/){
> $continue++;
> }
... convoluted code snipped ...
@newarray = grep !/$del1/, @array;
exit if $#newarray == $#array; # Nothing to do if no changes
> # Rewrite the file
> open(DB,">>$dbpath");
> while(($key,$value)=each(%movies)){
> print DB"$value\n";
Rewrite is ">" not ">>".
-Joe
------------------------------
Date: 28 Mar 2004 07:19:39 GMT
From: Rethaew <dns@lavasys.com>
Subject: Help: Using the Reply-To: header on sending email
Message-Id: <Xns94B9ED3FF8449email@66.250.146.154>
I am using perl to send out email messages. I am trying to use the "Reply-
To:" email header on the message, but it is not coming through on the
received message. I am running active perl 5.6 on Windows2k.
Here is a summary of the code I am trying to use. It looks like
Mail:Sendmail doesn't support the Reply-To: field. Any suggestions are
welcome.
use Mail::Sendmail;
%mail = (
To => "$recipient",
From => "$sender",
X-Reply-To => "$reply_to",
Subject => "$subject",
Message => "This is the message."
);
sendmail(%mail);
................................................................
Posted via TITANnews - Uncensored Newsgroups Access
>>>> at http://www.TitanNews.com <<<<
-=Every Newsgroup - Anonymous, UNCENSORED, BROADBAND Downloads=-
------------------------------
Date: Sun, 28 Mar 2004 09:27:22 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Help: Using the Reply-To: header on sending email
Message-Id: <c45uoj$2e5jr7$1@ID-184292.news.uni-berlin.de>
Rethaew wrote:
> I am using perl to send out email messages. I am trying to use the
> "Reply- To:" email header on the message, but it is not coming
> through on the received message. I am running active perl 5.6 on
> Windows2k.
>
> Here is a summary of the code I am trying to use. It looks like
> Mail:Sendmail doesn't support the Reply-To: field. Any suggestions
> are welcome.
>
> use Mail::Sendmail;
> %mail = (
> To => "$recipient",
> From => "$sender",
> X-Reply-To => "$reply_to",
X-Reply-To is not the same as Reply-To. Try saying:
Reply-To => "$reply_to",
instead.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 28 Mar 2004 05:05:23 -0500
From: vorxion@knockingshopofthemind.com (Vorxion)
Subject: losing data on socket
Message-Id: <4066a363$1_1@news.iglou.com>
I'm losing data on incoming sockets on a server written in perl.
I'm using IO::Socket, and I'm setting $server->autoflush(0) and
$server->blocking(0) as well as trying both $server->setbuf($main_buffer)
or $server->setvbuf($main_buffer,_IOFBF,102400000). I'm using IO::Select
to tell when I'm ready for reading on individual connections. $main_buffer
is a pure global in the main:: namspace.
Most telling, the length of $main_buffer never changes from 0. I have no
idea why. It acts like it's not being used.
I've read the docs, I've been beating myself over the head with this code
for a week. Someone have mercy on me and tell me how to keep from losing
the input? Please? I'm desperate at this point.
Same behaviour on perl 5.6.1 Solaris and 5.8.3 Linux. 5.8.0 on Solaris
actually silently dies when it hits the set[v]buf() command. :-/
Help? Please?
--
Vorxion - Member of The Vortexa Elite
------------------------------
Date: 28 Mar 2004 08:24:56 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: New module: Array::Each
Message-Id: <c4624o$psh$1@mamenchi.zrz.TU-Berlin.DE>
Brad Baxter <bmb@ginger.libs.uga.edu> wrote in comp.lang.perl.misc:
> I've uploaded version 0.02 of Array::Each to CPAN,
> http://www.cpan.org/authors/id/B/BB/BBAXTER/
>
> It's also available from my web site, where you can read a bit more of the
> docs without unpacking anything,
> http://www.vitabrevis.com/perl/modules/Array-Each
>
> This is my first CPAN contribution, and it has been a bit of a
Congrats :)
[...]
> And this code returns groups of elements from each array, and it returns
> the value in $undef if we've gone past the end of any array:
>
> my @ret;
> foreach my $aref ( @$set ) {
> push @ret, map {$_<@$aref ? $aref->[$_] : $undef}
^
What is that "$"? Not the result of a copy/paste operation for sure :)
> ($i..$i+$group-1) }
> return ( @ret, $c );
>
> I'd like to think this could be done with two maps in succession, but
> inspiration just hasn't come.
The inner map can be written as a slice: @$aref[ $i .. $i + $group - 1]"
That will give you undef beyond the array limits. Since $_ is no longer
used in the inner expression, now the outer loop can become a map:
my @ret = map @$_[ $i .. $i + $group - 1], @$set;
return ( @ret, $c);
Anno
------------------------------
Date: Sun, 28 Mar 2004 09:19:53 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: sendmail/cgi issue
Message-Id: <ZMw9c.22213$K91.67014@attbi_s02>
Joe Cipale wrote:
> I have a file that is generated via CGI. Once the user is happy with the
> file, I want to send the file to a dedicated email address. The problem
> is this. Once the user decides to process the file and send it off to
> the email address, the file inforamtion IS NOT included in the body of
> the email that is delivered.
That's exactly what will happen if the open() fails (which you do not
check for).
> open(FILE, "$read_path/$dte");
Make that
my $open_failure = "";
open FILE, "$read_path/$dte" or ($open_failure = "Unable to read file
$read_path/$dte - $!\n";
Then change
> print SM @email_body;
to
print SM $open_failure,@email_body;
so that the error message will be sent on failure.
-Joe
------------------------------
Date: 27 Mar 2004 21:48:51 -0800
From: notreal@mailinator.com (Ittay Dror)
Subject: shared libraries compatibility
Message-Id: <10ac1b34.0403272148.6c58627@posting.google.com>
Hi,
I want to write a perl script which will run on diverse client
machines. I don't want to force the clients to install any perl
modules, so I want to package them with my script.
So I put the external modules under my app tree and add this path to
@INC when the script starts.
However, I have problems with shared libraries that come with some
modules (specifically HTML::Parser). Sometimes the runtime environment
is not the same as the compile time and I get undefined symbols
(PL_sv_undef in HTML::Parser for Parser.so). Any suggestions as to how
to resolve this issue?
Thanx,
Ittay
------------------------------
Date: Sun, 28 Mar 2004 09:22:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: shared libraries compatibility
Message-Id: <c45ufa$2dl492$1@ID-184292.news.uni-berlin.de>
Ittay Dror wrote:
> I want to write a perl script which will run on diverse client
> machines. I don't want to force the clients to install any perl
> modules, so I want to package them with my script.
>
> So I put the external modules under my app tree and add this path
> to @INC when the script starts.
What do you mean by "external" modules? I think you should distinguish
between standard and non-standard modules, and require that the former
are already installed (which they are in every decent Perl installation).
Since the purpose seems to be to make it easy to install your app,
you'd better not include in your package other modules but plain Perl
modules, i.e. modules that don't need to be compiled.
> However, I have problems with shared libraries that come with some
> modules (specifically HTML::Parser). Sometimes the runtime
> environment is not the same as the compile time and I get undefined
> symbols (PL_sv_undef in HTML::Parser for Parser.so). Any
> suggestions as to how to resolve this issue?
HTML::Parser is both a standard module, and a module that requires
compilation. You should simply not let it be included in your package.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 28 Mar 2004 07:44:11 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: shared libraries compatibility
Message-Id: <c45vob$4nn$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Gunnar Hjalmarsson:
> Ittay Dror wrote:
>> I want to write a perl script which will run on diverse client
>> machines. I don't want to force the clients to install any perl
>> modules, so I want to package them with my script.
>>
>> So I put the external modules under my app tree and add this path
>> to @INC when the script starts.
>
> What do you mean by "external" modules? I think you should distinguish
> between standard and non-standard modules, and require that the former
> are already installed (which they are in every decent Perl installation).
>
> Since the purpose seems to be to make it easy to install your app,
> you'd better not include in your package other modules but plain Perl
> modules, i.e. modules that don't need to be compiled.
>
>> However, I have problems with shared libraries that come with some
>> modules (specifically HTML::Parser). Sometimes the runtime
>> environment is not the same as the compile time and I get undefined
>> symbols (PL_sv_undef in HTML::Parser for Parser.so). Any
>> suggestions as to how to resolve this issue?
>
> HTML::Parser is both a standard module, and a module that requires
> compilation. You should simply not let it be included in your package.
HTML::Parser is not a standard module. The fact that it is written in C
will indeed make distributing the script very difficult if he intends to
include all prerequisite modules. It's therefore easier to have the end
user install it on its own. Maybe providing some detailed explanations
on how to do that on the various platforms is better.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: 27 Mar 2004 21:40:12 -0800
From: mjeff1@twcny.rr.com (Jeff Mott)
Subject: Windows Multimedia Macro
Message-Id: <970676ed.0403272140.6096d79b@posting.google.com>
I'm trying to configure and then save the state of a codec with Perl.
I've been looking around, finding bits and pieces, but don't know how
to put it all together.
I believe the macros I need to make use of are ICConfigure
<http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_icconfigure.asp>
and ICGetState <http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_icgetstate.asp>,
and I'll probably have to use Win32::API or some similar module to get
at these. But beyond this I'm not sure how to make this work.
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6315
***************************************