[22444] in Perl-Users-Digest
Perl-Users Digest, Issue: 4665 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 5 06:06:29 2003
Date: Wed, 5 Mar 2003 03:05:06 -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 Wed, 5 Mar 2003 Volume: 10 Number: 4665
Today's topics:
Re: [REPOST] Using a (config) file relative to a module <bik.mido@tiscalinet.it>
CGI.pm <bsd_devil@web.de>
dbm <jvandervloet@hotmail.com>
Errors to browser?? (maybe)
Re: Errors to browser?? <ubl@schaffhausen.de>
Re: Errors to browser?? (maybe)
Re: Errors to browser?? <ubl@schaffhausen.de>
Re: Errors to browser?? (maybe)
Re: exported constants, Win32::File <kalinabears@hdc.com.au>
fixing "times" in a file <chrisl_ak@hotmail.com>
Re: fixing "times" in a file <krahnj@acm.org>
Re: Greedy regexps <somewhere@nowhere.com>
Re: How to access proxy server for Perl Soap client (Sade Bhat Kalasabail)
Re: insert meta tags into an existing html file <pdhze@yahoo.co>
Re: insert meta tags into an existing html file <pdhze@yahoo.co>
Re: Shell commands <jurgenex@hotmail.com>
using system to run a program and redirect its output <shukwong@yahoo.com>
Re: using system to run a program and redirect its outp (Anno Siegel)
Re: using system to run a program and redirect its outp <josef.moellers@fujitsu-siemens.com>
Re: XML to HTML <jurgenex@hotmail.com>
Re: XS code to call DLL <kalinabears@hdc.com.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 05 Mar 2003 09:08:18 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: [REPOST] Using a (config) file relative to a module location...
Message-Id: <12cb6vg04sgdmvvqp3ep3eqr68g5nseovv@4ax.com>
On Tue, 04 Mar 2003 23:10:10 GMT, tiltonj@erols.com (Jay Tilton)
wrote:
>Michele Dondi <bik.mido@tiscalinet.it> wrote:
>
>: OTOH the interpreter does
>: know where a module is: it wouldn't do much harm IMHO to also set an
>: $INC variable (local to a module), just as $ARGV is set when
>: "processing" @ARGV...
>
>I don't know how I missed this before, but the __FILE__ token is
>exactly what you want the $INC variable to be.
Thank you for the precious information (and now I'll look for
additional info in the docs)
Michele
--
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel on sci.math, thread "Why numbers?"
------------------------------
Date: Wed, 5 Mar 2003 08:42:13 +0200
From: "BSD" <bsd_devil@web.de>
Subject: CGI.pm
Message-Id: <b445se$1r5qop$1@ID-172702.news.dfncis.de>
I have the same problem
perl -wce 'use CGI::Carp qw(warningsToBrowser fatalsToBrowser);'
"warningsToBrowser" is not exported by the CGI::Carp module at -e line 1
Content-type: text/html
<H1>Software error:</H1>
<CODE>Can't continue after import errors at -e line 1
BEGIN failed--compilation aborted at -e line 1.
</CODE>
<P>
For help, please send mail to this site's webmaster, giving this error
message
and the time and date of the error.
[..] -e: Can't continue after import errors at -e line 1
[..] -e: BEGIN failed--compilation aborted at -e line 1.
Given:
FreeBSD 4.4 stable
perl, version 5.005_03 built for i386-freebsd
perl -MCGI -le 'print $CGI::VERSION' 2.46
from the ports installed CGI.pm + modules
p5-CGI-modules-2.76 Modules for perl5, for use in writing CGI scripts
p5-CGI.pm-2.89,1 CGI.pm - Simple Common Gateway Interface Class
As you see, the perl request version for CGI showing a different value.
How can I update my CGI.pm?
Can I do the following
perl -MCPAN -e 'install Bundle::CPAN'
BSD
------------------------------
Date: Wed, 05 Mar 2003 08:33:07 GMT
From: "joeri" <jvandervloet@hotmail.com>
Subject: dbm
Message-Id: <7Di9a.3410$Py.87@afrodite.telenet-ops.be>
Hi,
I'm trying to build a database using dbmopen. Here a little test script I
wrote:
$var="C0480780|analgesic exposure highway intent nonopioid occurrence
poisoning street undetermined x
C0480780|analgesic exposure highway intent nonopioid occurrence poisoning
street undetermined
C0480209|analgesic exposure highway intentional nonopioid occurrence poison
self street x
C0480209|analgesic exposure highway intentional nonopioid occurrence poison
self street
C0480209|analgesic exposure highway intentional nonopioid occurrence
poisoning self street x
C0480209|analgesic exposure highway intentional nonopioid occurrence
poisoning self street
C0480777|analgesic exposure institution intent nonopioid occurrence poison
residential undetermined x
C0480777|analgesic exposure institution intent nonopioid occurrence poison
residential undetermined
C0480777|analgesic exposure institution intent nonopioid occurrence
poisoning residential undetermined x
C0480777|analgesic exposure institution intent nonopioid occurrence
poisoning residential undetermined
C0480206|analgesic exposure institution intentional nonopioid occurrence
poison residential self x
C0480206|analgesic exposure institution intentional nonopioid occurrence
poison residential self
C0480206|analgesic exposure institution intentional nonopioid occurrence
poisoning residential self x
C0480206|analgesic exposure institution intentional nonopioid occurrence
poisoning residential self";
dbmopen(%CID,"c:/program files/perl builder2/testnew",0666) or die "$!";
for(split(/\n/,$var)){
my ($c,$s)=split(/\|/,$_);
chomp $s;
push(@{$CID{$s}},$c);
}
dbmclose %CID;
When I try to access the db, I do the following:
dbmopen(%CID,"c:/program files/perl builder2/testnew",0666) or die "$!";
foreach $string (keys %CID){
print "$string => @{$CID{$string}}\n";
}
This gets me the following output:
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined x =>
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined =>
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined x =>
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined =>
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined x =>
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined =>
analgesic exposure highway intentional nonopioid occurrence poison self
street x =>
analgesic exposure highway intentional nonopioid occurrence poison self
street =>
analgesic exposure highway intentional nonopioid occurrence poisoning self
street x =>
analgesic exposure highway intentional nonopioid occurrence poisoning self
street =>
analgesic exposure institution intentional nonopioid occurrence poison
residential self x =>
analgesic exposure institution intentional nonopioid occurrence poison
residential self =>
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self x =>
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self =>
This is of course not what I want :-)
So I think that sth must have gone wrong in building the db hash, but if I
try the following:
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined x => ARRAY(0x1bc7e70)
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined => ARRAY(0x1bf80a4)
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined x => ARRAY(0x1bf8080)
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined => ARRAY(0x1bbb748)
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined x => ARRAY(0x1bc7e70)
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined => ARRAY(0x1bf80a4)
analgesic exposure highway intentional nonopioid occurrence poison self
street x => ARRAY(0x1bf8080)
analgesic exposure highway intentional nonopioid occurrence poison self
street => ARRAY(0x1bbb748)
analgesic exposure highway intentional nonopioid occurrence poisoning self
street x => ARRAY(0x1bc7e70)
analgesic exposure highway intentional nonopioid occurrence poisoning self
street => ARRAY(0x1bf80a4)
analgesic exposure institution intentional nonopioid occurrence poison
residential self x => ARRAY(0x1bf8080)
analgesic exposure institution intentional nonopioid occurrence poison
residential self => ARRAY(0x1bbb748)
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self x => ARRAY(0x1bc7e70)
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self => ARRAY(0x1bf80a4)
So there is an array as the value for each key in my db hash, but apparently
it is empty. So I thought.
But if I do the following:
$var="C0480780|analgesic exposure highway intent nonopioid occurrence
poisoning street undetermined x
C0480780|analgesic exposure highway intent nonopioid occurrence poisoning
street undetermined
C0480209|analgesic exposure highway intentional nonopioid occurrence poison
self street x
C0480209|analgesic exposure highway intentional nonopioid occurrence poison
self street
C0480209|analgesic exposure highway intentional nonopioid occurrence
poisoning self street x
C0480209|analgesic exposure highway intentional nonopioid occurrence
poisoning self street
C0480777|analgesic exposure institution intent nonopioid occurrence poison
residential undetermined x
C0480777|analgesic exposure institution intent nonopioid occurrence poison
residential undetermined
C0480777|analgesic exposure institution intent nonopioid occurrence
poisoning residential undetermined x
C0480777|analgesic exposure institution intent nonopioid occurrence
poisoning residential undetermined
C0480206|analgesic exposure institution intentional nonopioid occurrence
poison residential self x
C0480206|analgesic exposure institution intentional nonopioid occurrence
poison residential self
C0480206|analgesic exposure institution intentional nonopioid occurrence
poisoning residential self x
C0480206|analgesic exposure institution intentional nonopioid occurrence
poisoning residential self";
dbmopen(%CID,"c:/program files/perl builder2/testnew",0666) or die "$!";
for(split(/\n/,$var)){
my ($c,$s)=split(/\|/,$_);
chomp $s;
push(@{$CID{$s}},$c);
print "PUSHED: $c\n";
}
for(keys %CID){
print "$_ => @{$CID{$_}}\n";
}
dbmclose %CID;
I get the following:
PUSHED: C0480780
PUSHED: C0480209
PUSHED: C0480209
PUSHED: C0480209
PUSHED: C0480209
PUSHED: C0480777
PUSHED: C0480777
PUSHED: C0480777
PUSHED: C0480777
PUSHED: C0480206
PUSHED: C0480206
PUSHED: C0480206
PUSHED: C0480206
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined x => C0480780 C0480209 C0480777 C0480206
analgesic exposure highway intent nonopioid occurrence poisoning street
undetermined => C0480780 C0480209 C0480777 C0480206
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined x => C0480209 C0480777 C0480206
analgesic exposure institution intent nonopioid occurrence poison
residential undetermined => C0480209 C0480777 C0480206
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined x => C0480780 C0480209 C0480777 C0480206
analgesic exposure institution intent nonopioid occurrence poisoning
residential undetermined => C0480780 C0480209 C0480777 C0480206
analgesic exposure highway intentional nonopioid occurrence poison self
street x => C0480209 C0480777 C0480206
analgesic exposure highway intentional nonopioid occurrence poison self
street => C0480209 C0480777 C0480206
analgesic exposure highway intentional nonopioid occurrence poisoning self
street x => C0480780 C0480209 C0480777 C0480206
analgesic exposure highway intentional nonopioid occurrence poisoning self
street => C0480780 C0480209 C0480777 C0480206
analgesic exposure institution intentional nonopioid occurrence poison
residential self x => C0480209 C0480777 C0480206
analgesic exposure institution intentional nonopioid occurrence poison
residential self => C0480209 C0480777 C0480206
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self x => C0480780 C0480209 C0480777 C0480206
analgesic exposure institution intentional nonopioid occurrence poisoning
residential self => C0480780 C0480209 C0480777 C0480206
Am I missing sth here? Does anybody know where I go wrong?
Thanks,
J
------------------------------
Date: Wed, 5 Mar 2003 08:56:00 -0000
From: Jacqui or (maybe) Pete <porjes@spamcop.net>
Subject: Errors to browser??
Message-Id: <MPG.18cfcbf3df4f74be989842@news.CIS.DFN.DE>
This script: http://www.online-brainstorm.com/test/showdb.pl returns
nothing to the browser (not even any headers). I think it's probably
got some syntax errors, but the same happens (I think) with runtime
errors. My question is how to get compilation / runtime errors to show
up. Source is at http://www.online-brainstorm.com/test/showdb.txt
No need to check the actual code - if I can just get an error message or
two I'm sure I can work out the rest!
Thanks in advance for any pointers.
--
What goes around, comes around;
As ye Sow, so shall ye Reap.
Unless you're Onan, of course.
------------------------------
Date: Wed, 05 Mar 2003 10:21:45 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Errors to browser??
Message-Id: <b44ipt$c4j$1@news.dtag.de>
Jacqui or (maybe) Pete wrote:
> This script: http://www.online-brainstorm.com/test/showdb.pl returns
> nothing to the browser (not even any headers). I think it's probably
> got some syntax errors, but the same happens (I think) with runtime
> errors. My question is how to get compilation / runtime errors to show
> up. Source is at http://www.online-brainstorm.com/test/showdb.txt
>
> No need to check the actual code - if I can just get an error message or
> two I'm sure I can work out the rest!
>
> Thanks in advance for any pointers.
Look at line 2 of the post CGI.pm from BSD 2 posts behind yours.
->malte
------------------------------
Date: Wed, 5 Mar 2003 09:49:13 -0000
From: Jacqui or (maybe) Pete <porjes@spamcop.net>
Subject: Re: Errors to browser??
Message-Id: <MPG.18cfd86cac1cbe5e989843@news.CIS.DFN.DE>
In article <b44ipt$c4j$1@news.dtag.de>, ubl@schaffhausen.de says...
> Jacqui or (maybe) Pete wrote:
> > This script: http://www.online-brainstorm.com/test/showdb.pl returns
> > nothing to the browser (not even any headers). I think it's probably
> > got some syntax errors, but the same happens (I think) with runtime
> > errors. My question is how to get compilation / runtime errors to show
> > up. Source is at http://www.online-brainstorm.com/test/showdb.txt
> >
> > No need to check the actual code - if I can just get an error message or
> > two I'm sure I can work out the rest!
> >
> > Thanks in advance for any pointers.
>
> Look at line 2 of the post CGI.pm from BSD 2 posts behind yours.
>
I do read this newsgroup! I don't get anything back at all from my
script (not even an HTTP header) and the first lines of my script (as
posted above) are:
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
--
What goes around, comes around;
As ye Sow, so shall ye Reap.
Unless you're Onan, of course.
------------------------------
Date: Wed, 05 Mar 2003 11:38:20 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Errors to browser??
Message-Id: <b44n9g$3ks$1@news.dtag.de>
Jacqui or (maybe) Pete wrote:
> I do read this newsgroup! I don't get anything back at all from my
> script (not even an HTTP header) and the first lines of my script (as
> posted above) are:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use diagnostics;
> use DBI;
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
Well, if that is your complete script :)
Anyway, this is probably not a Perl problem. If you dont even get a http
header, not even a 500 error you should check whether your http server
is running and bound to the right port. Definitely OT in this group.
->malte
------------------------------
Date: Wed, 5 Mar 2003 10:50:44 -0000
From: Jacqui or (maybe) Pete <porjes@spamcop.net>
Subject: Re: Errors to browser??
Message-Id: <MPG.18cfe6e2d51718d4989844@news.CIS.DFN.DE>
In article <b44n9g$3ks$1@news.dtag.de>, ubl@schaffhausen.de says...
> Jacqui or (maybe) Pete wrote:
> > > This script: http://www.online-brainstorm.com/test/showdb.pl returns
> > I don't get anything back at all from my
> > script (not even an HTTP header) and the first lines of my script (as
> > posted above) are:
...
> > use CGI::Carp qw(fatalsToBrowser);
...
> Anyway, this is probably not a Perl problem. If you dont even get a http
> header, not even a 500 error you should check whether your http server
> is running and bound to the right port. Definitely OT in this group.
>
OK, thanks. I'll go talk to affordablehost.com.
--
What goes around, comes around;
As ye Sow, so shall ye Reap.
Unless you're Onan, of course.
------------------------------
Date: Wed, 5 Mar 2003 19:22:16 +1100
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: exported constants, Win32::File
Message-Id: <3e65b493$0$10441@echo-01.iinet.net.au>
"Joly, Patrick: IAC" <Joly.Patrick@ic.gc.ca> wrote in message
news:3E3612E8D41DD3118DCC060000000000096D65C1@pubgate-01.ic.gc.ca...
> I can't seem to be able to read the constant that Win32::File reportedly
> exports. For instance, when running the following script on Windows
> 2000 (I am using ActivePerl 5.8):
>
> # Create a new file
> use strict;
> use warnings;
> chdir "c:/";
>
> # create a new file
> open(DIR, ">newfile.txt") || die "can't open file";
> print DIR "feed on line\nand another.";
> close DIR;
>
> # see if I can read its attributes
> use Win32::File qw( GetAttributes SetAttributes );
> my $attr;
> GetAttributes('c:/newfile.txt', $attr);
> print "$attr\n";
> print NORMAL;
> print ARCHIVE;
> print COMPRESSED;
> print DIRECTORY;
> print HIDDEN;
> print OFFLINE;
> print READONLY;
> print SYSTEM;
> print TEMPORARY;
>
> __END__
>
I think that when you choose to export GetAttributes() and SetAttributes()
then that's *all* that gets exported. So you'd really need:
use Win32::File qw(GetAttributes SetAttributes NORMAL etc......);
Otoh - there's no need to export those 2 functions - at least on the version
I have - so all you really have to do is write:
use Win32::File;
If you do that, then you should find the script works as you expect.
Cheers,
Rob
------------------------------
Date: Wed, 05 Mar 2003 06:27:42 -0000
From: Chris <chrisl_ak@hotmail.com>
Subject: fixing "times" in a file
Message-Id: <Xns9334DA1CF3312chrislak@216.168.3.44>
I have a file with a bunch of times scattered throughout it in min:sec
format. I need to replace them all with hrs:min:sec format, including
leading 00: if less than one hour. So, this:
44:02
67:17
234:23
Would become
00:44:02
01:07:17
03:54:23
This isn't a homework assignment, incidentally. I am trying to port
information from my music database program to MySQL, but MySQL won't accept
the "illegal" format of something like: 67:17 ... ideas?
------------------------------
Date: Wed, 05 Mar 2003 07:17:54 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: fixing "times" in a file
Message-Id: <3E65A49F.8C31B27F@acm.org>
Chris wrote:
>
> I have a file with a bunch of times scattered throughout it in min:sec
> format. I need to replace them all with hrs:min:sec format, including
> leading 00: if less than one hour. So, this:
>
> 44:02
> 67:17
> 234:23
>
> Would become
>
> 00:44:02
> 01:07:17
> 03:54:23
s{(?<!:)(\d+):(\d+)(?!:)}
{sprintf '%02d:%02d:%02d', $1 / 60, $1 % 60, $2}ge;
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 5 Mar 2003 09:50:11 -0000
From: "Bigus" <somewhere@nowhere.com>
Subject: Re: Greedy regexps
Message-Id: <b44h8k$jnq@newton.cc.rl.ac.uk>
Gunnar Hjalmarsson wrote:
> I just had to understand... :)
>
> Bigus wrote:
>> I am parsing some HTML code in the following manner:
>> [snip]
>> $html =~ s/<td.+?class=\"*head1.*?>(.*?)<\/td>/###$1###/gi;
> --------------------^^^
> That's the 'problem'.
[..]
> On the contrary: The first match works fine, i.e. '.+?' matches the
> space between td and class. During the second match, '.+?' represents
> the string
> ' class="body1">Some text.. blah blah</td> </tr> <tr align="left">
> <td '
Of course.. I had to read it twice to get.. derrr. Thanks for actually
answering my question :-)
Spencer
------------------------------
Date: 4 Mar 2003 22:50:55 -0800
From: sade_bhat@yahoo.com (Sade Bhat Kalasabail)
Subject: Re: How to access proxy server for Perl Soap client
Message-Id: <3a621d3c.0303042250.3b95ee77@posting.google.com>
news@roaima.freeserve.co.uk wrote in message news:<mn9v3b.q7l.ln@moldev.cmagroup.co.uk>...
> Sade Bhat Kalasabail <sade_bhat@yahoo.com> wrote:
> > Have installed soaplite on a solaris. The server is behind a
> > firewall.
> >
> > I am trying to run an example program
>
> > but keep getting the error message
> > 500 Can't connect to services.soaplite.com:80 (Interrupted system
> > call) at ./hibye.pl line 7
>
> What happens if you try connecting from your Solaris box directly?
> telnet services.soaplite.com 80
>
Got AN Error message
bash-2.03$ telnet services.soaplite.com 80
Trying 66.33.209.120...
telnet: Unable to connect to remote host: Connection timed out
> You should get a "connected" response.
>
> > IS it because I haven't given my proxy server and user/password
> > access?
>
> I don't know. Do you need to do this before you get access to external
> web servers?
>
> > If so how do I do it. What gives the 500 error message.
>
> Have you looked at the documentation for SOAP::Lite yet? Particularly
> the "SOAP Cookbook" at http://cookbook.soaplite.com. This shows (with
> examples) how to perform proxy authentication.
>
> Start at http://cookbook.soaplite.com/#accessing%20service%20with%20basic%20authentication
> and read that and the next section.
>
> Chris
Thanks after changing i.e including the HTTP_proxy variable the error message
is
405 Method not allowed at ./hibye.pl line 13
I tried by using the user/passwd for HTTP_proxy_user & pass variables
alternatively tried including the user/password in the HTTP_proxy env variable
still getting the same message.
Am I right in assuming that the uri/proxy setting in the SOAP:LITE call (as below)
print SOAP::Lite
-> uri('http://www.soaplite.com/Demo')
-> proxy('http://services.soaplite.com/hibye.cgi')
is for the soap server. And the HTTP_proxy env value (as per the cookbook) I am
setting are for my proxyserver thru which i get into internet.
Thanks
Sade
------------------------------
Date: Wed, 05 Mar 2003 09:22:59 GMT
From: piet <pdhze@yahoo.co>
Subject: Re: insert meta tags into an existing html file
Message-Id: <Usenet.gbgkeiae@localhost>
Jürgen Exner wrote:
>
> piet wrote:
> > How do I insert new meta tags into an existing local html file?
>
> Please see my answer in The Other NG.
> I hope you still remember where you posted :-(
>
> jue
ok txs, I do remember
------------------------------
Date: Wed, 05 Mar 2003 09:25:04 GMT
From: piet <pdhze@yahoo.co>
Subject: Re: insert meta tags into an existing html file
Message-Id: <Usenet.elqeojcd@localhost>
Gunnar Hjalmarsson wrote:
>
> piet wrote:
> > How do I insert new meta tags into an existing local html file?
>
> How about using a text editor? ;-)
>
> If that's not the answer you had expected, you may want to give some
> more details. For instance: In what way is your question related to
> Perl?
>
> / Gunnar
>
if it were not related to perl, would I be posting in a perl newsgroup?
what I need is perl code to insert meta tags.
------------------------------
Date: Wed, 05 Mar 2003 05:10:12 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Shell commands
Message-Id: <UEf9a.37199$V42.23771@nwrddc03.gnilink.net>
Eric J. Roode wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in
> news:g1e9a.68761$ep5.13002 @nwrddc02.gnilink.net:
>
>> Andy wrote:
>>> This should be relatively straightforward but I'm having a tough
>>> time. I'm trying to use the copy command within a perl script, but
>>> I need to pass an option to the command as well. I basically need
>>> to execute the following (i'm on win32 but it works the same on
>>> unix):
>>>
>>> xcopy /S D:\scripts\somedir R:\somedir
>>
>> Why are you forking a new process and calling an external program
>> (not to mention writing non-protable code) if there is a Perl
>> solution?
>>
>> use File::Copy;
>
> xcopy does a deep copy (recurses subdirectories). Afaik, File::Copy
> does not do that.
Ooops, you are right. So the OP would need
use File::Recurse;
too.
jue
------------------------------
Date: Wed, 5 Mar 2003 04:50:20 -0500
From: "wendy" <shukwong@yahoo.com>
Subject: using system to run a program and redirect its output
Message-Id: <b44h9r$p6g$1@news01.cit.cornell.edu>
Hi, I was trying to run a program in perl with system() and then redirect
its output
something like
system("./myprog >testout1");
However, the output still showed up on the screen and testout1 was created
but empty. Anyone know why?
Thanks,
Wendy
------------------------------
Date: 5 Mar 2003 09:53:44 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: using system to run a program and redirect its output
Message-Id: <b44hf8$i85$1@mamenchi.zrz.TU-Berlin.DE>
wendy <shukwong@yahoo.com> wrote in comp.lang.perl.misc:
> Hi, I was trying to run a program in perl with system() and then redirect
> its output
> something like
> system("./myprog >testout1");
>
> However, the output still showed up on the screen and testout1 was created
> but empty. Anyone know why?
This could be because myprog prints to STDERR, not STDOUT. Not that
this has anything to do with Perl.
Anno
------------------------------
Date: Wed, 05 Mar 2003 10:57:34 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: using system to run a program and redirect its output
Message-Id: <3E65CA0E.695C6BDE@fujitsu-siemens.com>
wendy wrote:
> =
> Hi, I was trying to run a program in perl with system() and then redire=
ct
> its output
> something like
> system("./myprog >testout1");
> =
> However, the output still showed up on the screen and testout1 was crea=
ted
> but empty. Anyone know why?
myprog writing to stderr?
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Wed, 05 Mar 2003 05:25:46 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: XML to HTML
Message-Id: <uTf9a.37222$V42.11374@nwrddc03.gnilink.net>
Peter Cooper wrote:
> Tore Aursand:
>> Why don't you just (...) write a stylesheet for the XML file?
>
> Varying browser support and various browser inconsistencies might be
> the problem with that method.
Why? You can apply the XSL locally, just like you would run the Perl script
locally.
jue
------------------------------
Date: Wed, 5 Mar 2003 17:13:41 +1100
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: XS code to call DLL
Message-Id: <3e65966d$0$10444@echo-01.iinet.net.au>
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3E651BAF.44A7F7A0@earthlink.net...
<snip>
>
> If these tricks don't work, or if the function returns a double, then
> you may need to use XS.
>
With Win32::API-0.20 you should be able to pass/receive doubles with [D] and
D respectively.
Documentation suggests that the same is supposed to work for floats ([F] and
F), but I've had no success with that - not that I've tried to any great
extent. (In fact I've only briefly used this module.)
Passing a value to the dll with [F] seems ok, but getting a returned float
with F is not. In the case I tried I was able to get the float back as a
double (D).
Just to throw something else into the mix, the op could also look at
accessing the dll functions using Inline::C module. It does all the XS stuff
for you, and getting access to the functions this way pretty much boils down
to being able to access them from C. Haven't actually accessed any Windows
system dll's this way, but I've found it very useful for some other dll's -
and I still don't know any XS ..... not so sure that that's either a selling
point *or* something to be proud of .....
:-)
Cheers,
Rob
------------------------------
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 4665
***************************************