[28315] in Perl-Users-Digest
Perl-Users Digest, Issue: 9679 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 3 18:05:45 2006
Date: Sun, 3 Sep 2006 15:05:06 -0700 (PDT)
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, 3 Sep 2006 Volume: 10 Number: 9679
Today's topics:
Re: (Off topic) Cyberwar question <skybuck2000@hotmail.com>
Re: (Off topic) Cyberwar question <bik.mido@tiscalinet.it>
Re: Can anyone explain this code? <tadmc@augustmail.com>
Re: Can anyone explain this code? <bik.mido@tiscalinet.it>
Re: Help with 4 dimensional implementation <not-for-replies@zombie.org.uk>
how to install Win32-Word-Writer-0.02 <liyuefu@gmail.com>
Re: how to install Win32-Word-Writer-0.02 <not-for-replies@zombie.org.uk>
how to set level1 text when using win32:ole <liyuefu@gmail.com>
map tricks <kraven@noip.com>
Re: map tricks <bik.mido@tiscalinet.it>
Re: map tricks <tadmc@augustmail.com>
new CPAN modules on Sun Sep 3 2006 (Randal Schwartz)
Simple OpenGL script to exe failing lul1@gmx.net
SOAP::Lite bugs me! <Morten.Guldager@gmail.com>
Re: Where was a function defined? <nobull67@gmail.com>
Re: Where was a function defined? <occitan@esperanto.org>
Re: words selection <mumia.w.18.spam+nospam.usenet@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Sep 2006 03:51:49 -0700
From: "Skybuck" <skybuck2000@hotmail.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <1157280709.556417.10680@b28g2000cwb.googlegroups.com>
Update:
5. I will prepare all evidence and I will ask a Dutch
"Telecommunication watch dog" (called OPTA in short) to take a look at
my case.
Bye,
Skybuck.
------------------------------
Date: 3 Sep 2006 14:58:00 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <u7klf2tjqt57egi3e0ct2ampk71v9753qc@4ax.com>
On 3 Sep 2006 03:51:49 -0700, "Skybuck" <skybuck2000@hotmail.com>
wrote:
>Update:
Not that I (nor most of us) felt a need for it, but...
>5. I will prepare all evidence and I will ask a Dutch
>"Telecommunication watch dog" (called OPTA in short) to take a look at
>my case.
...good luck! Certainly a better option than spamming newsgroups with
OT requests, and one I recommend you for the future!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 3 Sep 2006 00:02:10 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Can anyone explain this code?
Message-Id: <slrnefkoei.mmr.tadmc@magna.augustmail.com>
PerlNovice <mfarid1@yahoo.com> wrote:
> perl -ne MyProc.pl
>
> Nothing happens.
The -n switch makes a while-diamond loop.
Since you did not call the program with any command line arguments
the diamond operator will (attempt to) read from STDIN.
> It doesn't even come back to command prompt.
Because it is waiting for you to type some data on STDIN...
> But what does
> ">".(join"_",@F).".log" mean?
perldoc -f join
The concatentation operator is described in:
perldoc perlop
> What d,s,w etc mean?
That depends on where d,s,w etc appear in the code.
Those characters do not appear in any code that you've quoted,
so I dunno what they do...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 Sep 2006 11:04:53 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can anyone explain this code?
Message-Id: <kq4lf218ksfqkipfgtmi6lti0e5utcqdh3@4ax.com>
On 2 Sep 2006 19:37:23 -0700, "PerlNovice" <mfarid1@yahoo.com> wrote:
>Michele/David, I put David's tidied up version in a file called
>MyProc.pl. I then tried
>to execute it and see if it produces the same resul as follows:
>
>perl -ne MyProc.pl
I guess you may want to supply some arguments on the command line a'
la
perl -ne MyProc.pl file1.txt file2.txt
for otherwise...
>Nothing happens. It doesn't even come back to command prompt.
...something *does* happen: it expects something on STDIN. Putting it
differently: it waits for you to type something. Just try for
yourself!
>Joe, thank you for your response. However, I would need little bit more
>detail to understand.
>
>1),">".(join"_",@F).".log" or die "@F $!"
>I know the part after the comma is the second part of the file handle.
$ perl -lane 'print ">".(join"_",@F).".log"'
foo bar baz
>foo_bar_baz.log
>But what does
>">".(join"_",@F).".log" mean? I know the file being created is a .log
>file. What is
>">".(join"_",@F).? I know @F is the file name that is created later.
No, it isn't. @F is an array. Thus it *can't* be *a* file name.
>How is the file name
>created in this format? What d,s,w etc mean? What .*MATCHED? I know
*Which* d,s,w? Quote relevant context, please! In a regex .*MATCHED
means any sequence of any charachters followed by the exact string
'MATCHED'.
>that giving a character
>by character explanation will take you long time but any explanation in
>this format will be
>very helpful. In the meantime, I am trying by best to understand the
>code.
Much better help than I could give you can find in
perldoc perlre
>A lot of thanks to anyone who responds.
You welcome!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 03 Sep 2006 08:25:38 GMT
From: Brian Greenfield <not-for-replies@zombie.org.uk>
Subject: Re: Help with 4 dimensional implementation
Message-Id: <ue3lf2dupsmu09fm7m142mqk7e294a9jj4@4ax.com>
On 2 Sep 2006 16:17:23 -0700, "DJ Stunks" <DJStunks@gmail.com> wrote:
>are there any docs other than perlvar on $;? it wasn't that
>informative...
I couldn't remember what $; did so I looked it up too, but I thought
it was quite clear:
The subscript separator for multidimensional array emulation. If
you refer to a hash element as
$foo{$a,$b,$c}
it really means
$foo{join($;, $a, $b, $c)}
[...]
Default is "\034", the same as SUBSEP in awk
So, the following all do the same (as long as the value in $; hasn't
been changed)
$hash{'A','B'} = "foo";
$hash{"A$;B"} = "foo";
$hash{"A\034B"} = "foo";
They each create a key in %hash of "A\034B";
Is that any clearer?
------------------------------
Date: 3 Sep 2006 06:07:31 -0700
From: "liyuefu@gmail.com" <liyuefu@gmail.com>
Subject: how to install Win32-Word-Writer-0.02
Message-Id: <1157288851.300270.57090@h48g2000cwc.googlegroups.com>
Hi friends, I want to use perl to analyze some txt files and create a
Windows Word document.
I found the module Win32-Word-Writer-0.02 can help me to archive
this, but when I
tried to test it, I got some errors:
----------------------------------------------------------------------
D:\develop\Win32-Word-Writer-0.02>nmake test
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
C:\Perl\bin\perl.exe Build --makefile_env_macros 1 test
t\00-load..............ok
t\01-saveas............ok
t\02-write.............ok 9/15Could not set style (Normal), it may not
be define
d in the document
# Looks like you planned 15 tests but only ran 9.
# Looks like your test died just after 9.
t\02-write.............dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 10-15
Failed 6/15 tests, 60.00% okay
t\03-open..............ok 7/15Could not set style (Normal), it may not
be define
d in the document
# Looks like you planned 15 tests but only ran 10.
# Looks like your test died just after 10.
t\03-open..............dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 11-15
Failed 5/15 tests, 66.67% okay
t\04-saveas_format.....Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\04-saveas_format.t line 5.
BEGIN failed--compilation aborted at t\04-saveas_format.t line 5.
t\04-saveas_format.....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-21
Failed 21/21 tests, 0.00% okay
t\05-stylespec.........Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\05-stylespec.t line 5.
BEGIN failed--compilation aborted at t\05-stylespec.t line 5.
t\05-stylespec.........dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-9
Failed 9/9 tests, 0.00% okay
t\05-writeparagraph....Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\05-writeparagraph.t line 5.
BEGIN failed--compilation aborted at t\05-writeparagraph.t line 5.
t\05-writeparagraph....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-21
Failed 21/21 tests, 0.00% okay
t\06-setstyle..........Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\06-setstyle.t line 5.
BEGIN failed--compilation aborted at t\06-setstyle.t line 5.
t\06-setstyle..........dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-13
Failed 13/13 tests, 0.00% okay
t\07-italic_bold.......Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\07-italic_bold.t line 5.
BEGIN failed--compilation aborted at t\07-italic_bold.t line 5.
t\07-italic_bold.......dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-28
Failed 28/28 tests, 0.00% okay
t\08-list..............Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\08-list.t line 5.
BEGIN failed--compilation aborted at t\08-list.t line 5.
t\08-list..............dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-38
Failed 38/38 tests, 0.00% okay
t\09-table.............Can't locate Sub/Uplevel.pm in @INC (@INC
contains: D:\de
velop\Win32-Word-Writer-0.02\blib\lib
D:\develop\Win32-Word-Writer-0.02\blib\arc
h C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Test/Exception.pm
line 6.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Test/Exception.pm
line 6.
Compilation failed in require at t\09-table.t line 5.
BEGIN failed--compilation aborted at t\09-table.t line 5.
t\09-table.............dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-1044
Failed 1044/1044 tests, 0.00% okay
t\pod-coverage.........skipped
all skipped: Test::Pod::Coverage 1.04 required for testing POD
coverage
t\pod..................skipped
all skipped: Test::Pod 1.14 required for testing POD
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\02-write.t 255 65280 15 12 80.00% 10-15
t\03-open.t 255 65280 15 10 66.67% 11-15
t\04-saveas_format.t 2 512 21 42 200.00% 1-21
t\05-stylespec.t 2 512 9 18 200.00% 1-9
t\05-writeparagraph.t 2 512 21 42 200.00% 1-21
t\06-setstyle.t 2 512 13 26 200.00% 1-13
t\07-italic_bold.t 2 512 28 56 200.00% 1-28
t\08-list.t 2 512 38 76 200.00% 1-38
t\09-table.t 2 512 1044 2088 200.00% 1-1044
2 tests skipped.
Failed 9/13 test scripts, 30.77% okay. 1185/1218 subtests failed, 2.71%
okay.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0xff'
Stop.
-----------------------------------------------------------------------------------------
any suggestions is appreciated. Thanks.
Li Yuefu
------------------------------
Date: Sun, 03 Sep 2006 16:35:56 GMT
From: Brian Greenfield <not-for-replies@zombie.org.uk>
Subject: Re: how to install Win32-Word-Writer-0.02
Message-Id: <ak0mf2ppq5arh2pemvqs2jqgqtbd6outr7@4ax.com>
On 3 Sep 2006 06:07:31 -0700, "liyuefu@gmail.com" <liyuefu@gmail.com>
wrote:
>I found the module Win32-Word-Writer-0.02 can help me to archive
>this, but when I
>tried to test it, I got some errors:
...
>t\04-saveas_format.....Can't locate Sub/Uplevel.pm in @INC (@INC
>contains: D:\de
I'd start by installing Sub::Uplevel. On the other hand,
http://testers.cpan.org/show/Win32-Word-Writer.html shows 2 out 2
testers failed to build the module.
------------------------------
Date: 3 Sep 2006 09:09:27 -0700
From: "liyuefu@gmail.com" <liyuefu@gmail.com>
Subject: how to set level1 text when using win32:ole
Message-Id: <1157299767.074118.164400@b28g2000cwb.googlegroups.com>
I am trying to write microsoft word document in perl.
I don't know how to set the level of the text, such as level1,level2
and so on.
Could you please tell me?
thanks a lot.
------------------------------
Date: Sun, 03 Sep 2006 21:21:46 GMT
From: kraven <kraven@noip.com>
Subject: map tricks
Message-Id: <pan.2006.09.03.21.21.46.91811@noip.com>
I was playing around with hashes and map and came up with this to build a
hash from a file with ":" separated fields. It really does work, I'm just
wondering if there is a better way.
%hash=map {$hash{$_} = $_} map {(@key,@value) = split(":",$_)}`zcat
etc_apache.md5.20060903143002.3.gz`
------------------------------
Date: 3 Sep 2006 23:40:46 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: map tricks
Message-Id: <tmimf2ppp49vbhbtnsm7egrifv1q4b2sg5@4ax.com>
On Sun, 03 Sep 2006 21:21:46 GMT, kraven <kraven@noip.com> wrote:
>%hash=map {$hash{$_} = $_} map {(@key,@value) = split(":",$_)}`zcat
>etc_apache.md5.20060903143002.3.gz`
All in all seems like a big mess. You generally want either something
like
$hash{ key($_) } = value($_) for @list;
or
%hash = map { key($_) => value($_) } @list;
but you don't want to exploit side effects into a map() block.
PS: Oh, and use strict and warnings, which you may be doing, but don't
*seem* to.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 3 Sep 2006 16:51:03 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: map tricks
Message-Id: <slrnefmji7.4lm.tadmc@magna.augustmail.com>
kraven <kraven@noip.com> wrote:
> I was playing around with hashes and map and came up with this to build a
> hash from a file with ":" separated fields. It really does work, I'm just
> wondering if there is a better way.
I sure hope so, as your way is quite strange...
> %hash=map
White space is not a scarce resource, feel free to use as much of it
as you like to make your code easier to read and understand.
You should always enable "use warnings" and "use strict" when
developing Perl code.
my %hash = map ...
> {$hash{$_} = $_} map {(@key,@value) = split(":",$_)}`zcat
The @value array will _never_ have any elements in it, so why is
it there?
The 1st argument to split() is a regular expression, so it
should _look like_ a regular expression.
> etc_apache.md5.20060903143002.3.gz`
my %hash = map split(/:/), `zcat etc_apache.md5.20060903143002.3.gz`;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 3 Sep 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Sep 3 2006
Message-Id: <J502E9.pAI@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-BooK-Is-My-Bitch-0.01
http://search.cpan.org/~cog/Acme-BooK-Is-My-Bitch-0.01/
----
Array-Diff-0.04
http://search.cpan.org/~typester/Array-Diff-0.04/
Diff two arrays
----
CGI-Application-Plugin-PageBuilder-0.94
http://search.cpan.org/~cmoore/CGI-Application-Plugin-PageBuilder-0.94/
Simplifies building pages with multiple templates.
----
Catalyst-Plugin-Flavour-0.03
http://search.cpan.org/~typester/Catalyst-Plugin-Flavour-0.03/
Catalyst plugin for request flavours.
----
Data-Filter-1.020
http://search.cpan.org/~mwilson/Data-Filter-1.020/
filter data structures with structured filters.
----
Device-Cdio-v0.2.4
http://search.cpan.org/~rocky/Device-Cdio-v0.2.4/
Module for CD Input and Control library.
----
Device-USB-0.16
http://search.cpan.org/~gwadej/Device-USB-0.16/
Use libusb to access USB devices.
----
File-Next-0.24
http://search.cpan.org/~petdance/File-Next-0.24/
File-finding iterator
----
File-Next-0.26
http://search.cpan.org/~petdance/File-Next-0.26/
File-finding iterator
----
Games-EternalLands-0.02
http://search.cpan.org/~franc/Games-EternalLands-0.02/
----
Games-EternalLands-0.03
http://search.cpan.org/~franc/Games-EternalLands-0.03/
----
Linux-Sysfs-0.03
http://search.cpan.org/~flora/Linux-Sysfs-0.03/
Perl interface to libsysfs
----
Matts-Message-Parser-1.0
http://search.cpan.org/~msergeant/Matts-Message-Parser-1.0/
a MIME message parser for email and nttp
----
Net-IMAP-Simple-NB-1.0
http://search.cpan.org/~msergeant/Net-IMAP-Simple-NB-1.0/
Non-blocking IMAP.
----
Net-Proxy-0.07
http://search.cpan.org/~book/Net-Proxy-0.07/
Framework for proxying network connections in many ways
----
PPI-1.117
http://search.cpan.org/~adamk/PPI-1.117/
Parse, Analyze and Manipulate Perl (without perl)
----
SAP-WAS-SOAP-0.05
http://search.cpan.org/~piers/SAP-WAS-SOAP-0.05/
SOAP encoded RFC calls against SAP R/3 / Web Application Server (WAS)
----
TAPx-Parser-0.20
http://search.cpan.org/~ovid/TAPx-Parser-0.20/
Parse TAP output
----
Test-TestCoverage-0.03
http://search.cpan.org/~reneeb/Test-TestCoverage-0.03/
Test if your test covers all 'public' subroutines of the package
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 3 Sep 2006 03:49:47 -0700
From: lul1@gmx.net
Subject: Simple OpenGL script to exe failing
Message-Id: <1157280587.569546.323530@b28g2000cwb.googlegroups.com>
I want to use Perl2exe to convert a simple perl/opengl-file into an
executable for Windows.
I downloaded the latest perl2exe-version and use perl 5.8.8 with opengl
0.54
but the folowing happens.
The conversion runs without a problem. I use the commands: perl2exe
jelly.pl
But when I run the created jelly.exe the following error occurs:
OpenGL object version 0.54 does not match $OpenGL::VERSION 0.5 at
PERL2EXE_STORAGE/DynaLoader.pm line 253.
Jelly.pl, line 4 looks like this: use OpenGL qw/ :all /;
When I remove line 4 errors occur like: Bareword "GL_SMOOTH" not
allowed
while "strict subs" in use at jelly.exe line 20.
Do I have to rewrite things in the script? Use numbers for the defines
like
GL_SMOOTH or something?
Regards,
Marcel D.
----
here is the source of jelly.pl:
---
use strict;
use warnings;
use OpenGL qw/ :all /;
my $spin = 0.0;
my $toggle = 0;
my @light0_position = (2.0, 6.0, 2.0, 0.0);
my @mat_specular = (1.0, 1.0, 1.0, 1.0);
my @mat_shininess = (50.0);
my @mat_amb_diff_color = (0.5, 0.7, 0.5, 0.5);
my @light_diffuse = (1.0, 1.0, 1.0, 1.0);
my @light_ambient = (0.5, 0.5, 0.5, 0.5);
my @light_specular = (1.0, 1.0, 1.0, 1.0);
sub init
{
glClearColor(1.0, 1.0, 1.0, 1.0);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
}
sub display
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLightfv_p(GL_LIGHT0, GL_POSITION, @light0_position);
glLightfv_p(GL_LIGHT0, GL_DIFFUSE, @light_diffuse);
glLightfv_p(GL_LIGHT0, GL_AMBIENT, @light_ambient);
glLightfv_p(GL_LIGHT0, GL_SPECULAR, @light_specular);
glMaterialfv_p(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, @mat_amb_diff_color);
glLoadIdentity();
gluLookAt(2.0, 4.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glPushMatrix();
glScalef(2.0, 2.0, 2.0);
glRotatef($spin, 0.0, 1.0, 0.0);
glutSolidIcosahedron();
glPopMatrix();
glutSwapBuffers();
}
sub reshape
{
my ($w, $h) = @_;
glViewport(0, 0, $w, $h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity (); # define the projection
gluPerspective(45.0, $h ? $w/$h : 0, 1.0, 20.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
sub spinDisplay
{
$spin += 1.0;
$spin = $spin - 360.0 if ($spin >360.0);
glutPostRedisplay();
}
sub mouse
{
my ($button, $state, $x, $y) = @_;
if ($button == GLUT_LEFT_BUTTON)
{
glutIdleFunc(\&spinDisplay) if ($state == GLUT_DOWN);
}
elsif ($button == GLUT_RIGHT_BUTTON)
{
glutIdleFunc(undef) if ($state == GLUT_DOWN);
}
}
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition (0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow ("Teapot");
init ();
glutDisplayFunc(\&display);
glutReshapeFunc(\&reshape);
glutMouseFunc(\&mouse);
glutIdleFunc(\&spinDisplay);
glutMainLoop();
__END__
------------------------------
Date: Sun, 03 Sep 2006 16:59:24 GMT
From: Morten Guldager <Morten.Guldager@gmail.com>
Subject: SOAP::Lite bugs me!
Message-Id: <slrnefm2fc.3pj.Morten.Guldager@linuxine.mogul.dk>
Aloha!
I have written a small client and server using SOAP::Lite.
Things works, but are a bit noisy.
Server code:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Transport::HTTP;
my $daemon = SOAP::Transport::HTTP::Daemon
-> new (LocalAddr => 'localhost',
LocalPort => 12345,
Reuse => 1);
$daemon->dispatch_to('loctim');
$daemon->handle;
sub loctim
{
my ($self, $x) = @_;
my $lt = localtime($x);
return "$x = $lt";
}
Client code:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;
my $S = SOAP::Lite
-> proxy("http://localhost:12345");
my $t = $S->loctim(time()) -> result();
warn "t = $t\n";
But the server warns me at every request:
use_prefix has been deprecated. if you wish to turn off or
on the use of a default namespace, then please use either
ns(uri) or default_ns(uri)
at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 858.
Env: SUSE-10.1 linux, perl v5.8.8, SOAP::Lite 0.66-11
Is there a good-clean-easy fix around?
(besides simply hacking away the "warn" in SOAP/Lite.pm)
Best regards,
/Morten %-)
------------------------------
Date: 3 Sep 2006 07:37:17 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Where was a function defined?
Message-Id: <1157294237.211780.288850@e3g2000cwe.googlegroups.com>
Daniel Pfeiffer wrote:
> with "caller" I can pinpoint where something comes from. Question is how can
> I get at that same information _without_ calling the function?
Well it's not really the same information but I think you mean
something like...
use B;
my $start_cop = B::svref_2object(\&foo)->START;
print $start_cop->file," ",$start_cop->line,"
",$start_cop->stashpv,"\n";
> I hope there is an easier way than traversing %:: and hunting for a function
> of the same name!
That wouldn't help anyhow. The "package" of a subroutine is perhaps a
rather ambiguous concept. Consider:
{
package XXX;
sub YYY::foo {1 };
}
*ZZZ::foo = \&YYY::foo;
my $coderef = \&ZZZ::foo;
What is the package of &{$coderef} ?
B::svref_2object($coderef)->START->stashpv will return XXX.
B::svref_2object($coderef)->GV->STASH->NAME will return YYY
There is AFIAK no way to get ZZZ from $coderef.
------------------------------
Date: Sun, 03 Sep 2006 20:33:49 +0200
From: Daniel Pfeiffer <occitan@esperanto.org>
To: Brian McCauley <nobull67@gmail.com>
Subject: Re: Where was a function defined?
Message-Id: <44FB200D.3000108@esperanto.org>
la 03.09.2006 16:37 Brian McCauley skribis:
> Daniel Pfeiffer wrote:
>
>> with "caller" I can pinpoint where something comes from. Question is how can
>> I get at that same information _without_ calling the function?
>
> Well it's not really the same information but I think you mean
> something like...
>
> use B;
> my $start_cop = B::svref_2object(\&foo)->START;
> print $start_cop->file," ",$start_cop->line,"
> ",$start_cop->stashpv,"\n";
The file method is just what I need here :-) Alas it's not available in 5.6,
which we still support. Currently I built it in such as to be used only in
5.8, but in case you know how it used to work before, I'd be glad to hear!
>> I hope there is an easier way than traversing %:: and hunting for a function
>> of the same name!
>
> That wouldn't help anyhow. The "package" of a subroutine is perhaps a
> rather ambiguous concept.
Yes, you're right.
Thank you very much
Daniel
------------------------------
Date: Sun, 03 Sep 2006 06:19:05 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: words selection
Message-Id: <ttuKg.5594$bM.3906@newsread4.news.pas.earthlink.net>
On 09/02/2006 11:24 AM, Truty wrote:
>
> Ok, this [David Squire's] reply interest me but if __DATA __ content this :
> doing
> close
> sunny
> drugs
> mouve
> botts
>
> my output will be this :
> close | mouve |
>
> and not :
> close | mouve | botts |
>
> because botts haven't 'e' caracteres.
> [...]
>
I didn't use the DATA section, but you'll get the idea:
use strict;
use warnings;
my $carac_available = 'eo';
my $carac_notavailable = 'hydngp';
my $dico_txt = q{
doing
close
sunny
drugs
mouve
botts
};
my ($ca, $cn) = ($carac_available, $carac_notavailable);
open (FH, '<', \$dico_txt) or die("Oops:$!\n");
while (my $line = <FH>) {
next unless $line =~ m/(\w+)/;
my ($word) = ($1);
if (length($ca) == scalar(map $word =~ m/$_/, split //,
$ca)) {
unless ($word =~ m/[$cn]/) {
print "$word\n";
}
}
}
close (FH);
------------------------------
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 9679
***************************************