[17920] in Perl-Users-Digest
Perl-Users Digest, Issue: 80 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 17 14:05:49 2001
Date: Wed, 17 Jan 2001 11:05:13 -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: <979758313-v10-i80@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Jan 2001 Volume: 10 Number: 80
Today's topics:
Re: $foo{$bar}={x=>$x,y=>$y} v. $foo{$bar}{x}=$x etc? <bart.lateur@skynet.be>
Re: (Beginner) ?<! question <joe+usenet@sunstarsys.com>
Re: (Beginner) ?<! question <aqumsieh@hyperchip.com>
Re: (Beginner) ?<! question <mkuin@globalrangers.com>
Re: aix suid perl problem <prlawrence@lehigh.edu>
ANNOUNCE: Mail::Procmail 1.00 is released (Johan Vromans)
Re: Can't associate .PL files in Win98 (Duncan Murdoch)
Re: Can't get Apache, Win98, and Mod_Perl working. <randy@theoryx5.uwinnipeg.ca>
Child processes don't clean up (defunct processes left) <geoff-at-farmline-dot-com@127.0.0.1>
Re: converting Internet Explorer 'favorites' to Netscap <nospam@ireland.com>
Eval scoping problem? <caesura@freenetname.co.uk>
Executing Win32 external app via CGI <doronn@nrt.co.il>
Re: FAQ 8.8: How do I get the screen size? <martin.quensel@era.ericsson.se>
Re: FAQ 8.8: How do I get the screen size? <a.v.a@home.nl>
Re: Finite Automata with Output using PerlRE? <pcj@Stanford.EDU>
Re: Finite Automata with Output using PerlRE? <pcj@Stanford.EDU>
Gimp Compilation erros <chahn@peregrine.com>
Re: How to turn 'die' in 'warn' on the fly <Martin.Jost@icn.siemens.de>
Re: Insert value into table using perl/DBI <jing@research.att.com>
Multiple Substitution <ken.chesak@dhs.state.tx.us>
Re: Multiple Substitution <elijah@workspot.net>
Re: Multiple Substitution <ren.maddox@tivoli.com>
Re: Need some expert guidance with HTTP::Request (LWP, (Honza Pazdziora)
newbie question <laryk@bc.edu>
Re: NEWBIE: need help with search spider/crawler <amonotod@netscape.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Jan 2001 16:06:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: $foo{$bar}={x=>$x,y=>$y} v. $foo{$bar}{x}=$x etc?
Message-Id: <hmgb6t0mpq04mt1adqapvsvh68l4j28ain@4ax.com>
John Stumbles wrote:
> $ifTable{$ifIndex}{dot1d}{$MAC} = {
> mtime => $MAC_mtime,
> nMACs => $nMACs,
> ...etc...
> } ;
>
>and I thought I should have a table of mtime, nMACs etc for each $MAC, but
>I only get the record for the last $MAC I assign.
I agree with Abigail ("Insufficient data"), but I'd venture a guess
anyway. It's not uncommon that your hash keys don't differ from each
other. Print out the keys every time you do an assignment, and maybe
you'll find the error that way.
--
Bart.
------------------------------
Date: 17 Jan 2001 11:29:46 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: (Beginner) ?<! question
Message-Id: <m3snmiw39h.fsf@mumonkan.sunstarsys.com>
"Garry Heaton" <garry@heaton6.freeserve.co.uk> writes:
> s/(?<!c)ei/ie/g
>
> This is intended to match the spelling rule
> "I before E, except after C" ,
> but wouldn't this be simpler:
>
> s/cei/cie/g
Try
$_ = "received, ieght, sliegh";
You seem to be unfixing "received", whereas the original
should leave it alone.
(The "a" sound is a bit tougher to get right :)
--
Joe Schaefer
------------------------------
Date: Wed, 17 Jan 2001 16:39:38 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: (Beginner) ?<! question
Message-Id: <7aitneqgj8.fsf@merlin.hyperchip.com>
"Garry Heaton" <garry@heaton6.freeserve.co.uk> writes:
> I'm reading Larry Wall's "Programming Perl" (3rd ed.) and on p.204 there's
> an example of the Negative Lookbehind pattern:
>
> s/(?<!c)ei/ie/g
>
> This is intended to match the spelling rule "I before E, except after C" ,
> but wouldn't this be simpler:
>
> s/cei/cie/g
>
> ??
What would this do to "freind" ? The first one will correct it, while
yours won't.
--Ala
------------------------------
Date: Wed, 17 Jan 2001 17:41:29 +0100
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: (Beginner) ?<! question
Message-Id: <944i57$nj8$1@news1.xs4all.nl>
--s/(?<!c)ei/ie/g
--
--This is intended to match the spelling rule "I before E, except
after ---C" ,
--but wouldn't this be simpler:
--
--s/cei/cie/g
No, the above converts
mei cei dei into mie cei die
You code converts
mei cei dei into mei cie dei
That is not the same I guess.....
------------------------------
Date: Wed, 17 Jan 2001 09:50:40 -0600
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: Re: aix suid perl problem
Message-Id: <944f0f$g0o@fidoii.CC.Lehigh.EDU>
"Phil R Lawrence" <prlawrence@lehigh.edu> wrote:
> After reading perldoc perlsec, I made a perl script and had our sysadmin
> chown, chgrp, and chmod it appropriately (?).
>
> When I run it, however, $> remains the same as $<.
Well, this problem was not solved, but gotten around using Larry's nice
wrapsuid script. I did find that one has to run wrapsuid as root, however,
for the resulting compiled program to have its suid bit set. See perldoc
perlsec for more on wrapsuid.
Phil R Lawrence
prlawrence@lehigh.edu
------------------------------
Date: 17 Jan 2001 17:19:03 +0100
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: ANNOUNCE: Mail::Procmail 1.00 is released
Message-Id: <t6bkavm1tvm257@corp.supernews.com>
Mail::Procmail version 1.00 has been uploaded to CPAN.
http://www.cpan.org/authors/id/JV/Mail-Procmail-1.00.tar.gz
Mail::Procmail is a Procmail-like facility for creating easy mail filters.
procmail is a great mail filter program, but it has weird recipe
format. It's pattern matching capabilities are basic and often
insufficient. I wanted something flexible whereby I could filter my
mail using the power of Perl.
I've been considering to write a procmail replacement in Perl for a
while, but it was Simon Cozen's Mail::Audit module, and his article in
The Perl Journal #18, that set it off.
I first started using Simon's great module, and then decided to write
my own since I liked certain things to be done differently. And I
couldn't wait for his updates.
Mail::Procmail allows a piece of email to be logged, examined,
delivered into a mailbox, filtered, resent elsewhere, rejected, and so
on. It is designed to allow you to easily create filter programs to
stick in a .forward or .procmailrc file, or similar.
For example:
use Mail::Procmail;
# Set up. Log everything up to log level 3.
my $m_obj = pm_init ( loglevel => 3 );
# Pre-fetch some interesting headers.
my $m_from = pm_gethdr("from");
my $m_to = pm_gethdr("to");
my $m_subject = pm_gethdr("subject");
# Default mailbox.
my $default = "/var/spool/mail/".getpwuid($>);
pm_log(1, "Mail from $m_from");
pm_ignore("Non-ASCII in subject")
if $m_subject =~ /[\232-\355]{3}/;
pm_resend("jojan")
if $m_to =~ /jjk@/i;
# Make sure I see these.
pm_deliver($default, continue => 1)
if $m_subject =~ /getopt(ions|(-|::)?long)/i;
# And so on ...
# Final delivery.
pm_deliver($default);
DIFFERENCES WITH MAIL::AUDIT
Note that several changes are due to personal preferences and do not
necessarily imply deficiencies in Mail::Audit.
* General
Not object oriented. Procmail functionality typically involves one
single message. All (relevant) functions are exported.
* Delivery
Each of the delivery methods is able to continue (except pm_reject
and pm_ignore).
Each of the delivery methods is able to pretend they did it
(for testing a new filter).
No default file argument for mailbox delivery, since this is system
dependent.
Each of the delivery methods logs the line number in the calling
program so one can deduce which 'rule' caused the delivery.
Message IDs can be checked to suppress duplicate messages.
System commands can be executed for their side-effects.
pm_ignore logs a reason as well.
pm_reject will fake a "No such user" status to the mail transfer agent.
* Logging
The logger function is exported as well. Logging is possible to
a named file, STDOUT or STDERR.
Since several deliveries can take place in parallel, logging is
protected against concurrent access, and a timestamp/pid is included
in log messages.
A log reporting tool is included.
* Robustness
Exit with TEMPFAIL instead of die in case of problems.
pm_pipe_to ignores SIGPIPE.
pm_pipe_to returns the command exit status if continuation is selected.
Commands and pipes can be protected against concurrent access using
lockfiles.
------------------------------
Date: Wed, 17 Jan 2001 11:46:37 -0500
From: murdoch@fisher.stats.uwo.ca (Duncan Murdoch)
Subject: Re: Can't associate .PL files in Win98
Message-Id: <3a6bcbf2.417625989@newshost.uwo.ca>
On Tue, 16 Jan 2001 17:15:49 -0800, Gary Burton
<glburton@mindspring.com> wrote in message
<3A64F245.8021DB94@mindspring.com>:
> What you say is true if the path to the script file does not have any spaces in it, but falls apart if it does.
I just tried it with the .pl file in my "Program Files" directory, and
it worked fine. This might be Windows version dependent: I think the
Win9x versions generally use the short filename (no space) version of
the path in cases like this, but I don't know what NT uses.
One problem with using "start foo.pl" is that it will open a new
window to run the program in; I don't know a way around that.
Duncan Murdoch
------------------------------
Date: 17 Jan 2001 17:58:01 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Can't get Apache, Win98, and Mod_Perl working.
Message-Id: <944mf9$sec$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, shiloam@my-deja.com wrote:
> In article <94054d$nu8$1@canopus.cc.umanitoba.ca>,
> "Randy Kobes" <randy@theory.uwinnipeg.ca> wrote:
>> <shiloam@my-deja.com> wrote in message
>> news:93vhco$sre$1@nnrp1.deja.com...
[ .. ]
>> > Everytime I try to use the LoadModule perl_module
>> > modules/ApacheModulePerl or LoadModule perl_module
>> > modules/ApacheModulePerl.dll it doesn't work, and gives me a can't
>> > load module error.
[ .. ]
>> Are you using the mod_perl ppm package and the
>> ApacheModulePerl.dll that matches your Apache version?
>> And is the ActivePerl perl binary included in your PATH
>> when you start Apache?
> Yes, c:\erl\bin is the first item in my path, and I downloaded the
> mod_perl from perl.apache.org I think, it came as a package so it must
> match. Can anyone help?
There's two possible Win32 routes given from perl.apache.org to get
mod_perl. One is using ActivePerl 6xx, in which case you need the
correct mod_perl ppm package plus ApacheModulePerl.dll - these
must match the apache version you're running (see
http://theoryx5.uwinnipeg.ca/ppmpackages/modperl.versions
for details). The other route is to use the precompiled package
perl-win32-bin-x.x.exe which includes perl+apache+mod_perl+mod_ssl.
Due to different compile-time flags, you can't mix and match
between an ActivePerl component and a component of the
perl-win32-bin-x.x.exe package. Is the system you're using just one or
the other? And if you're using ActivePerl, did you get the mod_perl
ppm package corresponding to your version of Apache?
best regards,
randy kobes
------------------------------
Date: Wed, 17 Jan 2001 16:31:11 -0000
From: "Geoff Winkless" <geoff-at-farmline-dot-com@127.0.0.1>
Subject: Child processes don't clean up (defunct processes left) even though SIGCHLD does wait()
Message-Id: <944h9f$f7r$1@soap.pipex.net>
As subject: I'm currently daemonising amavis-perl (which is an interface for
various email servers to scan mail for viruses using standard AV programs -
see www.amavis.org ) - and have got it pretty much working: the code listens
on a unix socket, forks off a child and handles the accepted connection.
All of this works fine and dandy but -some- of the children are leaving
<defunct> processes on my box (linux, Redhat 7, Linux 2.2.18, perl 5.0
version 6.0
Code is below.
Note that I set $SIG{CHLD} to \&deadbabe, which simply sets a variable to
the result of wait() and resets $SIG{CHLD} again. All of this was taken
pretty much verbatim from the perldocs.
The question is, why would a child die but not pass a sigchld to its parent?
Is it to do with the fact that later (in the child) we use `` to call things
like the virus scanner?
Sorry there's no repeatable example but this is a transient problem :(
Thanks for any help/suggestions
Geoff
====code fragment begins====
my $name="/var/run/amavisd.sock";
my $uaddr=sockaddr_un($name);
my $diedpid;
sub deadbabe {
$diedpid=wait;
$SIG{CHLD} = \&deadbabe;
# stupid sys5 resets the signal when called - but only -after- the wait...
}
$SIG{CHLD} = \&deadbabe;
# Catch any dead child process
socket(Server, PF_UNIX, SOCK_STREAM, 0) || die "socket failed: $!";
unlink ($name);
print "set up socket\n";
bind (Server, $uaddr) || die "bind failed: $!";
print "bound socket\n";
listen (Server, SOMAXCONN) || die "listen failed: $!";
print "listening\n";
my $mpid;
$diedpid=0;
my $a;
while (($a=accept(Client,Server)) || ($diedpid ne 0))
{
# now we start the repeating loop...
if ($diedpid) {
$diedpid=0;
if (!defined($a)) {
# if the accept returned purely because of a caught sigchld then continue
next;
}
}
if (!defined($mpid=fork)) {
shutdown Server, 2;
do_exit (2, __LINE__);
}
if ($mpid) {
next;
# if we're the parent, just go back to the accept loop
}
print "forked off -- child running...\n";
$SIG{CHLD} = 'DEFAULT';
# reset sigchild - we don't want to mess up $? for the virus scanner
------------------------------
Date: Wed, 17 Jan 2001 16:16:35 +0000
From: rob <nospam@ireland.com>
Subject: Re: converting Internet Explorer 'favorites' to Netscape bookmark file
Message-Id: <3A65C563.BE17B8AB@ireland.com>
that was too easy ;) I'm still interested in why I get the uninitialised error
in my OP. I should also be able to go from a bookmarks file to a 'Favorites'
folder structure.
-rob-
bowman wrote:
> rob <nospam@ireland.com> wrote in message
> news:3A6590D4.74363A72@ireland.com...
> > Hi
> > I'm trying to import the favourites I've created in IE to Netscape. IE
> > uses a .url file for the actual link, so in my favourites, I can click
> > "MSN" which uses information from the file below.
>
> Unless you are doing this as an exercise, look at 'Import and Export' under
> the 'File' menu on IE.
------------------------------
Date: Wed, 17 Jan 2001 18:59:01 -0000
From: "Andrew Cragg" <caesura@freenetname.co.uk>
Subject: Eval scoping problem?
Message-Id: <t6bqot4r3bik25@gxsn.com>
Hello,
I have an odd problem where I'm writing to a text file using Data::Dumper
then reading it back using eval. The data in eval is "declared" as a
sort-of global variable. It seems that when I read from the text file using
eval the global variable is not set unless I use the variable in some way
(assignment to another variable for instance).
Is this a scoping problem?
Here is the code :
<< This is a_package.pm >>
#! /usr/bin/perl -w
use strict;
package a_package;
use Data::Dumper;
my $DataStructure = {};
sub write {
my $Index = 0;
for ($Index = 0, $Index < 20, $Index++){
$DataStructure->{"a hash key $Index"}->{"another one
$Index"}->[$Index] = "Array value $Index";
}
open A_FILE, ">database.txt" or die "Cannot open database.txt for
writing.\n";
print A_FILE Data::Dumper->Dump ([$DataStructure],["DataStructure"]);
close A_FILE;
} # end sub write
sub read {
open A_FILE, "database.txt" or die "Cannot open database.txt for
reading\n";
my @A_File = <A_FILE>;
close A_FILE;
eval (join '', @A_File);
#### Put this in and the print sub works ...!!!
#### Leave it out and the DataStrucure is undef !!!
####
#### my $TempVar = $DataStructure;
} # end sub read
sub print {
my $self = shift;
$self->read;
print Data::Dumper->Dump ([$DataStructure],["DataStructure"]);
}
<<This is the main.pl file >>
#! /usr/bin/perl -w
use strict;
use a_package;
# Once written to file then don't need this.
#
# a_package->write;
# Calls read then prints.
# Only works if the global hash is read from within a_package->read.
#
a_package->print;
Any ideas?
Much gratefulness,
Andy Cragg
www.caesuramedia.com
------------------------------
Date: Tue, 16 Jan 2001 22:03:52 +0200
From: "Doron Nissimi" <doronn@nrt.co.il>
Subject: Executing Win32 external app via CGI
Message-Id: <9429fb$eb2$1@news.netvision.net.il>
Hi folks!
I am trying to run SHUTDOWN.EXE (from the NT Reskit) via a CGI script.
It seems that when it is executed from within the script (whether by use of
the system() method or using `back-quotes`), it is executed using the
NY_AUTHORITY\SYSTEM (built-in) account's credentials -- which don't not have
any priveleges on remote machines. This kinda defeats the purpose of the
script.
Interestingly enough, the script works fine when it is run from the CLI. My
IIS4 server is configured to use an 'administrator' account to execute
scripts, meaning the Perl (CGI) script itself running with the proper
credentials... It's only when PerlIS.dll (or whatever ISAPI application
interprets the script) calls SHUTDOWN.EXE, SHUTDOWN.EXE is run under the
SYSTEM account.
Any help would really be appreciated!
Thanx!
Doron
------------------------------
Date: Wed, 17 Jan 2001 18:02:04 +0100
From: Martin Quensel <martin.quensel@era.ericsson.se>
Subject: Re: FAQ 8.8: How do I get the screen size?
Message-Id: <3A65D00C.10807@era.ericsson.se>
AvA wrote:
>
>
> use Term::ReadKey;
> ($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
>
>
>
> This is a nice module and comes very close to what i need.
> I making a website with a window filling background.
> And because not everyone uses the same resolution, a module like this
> comes in handy.
>
> Is there a similar module to capture a webbrowsers height and width in
> pixels?
I guess that what you are after is a script on a webserver somwhere on
The internet that can send a request to another ip adress and ask that
machine what size the webrowser is on the screen.
I am sorry to say that you can not do that easily.
The hypertext transfer protocoll that is used to transfer HTML (and
other content) between a webserver and a browser does not really include
information like that.
You can however include javascripts that detect diffrent things from the
browser, and have that information sent by the same form to you script.
But what happens when the user wants to rezise his window after he has
loaded your page?
Hope this info was usefull to you.
best regards
Martin Quensel
------------------------------
Date: Wed, 17 Jan 2001 17:09:56 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: FAQ 8.8: How do I get the screen size?
Message-Id: <3A65D388.E2F4B5E9@home.nl>
--------------F239AC1B3D768E2AA6E244A0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Martin Quensel wrote:
> I guess that what you are after is a script on a webserver somwhere on
> The internet that can send a request to another ip adress and ask that
> machine what size the webrowser is on the screen.
>
> I am sorry to say that you can not do that easily.
> The hypertext transfer protocoll that is used to transfer HTML (and
> other content) between a webserver and a browser does not really include
> information like that.
>
> You can however include javascripts that detect diffrent things from the
> browser, and have that information sent by the same form to you script.
>
> But what happens when the user wants to rezise his window after he has
> loaded your page?
>
> Hope this info was usefull to you.
>
> best regards
> Martin Quensel
yes it is, silly of me to think a serverside script could do such a thing.
--
AvA
irc.xchat.org #perl
--------------F239AC1B3D768E2AA6E244A0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Martin Quensel wrote:
<blockquote TYPE=CITE>I guess that what you are after is a script on a
webserver somwhere on
<br>The internet that can send a request to another ip adress and ask that
<br>machine what size the webrowser is on the screen.
<p>I am sorry to say that you can not do that easily.
<br>The hypertext transfer protocoll that is used to transfer HTML (and
<br>other content) between a webserver and a browser does not really include
<br>information like that.
<p>You can however include javascripts that detect diffrent things from
the
<br>browser, and have that information sent by the same form to you script.
<p>But what happens when the user wants to rezise his window after he has
<br>loaded your page?
<p>Hope this info was usefull to you.
<p>best regards
<br>Martin Quensel</blockquote>
<p><br>yes it is, silly of me to think a serverside script could do such
a thing.
<br>
<br>
<pre>--
AvA
irc.xchat.org #perl</pre>
</html>
--------------F239AC1B3D768E2AA6E244A0--
------------------------------
Date: 17 Jan 2001 17:06:57 GMT
From: Paul Cody Johnston <pcj@Stanford.EDU>
Subject: Re: Finite Automata with Output using PerlRE?
Message-Id: <944jfh$65e$2@nntp.Stanford.EDU>
> I don't see a need for a new regex syntax here. By examining the capture
> variables $1, etc. you can determine which part of the regex matches.
> <<start code>>
> my ($text, $animal);
> $text = 'Eeek, a mouse!';
> if ($text =~ m/\b(cat|dog|mouse)\b/) {
> $animal = uc($1);
> print $animal;
> }
> <<end code>>
> If you wanted to associate a numerical value with the token, you could use a
> hash: The example below also shows how to generate the regex on the fly.
Only if the regex components (the alternatives) are trivial (as in this
example). I can't do a hash lookup off (a|b)+c*.
> Finally, a lexer that demonstrates lex like behavior. The lexer sub
> consumes tokens from the global scalar ref $LLTEXT. The behavior is quite
> similar to the lexers generated by Parse::Lex.
> <<start code>>
> use strict;
> use warnings;
> my @animals = qw(
> aardvark bison cat
> dog emu frog
> );
> my @regexen = map { qr{\b$_\b}i } @animals;
> my $text = "I saw a gnu, emu, cat and bison";
> my $LLTEXT = \$text;
> while (1) {
> my ($type, $token) = lexer();
> last unless $type;
> print "$type: '$token'\n";
> }
> sub lexer {
> # Dummy foreach loop coerces $$LLTEXT into $_
> foreach ($$LLTEXT) {
> # Strip whitespace
> s/^\s+// and redo;
> # Test each regex
> foreach my $regex (@regexen) {
> s/^($regex)// and return (uc($1), $1);
> }
The point of using a regex is not to sequentially try each alternative
independently, even though perl does not use a DFA regex engine. It's
much less efficient.
> # Capture other tokens
> s/^(\w+)// and return ('WORD', $1);
> s/^(\S+)// and return ('OTHER', $1);
> s/^(.+)// and return ('UNKNOWN', $1);
> }
> return (undef, undef); # Done
> }
> <<end code>>
> HTH,
> Kurt Stephens
------------------------------
Date: 17 Jan 2001 17:00:52 GMT
From: Paul Cody Johnston <pcj@Stanford.EDU>
Subject: Re: Finite Automata with Output using PerlRE?
Message-Id: <944j44$65e$1@nntp.Stanford.EDU>
>>
>>(1) can I do this now in Perl?
> The syntax is already in place: the (?{ code }) construct can be
> used to identify which part of a regex actually matched, like so:
> /dog(?{ $hit_num = 1})|cat(?{ $hit_num = 2})|mouse(?{ $hit_num = 3})/
> See perlre for details. Unfortunately the construct is still
> experimental and can't be recommended for production code yet.
Very nice -- that would work. Thanks for the feedback.
------------------------------
Date: Wed, 17 Jan 2001 11:29:54 -0800
From: Christopher K Hahn <chahn@peregrine.com>
Subject: Gimp Compilation erros
Message-Id: <3A65F2B2.E4CF0551@peregrine.com>
Hello,
I am getting a compilation error when compiling the Gimp module
(Gimp-1.201) under Redhat Linux 6.2.
I expect that the Makefile.PL would catch stale versions of supporting
tools,
but I cannot be certain.
Here is the error:
##########################
cc -c -I/home/chahn/builds/perl/cpan/Gimp/Gimp-1.201
-I/usr/local/lib/perl5/site_perl/5.6.0/i686-linux/PDL/Core
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"1.201\"
-DXS_VERSION=\"1.201\" -fpic
-I/usr/local/lib/perl5/5.6.0/i686-linux/CORE
-Ddatadir="\"/usr/local/share\"" -DHAVE_PDL=1 Lib.c
Lib.xs:7: compat10.h: No such file or directory
make[1]: *** [Lib.o] Error 1
##########################
What upgrade will deliver this "compat10.h"?
Thank you for the time , and a direct response ok,
Christopher
------------------------------
Date: Wed, 17 Jan 2001 17:26:12 +0100
From: Martin Jost <Martin.Jost@icn.siemens.de>
To: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to turn 'die' in 'warn' on the fly
Message-Id: <3A65C7A4.DB8FCBE5@icn.siemens.de>
Bart Lateur wrote:
>
> Martin Jost wrote:
>
> >I think I read some time ago about a trick to turn all 'dies' in
> >'warns' on the fly.
> >So that during one run of the perl-hack, all dies become a warn,
> >without changing the source.
> Maybe you mean
>
> $SIG{__DIE__} = sub { warn shift };
>
> but careful. If people put a "die" somewhere, they usually don't
> reconsider the possibility that the program would continue regardless.
This isn't used as a 'fix'.
What I want to do is, to see if all errors (of some special class) get
caught.
Normally the first one will 'die' the program. So I have to prevent
this "for a moment".
Unluckily your solution doesn't seem to work. The program dies
nevertheless and prints the message twice...
This is what I get with the DIE-Handler in place:
Huch ! An Pin "CKX_IP" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Huch ! An Pin "CKX_IP" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Note, that this is twice the same message.
This is what I get if I replace the relevant "dies" with "warns":
Huch ! An Pin "CKX_IP" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Huch ! An Pin "CKY_IP" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Huch ! An Pin "CLK_75_IN" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Huch ! An Pin "CLK_HSA_IN" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
Huch ! An Pin "CLK_HSB_IN" muss 0/1 vertauscht werden !.
Exit at /home/jost/perl/att_/att/TabVec.pm line 143.
It seems the DIE-Handler doesn't stop the program from dying.
(Maybe I should mention: This is perl 5.6.0 on HPUX 10.20)
Any additional ideas ?
(Or am I simply chasing a phantom ?)
Martin
------------------------------
Date: Wed, 17 Jan 2001 16:25:15 GMT
From: Jing Zhou <jing@research.att.com>
Subject: Re: Insert value into table using perl/DBI
Message-Id: <3A65C76B.31C7B6A2@research.att.com>
I solved the problem by including the placeholder (?).
Garry Williams wrote:
> On Tue, 16 Jan 2001 20:20:52 GMT, Jing Zhou <jing@research.att.com> wrote:
> >Here is the sample code, I didn't use the (?) placeholder in the SQL
> >statement.
> >
> >use DBI;
> >
> >### perform the database connection
> >
> >my $dbh = DBI->connect ( "dbi:ODBC:snrdb2", "", "" ) or die "Can't connect to
> >database";
> >
> >
> >### Open the macaddress dump file, die upon failure
> >
> >
> >#### Declare our row filed variables
> >### $MacAddress $HostName $IPAddress $SwitchBoardPort $LastSeen
> >
> >open (INPUT, "c:/stage1/Mctest3.txt") || die "cannot open Mctest file for
> >reading";
> >
> > chomp($x = <INPUT>);
> > while ($x ne "") {
> > ($MacAddress,$HostName,$IPAddress,$SwitchBoardPort,$LastSeen)
> > = split(" ",$x);
> >
> > my $sth = $dbh->prepare( "INSERT INTO IDFSwitch VALUES
> >
> >($MacAddress,$HostName,$IPAddress,$SwitchBoardPort,$LastSeen)");
>
> Well, it would have been nice to see at least one example line in your
> input stream, but let me guess at what it might look like:
>
> 08:00:20:cf:e6:b3 xyz 1.2.3.4 55 4/7/2000
>
> Now, the actual string that you are asking the database to prepare
> looks like this:
>
> INSERT INTO IDFSwitch VALUES
> (08:00:20:cf:e6:b3,xyz,1.2.3.4,55,4/7/2000)
>
> This is an invalid syntax in any SQL-based database I've ever worked
> with.
>
> You need to properly quote the values in the SQL query.
>
> See the quote() database handle method in the DBI manual page.
>
> --
> Garry Williams
------------------------------
Date: Wed, 17 Jan 2001 11:24:06 -0600
From: "Ken Chesak" <ken.chesak@dhs.state.tx.us>
Subject: Multiple Substitution
Message-Id: <944kht$1su$1@goblin.tdh.state.tx.us>
Following code works for all but the single quote.
#!/usr/local/bin/perl5
#
$data = "HOME & FREE < BORN > FREE ' HELP \"";
%encode = ( '&' => '&',
'<' => '<',
'>' => '>',
'"' => '"',
'\'' => '&singleq;' );
$data =~ s/([&<">])/$::encode{$1}/g;
RESULT:
data= HOME & FREE < BORN > FREE ' HELP "
Why doesnt the single quote get changed?
What is the syntax ([&<'>]) doing?
() is a pattern
[] ?
& bitwise string comparison?
<> ?
I have looked at perldoc perlop and perlre.
Thanks
------------------------------
Date: 17 Jan 2001 17:45:13 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Multiple Substitution
Message-Id: <eli$0101171239@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ken Chesak <ken.chesak@dhs.state.tx.us> wrote:
> $data = "HOME & FREE < BORN > FREE ' HELP \"";
> %encode = ( '&' => '&',
> '<' => '<',
> '>' => '>',
> '"' => '"',
> '\'' => '&singleq;' );
>
> $data =~ s/([&<">])/$::encode{$1}/g;
^^^^
No single quote there.
You can make this sort of thing flexible enough to deal with changes
to the %encode with no change to the RE. It will be slightly slower,
if that is a concern:
$data =~ s/(.)/defined($encode{$1})?$encode{$1}:$1/eg;
> What is the syntax ([&<'>]) doing?
perldoc perlre.
> () is a pattern
No it is a capturing group.
> [] ?
Character class.
> & bitwise string comparison?
> <> ?
Characters in the character class.
> I have looked at perldoc perlop and perlre.
Look at perlre again or buy Freidl's (sp?) _Mastering Regular
Expressions_.
Elijah
------
assuming you have no real need for the :: before the variable name
------------------------------
Date: 17 Jan 2001 11:45:43 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Multiple Substitution
Message-Id: <m3ae8q2htk.fsf@dhcp11-177.support.tivoli.com>
"Ken Chesak" <ken.chesak@dhs.state.tx.us> writes:
> $data =~ s/([&<">])/$::encode{$1}/g;
This stuff ^^^^ is a list of characters to replace. Notably, '
is not included in that list. Include it and all should be well.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 15 Jan 2001 10:16:03 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Need some expert guidance with HTTP::Request (LWP, libwww) and returned error. Short test code included
Message-Id: <G778Ir.25J@news.muni.cz>
On Mon, 15 Jan 2001 09:40:43 +1000, Merlin <robert@chalmers.com.au> wrote:
>
> If I call the bit of code as a subroutine, it returns this .....
> ------------------------------------
> Can't call method "request" on an undefined value at
> /usr/local/lib/perl5/site_perl/5.6.0/LWP/UserAgent.pm line 227.
> ---------------------------------------
>
> It appers to be not getting the request passed to it? but I can't figure out
> why? if it works as a standalone, why not as a subroutine?
Works just fine on 5.004_04 and LWP 5.47.
So it looks like a problem with 5.6.* or a problem with the way you
call it.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: Wed, 17 Jan 2001 12:31:29 -0500
From: kevin lary <laryk@bc.edu>
Subject: newbie question
Message-Id: <3A65D6F1.66C58F5C@bc.edu>
I am new to both PERL and this list, so am sure I am asking the most
basic of questions - but since I can't find the syntax in either printed
or online documentation I thought this august group would probably have
the answer.
Q: What is the syntax for running a C program from within a batch PERL
file?
The syntax I use to execute the program from the command line is
csh -f $someprogram/someoption
parameter1,parameter2,parameter3,parameter4,parameter5,parameter6
when I put this in a .pl file and try to run it I get error messages:
Unquoted string "csh" may clash with future reserved word at
pliftest01.pl line 1.
I have tried putting various parts of the string in quotes which results
in _different_ error messages, but I can't get the thing to work.
Any help would be greatly appreciated. Also fyi in case it is
significant, parameters 5 & 6 are the percent sign (%) and the plus
sign(+).
Thank you,
k.lary
--
K.Lary / Applications Developer / Boston College
------------------------------
Date: Wed, 17 Jan 2001 17:19:01 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: NEWBIE: need help with search spider/crawler
Message-Id: <944k5q$62j$1@nnrp1.deja.com>
In article <slrn969nor.v5.abigail@tsathoggua.rlyeh.net>,
abigail@foad.org wrote:
> amonotod (amonotod@netscape.net) wrote on 16 September 2001 in
> <URL:news:942jk8$i13$1@nnrp1.deja.com>:
> == I got a little more curious about this, and looked in my ascii ref
> == chart, to confirm a little suspicion. That is a JAPH, as I had
> == originally thought; so why did it not JAPH out?
>
> Upgrade.
>
> Abigail
Boy, you torment just for the sake of it, don't you? :-) I know I've
seen a message from you explaining that one of your JAPH's rely on a
deprecated function from a earlier version, and now this one relies on a
new function in the latest version...
Obscurity for the sake of obscurity:
http://x73.deja.com/[ST_rn=ps]/getdoc.xp?AN=511317709&CONTEXT=979751834.
1442971732&hitnum=1
You rock!
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com
http://www.deja.com/
------------------------------
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 V10 Issue 80
*************************************