[28582] in Perl-Users-Digest
Perl-Users Digest, Issue: 9946 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 9 14:10:20 2006
Date: Thu, 9 Nov 2006 11:10:10 -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 Thu, 9 Nov 2006 Volume: 10 Number: 9946
Today's topics:
Perl runtime error after installing oracle 10g <mabounajm@gmail.com>
Re: Perl runtime error after installing oracle 10g <quetzalcotl@consultant.com>
Re: process subregions on an image/matrix anno4000@radom.zrz.tu-berlin.de
Re: process subregions on an image/matrix anno4000@radom.zrz.tu-berlin.de
Query Remote Server and display result on web browser eric.chin@travel2.com
Re: Query Remote Server and display result on web brows <RedGrittyBrick@SpamWeary.foo>
Strange behaviour <critterstown@googlemail.com>
Re: Strange behaviour <tadmc@augustmail.com>
Re: Strange behaviour <critterstown@googlemail.com>
Re: Strange behaviour <tadmc@augustmail.com>
Re: Strange behaviour <noreply@gunnar.cc>
Tk - text->insert looses the format <lev.weissman@creo.com>
Re: Tk - text->insert looses the format <mritty@gmail.com>
Re: Tk - text->insert looses the format <lev.weissman@creo.com>
Re: Tk - text->insert looses the format <zentara@highstream.net>
Re: Tk - text->insert looses the format <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Nov 2006 06:16:01 -0800
From: "enigma" <mabounajm@gmail.com>
Subject: Perl runtime error after installing oracle 10g
Message-Id: <1163081761.383452.83860@m7g2000cwm.googlegroups.com>
Hi,
I have a perl script which i've been using perfectly with no trouble at
all.. Two days ago i installed Oracle 10g. After i tried to run my
script.. A pop window tells me:
The application has failed to start because Perl56.dll was not found.
Re-installing the application may fix this problem.
After I press OK, i get these errors
Can't load
'C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/auto/IO/IO.dll'
for module IO: load_file:The specified module could not be found at
C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/XSLoader.pm
line 75.
at C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/IO.pm line
9
Compilation failed in require at
C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/IO/Handle.pm
line 256.
BEGIN failed--compilation aborted at
C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/IO/Handle.pm
line 256.
Compilation failed in require at C:/Perl/site/lib/IO/Scalar.pm line
152.
BEGIN failed--compilation aborted at C:/Perl/site/lib/IO/Scalar.pm line
152.
Compilation failed in require at C:/Perl/site/lib/OLE/Storage_Lite.pm
line 171.
BEGIN failed--compilation aborted at
C:/Perl/site/lib/OLE/Storage_Lite.pm line 171.
Compilation failed in require at
C:/Perl/site/lib/Spreadsheet/ParseExcel.pm line 176.
BEGIN failed--compilation aborted at
C:/Perl/site/lib/Spreadsheet/ParseExcel.pm line 176.
Compilation failed in require at CreateUsFile.pl line 2.
BEGIN failed--compilation aborted at CreateUsFile.pl line 2.
This script loads some modules and it's not finding them it's searching
in the wrong place.. Because if i do a simple perl script like print"
hello "; it works fine!
Can somebody tell me how to tell perl to look in the right place for
those modules?
Thank you
------------------------------
Date: 9 Nov 2006 08:17:45 -0800
From: "Ingo Menger" <quetzalcotl@consultant.com>
Subject: Re: Perl runtime error after installing oracle 10g
Message-Id: <1163089065.645369.224730@m7g2000cwm.googlegroups.com>
enigma schrieb:
> Hi,
>
> I have a perl script which i've been using perfectly with no trouble at
> all.. Two days ago i installed Oracle 10g. After i tried to run my
> script.. A pop window tells me:
>
> The application has failed to start because Perl56.dll was not found.
> Re-installing the application may fix this problem.
>
> After I press OK, i get these errors
>
> Can't load
> 'C:\oracle\product\10.1.0\Db_1\perl\5.6.1\lib\MSWin32-x86/auto/IO/IO.dll'
> for module IO: load_file:The specified module could not be found at
This is typical. Just when you think you have your working environment
complete, ohh almost, I just install XYZ 5.47, then it happens.
The stupid, dumb bastards of the XYZ company include java 1.2.7 or perl
5.6.1 in their distribution and they make sure, this is called when you
say java or perl.
(A notable exception is NoMagic, they ask during install of MagicDraw
if they should use the java engine that's already installed.)
I recommend the following: find the perl.exe and all perl*dll that is
in the oracle file tree and rename them.
Or remove the correponding entry from PATH, if you can.
After that, your normal perl should work as before.
Take care: some Oracle patch procedures may rely on *their* shipped
perl version. Therefore, before doing another oracle upgrade or patch,
recreate the state of the system you have now (i.e. "perl" would call
the perl shipped with Oracle)
To take the different perls apart, perl -v or perl -V should help. It
shows, among others, the default @INC-path.
------------------------------
Date: 9 Nov 2006 14:45:23 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: process subregions on an image/matrix
Message-Id: <4rgt83Fre2rfU1@mid.dfncis.de>
<xhoster@gmail.com> wrote in comp.lang.perl.misc:
> "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> wrote:
> > Hi everybody, I need a bit of help on the programming side:
> >
> > I'm trying to write a program to perform a filtering operation on an
> > image,
> > represented as a matrix of integers.
> > So I'm 1st thing writing a procedure that scans the image, and, when
> > finding a pixel in the color to be processed, it scans all the
> > neighboring pixels until all the cluster is processed (and, if its size
> > is in the correct range, it applies the transform).
> >
> > Right now I perform this scanning of the cluster in the way I find most
> > elegant: recursion:
> >
> > sub recurseinto
> > {
> > my ($x,$y)=@_;
> > my $c;
> >
> > $flag[$x][$y]=1;
> > $c=1;
> >
> > if (($x-1>0)&&($flag[$x-1][$y]==0)&&($img[$x-1][$y]==$col)) { $c +=
> > recurseinto($x-1,$y) }
> > if (($x+1<=$width)&&($flag[$x+1][$y]==0)&&($img[$x+1][$y]==$col)) {
> > $c += recurseinto($x+1,$y) }
> > if (($y-1>0)&&($flag[$x][$y-1]==0)&&($img[$x][$y-1]==$col)) { $c +=
> > recurseinto($x,$y-1) }
> > if (($y+1<=$height)&&($flag[$x][$y+1]==0)&&($img[$x][$y+1]==$col))
> > { $c += recurseinto($x,$y+1) }
> > return $c;
> >
> > }
> >
> > Well, it works, but - I hate to admit it - it's slow.
> >
> > The question is: in which other way you would perform this task?
>
> You could use traditional methods to remove recursion using a stack.
>
> my @stack = (@_); #starting point
> #....
> while (@stack) {
> my ($x,$y)=splice @stack,0,2;
> if whatever($x-1,$y) { push @stack, $x-1,$y; $c++};
> if whatever($x+1,$y) { push @stack, $x+1,$y; $c++};
> # etc.
> }
>
> But if you need it to be hugely faster, I'd look into switching languages,
> either to C (Inline::C) or some specialized image processing language.
I think the problem is equivalent to finding connected components of
a graph, a well-researched subject.. That's another direction to look
for algorithms and/or libraries.
Anno
------------------------------
Date: 9 Nov 2006 14:54:02 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: process subregions on an image/matrix
Message-Id: <4rgtoaFre2rfU2@mid.dfncis.de>
<xhoster@gmail.com> wrote in comp.lang.perl.misc:
> "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> wrote:
[...]
> > clear what happens to @stack, since it is sometimes push-ed, but never
> > pop-ped, so how can it be exhausted?
>
> The code:
> my ($x,$y)=splice @stack,0,2;
>
> Is equivalent to:
> my $x=shift @stack;
> my $y=shift @stack;
>
> (Which means I used a queue rather than a stack. It shouldn't change the
> outcome, just the order of processing. To use a stack, you would
> instead use "my ($x,$y)=splice @stack, -2, 2;")
...or indeed
my ( $y, $x) = ( pop @stack, pop @stack);
to give the keyword "pop" an appearance in the show.
Anno
------------------------------
Date: 9 Nov 2006 09:14:49 -0800
From: eric.chin@travel2.com
Subject: Query Remote Server and display result on web browser
Message-Id: <1163092489.143844.120210@m7g2000cwm.googlegroups.com>
Hi,
I have a perl script that checks the remote servers (linux) disk space
usage.
It is just a simple 'ssh remote_server /bin/df -h' , processing the
result and print out the fields I want.
I would like to display the disk space check result on a web browser. I
have done some googling and perl FAQ but not manage to find any
example. Does anyone know any example how can I do that?
TIA
Any pointer appreciated
Thankyou
Eric
------------------------------
Date: Thu, 09 Nov 2006 18:14:31 +0000
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Query Remote Server and display result on web browser
Message-Id: <2umdnT1gqJOb7c7YnZ2dnUVZ8v2dnZ2d@bt.com>
eric.chin@travel2.com wrote:
> Hi,
>
> I have a perl script that checks the remote servers (linux) disk space
> usage.
> It is just a simple 'ssh remote_server /bin/df -h' , processing the
> result and print out the fields I want.
>
> I would like to display the disk space check result on a web browser. I
> have done some googling and perl FAQ but not manage to find any
> example. Does anyone know any example how can I do that?
>
> TIA
>
> Any pointer appreciated
>
If you type
perldoc CGI
you will be shown a short example at the beginning.
------------------------------
Date: Thu, 09 Nov 2006 13:15:52 +0100
From: Richard <critterstown@googlemail.com>
Subject: Strange behaviour
Message-Id: <eiv688$mr1$1@online.de>
Why does isn't my function executed in this context:
# does not work
my $doc = XMLin($configfile) or die Notifier::Info("ERROR: Can't open
$configfile");
# works if I change the above line in my perl script
Notifier::Info("blablub");
my $doc = XMLin($configfile)
So if I just call Notifier::Info() it works, but if I call my func to
handle the error :
or die Notifier::Info("ERROR: Couldn't open $configfile");
or this way
or Notifier::Info("ERROR: Couldn't open $configfile");
it doesn't work.
Does anybody know the reason for this?
Thanks in advance , Richard
#content of Notifier.pm
package Notifier;
sub Info{
my ($msg) = @_;
open(LOG, ">>/tmp/log.txt") or die "Couldn't open /tmp/log.txt \n";
$logentry = "\nINFO:" . $msg ;
print LOG $logentry;
close LOG;
}
------------------------------
Date: Thu, 9 Nov 2006 06:43:37 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Strange behaviour
Message-Id: <slrnel68jp.nda.tadmc@tadmc30.august.net>
Richard <critterstown@googlemail.com> wrote:
> Why does isn't my function executed in this context:
>
>
> # does not work
> my $doc = XMLin($configfile) or die Notifier::Info("ERROR: Can't open
> $configfile");
> Does anybody know the reason for this?
perl does, and it will tell you if you ask it to.
> #content of Notifier.pm
>
> package Notifier;
>
> sub Info{
> my ($msg) = @_;
> open(LOG, ">>/tmp/log.txt") or die "Couldn't open /tmp/log.txt \n";
> $logentry = "\nINFO:" . $msg ;
> print LOG $logentry;
> close LOG;
> }
You should always enable warnings when developing Perl code!
perl -w -MNotifier
Notifier.pm did not return a true value.
BEGIN failed--compilation aborted.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 09 Nov 2006 15:11:51 +0100
From: Richard <critterstown@googlemail.com>
To: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Strange behaviour
Message-Id: <45533727.30601@googlemail.com>
Tad McClellan schrieb:
> Richard <critterstown@googlemail.com> wrote:
>
>> Why does isn't my function executed in this context:
>>
>>
>> # does not work
>> my $doc = XMLin($configfile) or die Notifier::Info("ERROR: Can't open
>> $configfile");
>
>> Does anybody know the reason for this?
>
>
> perl does, and it will tell you if you ask it to.
well if perl did I 'd be already at home having some drink.
>
>
>> #content of Notifier.pm
>>
>> package Notifier;
>>
>> sub Info{
>> my ($msg) = @_;
>> open(LOG, ">>/tmp/log.txt") or die "Couldn't open /tmp/log.txt \n";
>> $logentry = "\nINFO:" . $msg ;
>> print LOG $logentry;
>> close LOG;
>> }
>
>
> You should always enable warnings when developing Perl code!
Who said I didn't enable warnings? I didn't post a complete script!
>
>
> perl -w -MNotifier
>
> Notifier.pm did not return a true value.
> BEGIN failed--compilation aborted.
Well as I said it works when calling with Notifier::Info but not with or
die Notifier::Info so this is not the problem.
I just didn't post the complete module. Of course my module has got 1;
at the end.
I use warnings and strict there are no errors.
>
>
>
------------------------------
Date: Thu, 9 Nov 2006 08:38:05 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Strange behaviour
Message-Id: <slrnel6fad.nvj.tadmc@tadmc30.august.net>
[ Please do not send stealth-CCs of usenet posts, it is bad netiquette. ]
Richard <critterstown@googlemail.com> wrote:
> Tad McClellan schrieb:
>> Richard <critterstown@googlemail.com> wrote:
>>> #content of Notifier.pm
Since you said this was the contents of Notifier.pm...
>>> package Notifier;
>>>
>>> sub Info{
>>> my ($msg) = @_;
>>> open(LOG, ">>/tmp/log.txt") or die "Couldn't open /tmp/log.txt \n";
>>> $logentry = "\nINFO:" . $msg ;
>>> print LOG $logentry;
>>> close LOG;
>>> }
>>
>>
>> You should always enable warnings when developing Perl code!
>
> Who said I didn't enable warnings? I didn't post a complete script!
... I assumed that you actually meant that this was the
contents of Notifier.pm.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 09 Nov 2006 17:26:40 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Strange behaviour
Message-Id: <4rh39vFqtp8fU1@mid.individual.net>
Richard wrote:
>
> # does not work
> my $doc = XMLin($configfile) or die Notifier::Info("ERROR: Can't open
> $configfile");
Pls define "does not work".
Maybe XMLin() returns a true value even if it cannot read the file? In
that case, checking whether the return value is true isn't an adequate
error check.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 9 Nov 2006 00:36:13 -0800
From: "MoshiachNow" <lev.weissman@creo.com>
Subject: Tk - text->insert looses the format
Message-Id: <1163061373.666211.250710@b28g2000cwb.googlegroups.com>
HI,
The same string ($temp) formated with sprintf,is correctly printed to a
file using "print",but looses all it's formating when displayed in the
Tk text->insert:
$temp=sprintf("%-55s %-30s %-10s %-16s %-10s\n", $key, $services{$key},
$state{$status{CurrentState}}, $startup{$value}, $status{ServiceType});
&disp($temp);
sub disp {
my $message=shift;
$txt -> insert('end',$message);
print "$message";
}
Appreciate any ideas.
------------------------------
Date: 9 Nov 2006 05:29:28 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Tk - text->insert looses the format
Message-Id: <1163078968.377688.24830@f16g2000cwb.googlegroups.com>
MoshiachNow wrote:
> HI,
> The same string ($temp) formated with sprintf,is correctly printed to a
> file using "print",but looses all it's formating when displayed in the
> Tk text->insert:
>
> $temp=sprintf("%-55s %-30s %-10s %-16s %-10s\n", $key, $services{$key},
> $state{$status{CurrentState}}, $startup{$value}, $status{ServiceType});
>
> &disp($temp);
>
> sub disp {
> my $message=shift;
> $txt -> insert('end',$message);
>
> print "$message";
> }
I can't reproduce the problem with ActiveState build 819, perl v5.8.8.
The following program creates the text box with exactly the formatting
anticipated. Fifty five spaces for the first field, etc. Are you sure
your text box is large enough to show the formatting correctly?
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = MainWindow->new();
$mw->geometry('1024x768');
my $txt = $mw->Text(-height=>768, -width=>1024);
$txt->pack();
my $temp=sprintf("%-55s %-30s %-10s %-16s %-10s\n",
"field number 1",
"second field",
"numero tres",
"4th",
"and the final field");
disp($temp);
MainLoop;
sub disp {
my $message=shift;
$txt -> insert('end',$message);
print "$message";
}
__END__
------------------------------
Date: 9 Nov 2006 05:47:43 -0800
From: "MoshiachNow" <lev.weissman@creo.com>
Subject: Re: Tk - text->insert looses the format
Message-Id: <1163080063.063300.209480@h48g2000cwc.googlegroups.com>
Hi,
The issue was to use the proportional font (courier) instead of Arial
...
:)
------------------------------
Date: Thu, 09 Nov 2006 14:21:53 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Tk - text->insert looses the format
Message-Id: <o6e6l2pl7c12ft9ehvouup1ljimgrf9i0v@4ax.com>
On 9 Nov 2006 00:36:13 -0800, "MoshiachNow" <lev.weissman@creo.com>
wrote:
>The same string ($temp) formated with sprintf,is correctly printed to a
>file using "print",but looses all it's formating when displayed in the
>Tk text->insert:
>
>$temp=sprintf("%-55s %-30s %-10s %-16s %-10s\n", $key, $services{$key},
>$state{$status{CurrentState}}, $startup{$value}, $status{ServiceType});
>
>&disp($temp);
>
>sub disp {
> my $message=shift;
> $txt -> insert('end',$message);
>
> print "$message";
>}
>
>
>Appreciate any ideas.
Maybe because the text widget is wrapping it, like a terminal does?
Try:
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $mw = tkinit;
my $txt = $mw->Scrolled('Text',
-wrap => 'none',
)->pack;
my $temp=sprintf("%-55s %-30s %-10s %-16s %-10s\n", 'abxvdgejhr',
'zcvzxcvzxcv','good', 'yadda yadda', 'gizmo');
&disp($temp);
MainLoop;
sub disp {
my $message=shift;
$txt -> insert('end',$message);
print "$message";
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Thu, 9 Nov 2006 08:39:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Tk - text->insert looses the format
Message-Id: <slrnel6fcs.nvj.tadmc@tadmc30.august.net>
MoshiachNow <lev.weissman@creo.com> wrote:
> Hi,
>
> The issue was to use the proportional font (courier) instead of Arial
ITYM *non*proportional (ie. fixed width) font?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 9946
***************************************