[25626] in Perl-Users-Digest
Perl-Users Digest, Issue: 7868 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 9 00:05:45 2005
Date: Tue, 8 Mar 2005 21:05:14 -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 Tue, 8 Mar 2005 Volume: 10 Number: 7868
Today's topics:
Advice for moving linux script to MacPerl ecurts@neo.rr.com
Re: cperl-mode and emacs-21.4 brocken? <nospam-abuse@ilyaz.org>
goto& destroying @_ - Problem finally replicated <not@invalid.invalid>
Re: How Perl Saved Planet Earth <jwkenne@attglobal.net>
Re: infinite loop (newbie) <wyzelli@yahoo.com>
Re: infinite loop (newbie) <tadmc@augustmail.com>
Module for getting values from "flattened" hash or "rec newsbot@cox.net
Re: Module for getting values from "flattened" hash or <pilkowsk@informatik.uni-marburg.de>
Re: negative backreference? <nospam-abuse@ilyaz.org>
Re: perl 5.8.5 segfaults on patternmatch <abigail@abigail.nl>
Re: perlpod/perldoc Q: I want asterisk bullets <abigail@abigail.nl>
Re: perlpod/perldoc Q: I want asterisk bullets <jkrugman345@yahbitoo.com>
Re: perlpod/perldoc Q: I want asterisk bullets <jkrugman345@yahbitoo.com>
Re: Praesideo: Latin for 'to watch over' <invinity@nvinity.net>
Re: Praesideo: Latin for 'to watch over' <tadmc@augustmail.com>
Re: Praesideo: Latin for 'to watch over' <postmaster@castleamber.com>
Python docs [was: function with a state] <xah@xahlee.org>
Re: use a hash from a module within a main program with nospam@geniegate.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Mar 2005 18:20:53 -0800
From: ecurts@neo.rr.com
Subject: Advice for moving linux script to MacPerl
Message-Id: <1110334853.242722.30470@o13g2000cwo.googlegroups.com>
Greetings!
I work for a public school where I have written a web-based CGI program
in perl that runs on our Linux web server. Another school would like
to use this program as well, but they have an OS9 server with
AppleShare IP. I have experience with Linux and Win2000/2003 but not
with OS9. Here is what I have done so far to help them, and the
problems I am having:
- I told them to download and install MacPerl, which they did.
- I then sent them a sample script to try out. It is a simple perl
script (printev.cgi) that prints the environment variables. I changed
the 'shebang' to fit the MacPerl syntax and used my text editor to save
the file in Mac format (to have the proper end of line character). The
script looks like this:
#!perl -w
print "Content-type: text/html\n\n";
print "<tt>\n";
foreach $key (sort keys(%ENV)) {
print "$key = $ENV{$key}<p>";
}
- Next I had them put the file in a web-accessible folder.
- Then I entered the URL for the file in my browser.
Here's where the problems started. The file did not get processed by
perl, but rather simply displayed in code format in the browser. The
server did not know what to do with the file, so it just displayed it
as text.
So here's what I did next:
- I had their tech guy start up MacPerl on the server, then open my
script file in MacPerl, then do a "Save As" and save the file in the
format "CGI Script".
- When looking at the new file it appears that MacPerl put a binary
"wrapper" around the original text file.
- He replaced the old script with this new file.
- I opened the URL in my browser and perl processed the file perfectly
this time.
So here's my question... Is this what you have to do to get perl
scripts to run on an OS9 server with AppleShare IP? If so then here's
the problem: My entire program is over 100 individual scripts. Will
their tech guy have to open each script one by one and resave in "CGI
Script" format?
In my experience with Linux and Win2000/2003 a perl script is always
just a text file. There is no need for a binary wrapper to make them
run.
Shouldn't the "shebang" just tell the web server to give the file to
MacPerl for processing, and allow me to send them all 100+ scripts as
simple text files (of course with the proper Mac end of lines)?
Thanks in advance for any help with this! I am sorry for my lack of
Mac knowledge and look forward to being enlightened.
Eric
------------------------------
Date: Wed, 9 Mar 2005 04:12:18 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <d0lt32$20s3$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
David Combs
<dkcombs@panix.com>], who wrote in article <d0ghb3$4pa$1@reader1.panix.com>:
Thanks for your advices on how I should/could lean on FSF...
> Ilya -- being as cperl-mode is ***YOUR*** code (even if not "legally",
> due to gnu-license?), you REQUIRE that they do the above.
Maybe I'm getting tired too quick now? ;-) Anyway, I'm very grateful
that now (after 10 years of bitching) "End" key does by default what
it should have done from the beginning. Now if Emacs would reliably
work with 8-bit input, I may even upgrade from the version 19.33 I'm
running now. ;-) ;-)
> (also, doesn't the gnu/fsf-"license" *require* that they
> do this revealing of how to get the original, ie yours?)
Interesting question. I do not recollect anything like this;
I would not be surprised if I'm the only person who is ready to stand
to the pressure and do not make the package "conform". ("Conformance"
is very useful in some modes of deployment; but it is not
*universally* better...)
> (and much! thanks, from us all, for creating cperl-mode!)
Actually, I did not create it; when I started it was in a reasonable
shape already (similar to what other good Emacs packages are ;-). And
a lot of thanks to everybody how helped me to improve it to the
current state!
Yours,
Ilya
------------------------------
Date: Wed, 09 Mar 2005 12:27:54 +1000
From: Matthew Braid <not@invalid.invalid>
Subject: goto& destroying @_ - Problem finally replicated
Message-Id: <d0lmvb$2j37$1@bunyip2.cc.uq.edu.au>
Hi all,
I previously posted a problem I was having with using chained goto's
(message ID <d08qqe$172u$1@bunyip2.cc.uq.edu.au>) and getting segfaults.
I'm reposting because I've _finally_ managed to reproduce the segfault.
To recap: I'm using a plugin system that basically works by having
packages dynamically loaded that either replace or update functions
inside standard (to the system) library packages. A custom import
function for these library packages ensures that once an extension is
loaded the changes it makes are noticed even inside packages that
imported the library functions _before_ the extension was loaded. See
the 'import' function of the Core.pm package below for info there.
In order to make sure the call stack could support 'infinite'
extensions, I was using goto& where possible for extensions that add
some functionality but still result in the core function being called, eg:
package Extension;
require Core;
sub action {
do_something_new();
goto &Core::action;
}
The following code demostrates the structure _and_ the problem I ran into:
### Core package - library code that gets overridden by extensions
package Core;
use strict;
use warnings;
use base qw/Exporter/;
use vars qw/@EXPORT_OK/;
BEGIN { @EXPORT_OK = qw(action) }
sub import {
my $class = shift;
my @funcs = @_;
my ($caller) = caller;
no strict 'refs';
for my $func (@funcs) {
*{"$caller\::$func"} = sub { goto &{"$class\::$func"} };
}
return 1;
}
sub action {
my ($hash) = @_;
print "Core: GOT HASH OF KEYS '", join("', '", keys %$hash), "'\n";
}
1;
__END__
### Extension 1 - simple do something extra then run original code
package Ext1;
use strict;
use warnings;
BEGIN {
require Core;
{
my $oldact = \&Core::action;
sub action {
my ($hash) = @_;
print "EXT1: GOT HASH KEYS '", join("', '", keys %$hash), "'\n";
goto &$oldact;
}
}
*Core::action = \&action;
}
1;
__END__
#### Extension 2 - similar to extension 1, overrides extension 1
package Ext2;
use strict;
use warnings;
BEGIN {
require Core;
require Ext1;
*Core::action = \&action;
}
sub action {
my ($hash) = @_;
print "Ext2: GOT HASH KEYS '", join("', '", keys %$hash), "\n";
goto &Ext1::action;
}
1;
__END__
### Extension 3 - Overrides extension 2, and changes @_ before the goto
package Ext3;
use strict;
use warnings;
BEGIN {
require Core;
require Ext2;
*Core::action = \&action;
}
sub action {
my ($hash) = @_;
print "Ext3: GOT HASH KEYS '", join("', '", keys %$hash), "'\n";
my $fake = {%$hash, New => 5};
print("Ext3: NEW HASH BUILT - KEYS '", join("', '", keys %$fake),
"'\n");
@_ = ($fake); ### REMEMBER THIS LINE!
goto &Ext2::action;
}
1;
__END__
### Extension X - changes @_ like extension 3, but is not an 'extension
### of an extension'
package ExtX;
use strict;
use warnings;
BEGIN {
require Core;
{
my $oldact = \&Core::action;
sub action {
my ($hash) = @_;
print "EXTX: GOT HASH KEYS '", join("', '", keys %$hash), "'\n";
my $fake = {%$hash, New => 5};
print("EXTX: NEW HASH BUILT - KEYS '", join("', '", keys %$fake),
"'\n");
@_ = ($fake);
goto &$oldact;
}
}
*Core::action = \&action;
}
1;
__END__
### test.pl script to demonstrate problem - acts like main script of
### override system
use lib '.';
use strict;
use warnings;
use Core qw(action);
for my $ext (@ARGV) { # Load extensions
eval "require $ext";
die "eval failed: $@" if $@;
}
$| = 1;
my $hash = {This => 1, That => 2, TheOther => 3};
action($hash);
exit;
### END CODE
Now, once all the packages are in place if you run:
$ perl test.pl ExtX
Subroutine Core::action redefined at ExtX.pm line 18.
EXTX: GOT HASH KEYS 'That', 'TheOther', 'This'
EXTX: NEW HASH BUILT - KEYS 'New', 'That', 'This', 'TheOther'
Core: GOT HASH OF KEYS 'New', 'That', 'This', 'TheOther'
All well and good - the goto worked, and it handled the @_ = ($fake)
well. Now we try the more complex version - Ext3:
$ perl test.pl Ext3
Subroutine Core::action redefined at Ext1.pm line 15.
Subroutine Core::action redefined at Ext2.pm line 8.
Subroutine Core::action redefined at Ext3.pm line 8.
Ext3: GOT HASH KEYS 'That', 'TheOther', 'This'
Ext3: NEW HASH BUILT - KEYS 'New', 'That', 'TheOther', 'This'
Ext2: GOT HASH KEYS 'New', 'That', 'This', 'TheOther
Segmentation fault (core dumped)
Ouch. Oddly enough this is not _quite_ what I was seeing in the full
code (@_ for Ext2 was full of some kind of faulty undef values), but it
has the same effect.
If you go back in to package Ext3.pm and remove the line marked
'REMEMBER THIS LINE', the output becomes:
$ perl test.pl Ext3
Subroutine Core::action redefined at Ext1.pm line 15.
Subroutine Core::action redefined at Ext2.pm line 8.
Subroutine Core::action redefined at Ext3.pm line 8.
Ext3: GOT HASH KEYS 'That', 'TheOther', 'This'
Ext3: NEW HASH BUILT - KEYS 'That', 'TheOther', 'This'
Ext2: GOT HASH KEYS 'That', 'TheOther', 'This
EXT1: GOT HASH KEYS 'That', 'TheOther', 'This'
Core: GOT HASH OF KEYS 'That', 'TheOther', 'This'
Hmm, no core dump this time...? Of course the desired functionality is gone.
So it seems there is someting wrong with goto that involves depth of
chained goto's (ExtX working while Ext3 not suggests this) and assigning
to @_.
Phew. Now I have to return to work. Hopefully this is enough info for
someone to work out the underlying problem :)
MB
------------------------------
Date: Tue, 08 Mar 2005 18:38:09 -0500
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: How Perl Saved Planet Earth
Message-Id: <2OqXd.12795$rL7.11367@fe11.lga>
dave@subcreations.com wrote:
> The year is 2525. Anyone who even utters the word "evolution" is
> immediately annihilated.
Must be rough on drillmasters and choreographers....
---
John W. Kennedy
"Those in the seat of power oft forget their failings and seek only the
obeisance of others! Thus is bad government born! Hold in your heart
that you and the people are one, human beings all, and good government
shall arise of its own accord! Such is the path of virtue!"
-- Kazuo Koike. "Lone Wolf and Cub: Thirteen Strings" (tr. Dana Lewis)
------------------------------
Date: Tue, 08 Mar 2005 23:20:56 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: infinite loop (newbie)
Message-Id: <srqXd.189958$K7.182457@news-server.bigpond.net.au>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:396ne7F5ummo4U1@individual.net...
: Peter Wyzl wrote:
: > "usaims" wrote:
: >>
: >> for (my $x = $array[0];$x <= $array[8]; $array[0]++)
: >
: > BTW, that is not an infinite loop....
:
: Did you run it?
No, my bad... missed the declaration problem...
Infinite loop by accident (not really a syntax error)
P
--
print "Just another Perl Hacker";
------------------------------
Date: Tue, 8 Mar 2005 20:13:15 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: infinite loop (newbie)
Message-Id: <slrnd2smtr.8kk.tadmc@magna.augustmail.com>
Peter Wyzl <wyzelli@yahoo.com> wrote:
> "Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
> news:396ne7F5ummo4U1@individual.net...
>: Peter Wyzl wrote:
>: > "usaims" wrote:
>: >>
>: >> for (my $x = $array[0];$x <= $array[8]; $array[0]++)
>: >
>: > BTW, that is not an infinite loop....
>:
>: Did you run it?
>
> No, my bad... missed the declaration problem...
What declaration problem?
> Infinite loop by accident (not really a syntax error)
Of course it is not a syntax error.
You can't get an infinite loop if the program won't even compile...
It is a _semantic_ error.
Syntax is trivial, so trivial that a machine can spot it.
It is the semantic errors that require examination by a sentient being.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Mar 2005 18:05:15 -0800
From: newsbot@cox.net
Subject: Module for getting values from "flattened" hash or "recursed" hash...?
Message-Id: <1110333915.406537.96580@o13g2000cwo.googlegroups.com>
I've search high and low in CPAN for a hash module to do the following,
as I describe here. With all the MANY hash modules out there, it's
hard to believe someone hasn't written at least something similar.
Given the following sample hash (reference(s)):
$h = {
'group1' => {
'green' => 'This is green',
'blue' => 'This is blue',
'gray' => {
'orange' => {
'pink' => 'This is gray-orange-pink (yuk!)',
'black' => 'This is gray-orange-black (eh...)'
},
'red' => 'This is gray-red',
'label' => 'This is a gray label',
'yellow' => 'This is gray-yellow'
},
'red' => 'This is red'
}
};
If I say "$rv = giveme( $h, 'green' );" where "giveme()" is some
hypothetical function, then I want $rv to receive "This is green". If
I say "($a,$b,$c) = giveme( $h, 'blue', 'pink', 'red' );" then I want
to receive "This is blue", "This is gray-orange-pink", and "This is
red" in return.
Notice that for "red", the {group1}->{red} takes precedence over the
{group1}->{gray}->{red}. The return context of scalar versus array
isn't as important -- I merely illustrate this way for sake of brevity
since "giveme()" is hypothetical -- the subject of my posting. Also,
the return of {group1}->{gray} is undefined, as is
{group1}->{gray}->{orange}, etc.
The Tie::Proxy::Hash and Tie::Flatten modules are *close* to what I
want, but aren't exact. I could use either or both of them to perhaps
"massage" what I want, but I'd rather just write it myself if it
doesn't exist as above.
In the application which requires this functionality, I can virtually
guarantee that keys in the hash "tree" will be unique -- which lends
itself to a "flatten" namespace. But not always as in the case of
"red" above where {group1}->{red} takes precedence.
If anyone knows of a module to do this, I'd appreciate hearing about
it. I've searched Google and CPAN high and low...
-ceo
------------------------------
Date: Wed, 9 Mar 2005 05:36:54 +0100
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Module for getting values from "flattened" hash or "recursed" hash...?
Message-Id: <MPG.1c989bc786e91eb19898c5@news.individual.de>
* newsbot@cox.net wrote:
>
> Given the following sample hash (reference(s)):
>
> $h = {
> 'group1' => {
> 'green' => 'This is green',
> 'blue' => 'This is blue',
> 'gray' => {
> 'orange' => {
> 'pink' => 'This is gray-orange-pink (yuk!)',
> 'black' => 'This is gray-orange-black (eh...)'
> },
> 'red' => 'This is gray-red',
> 'label' => 'This is a gray label',
> 'yellow' => 'This is gray-yellow'
> },
> 'red' => 'This is red'
> }
> };
>
> If I say "$rv = giveme( $h, 'green' );" where "giveme()" is some
> hypothetical function, then I want $rv to receive "This is green". If
> I say "($a,$b,$c) = giveme( $h, 'blue', 'pink', 'red' );" then I want
> to receive "This is blue", "This is gray-orange-pink", and "This is
> red" in return.
>
> Notice that for "red", the {group1}->{red} takes precedence over the
> {group1}->{gray}->{red}.
But if your hash looks like
$h = {
'green' => { 'blue' => 'this is turquoise' }
'red' => { 'blue' => 'this is lilac' }
}
which 'blue' you're expecting, the greenish or the reddish one? ;-)
>
> The return context of scalar versus array
> isn't as important -- I merely illustrate this way for sake of brevity
> since "giveme()" is hypothetical -- the subject of my posting. Also,
> the return of {group1}->{gray} is undefined, as is
> {group1}->{gray}->{orange}, etc.
What you really want is a simple postorder traversal for your hash to
search for the given colors. I haven't looked at CPAN yet if there's
such a modul for traversing hashes, but with a stack for pushing your
sub-hashes onto, your sub could look like:
sub giveme {
my @stack = shift;
my %color;
while ( @stack ) {
my( $key, $value ) = each %{$stack[0]}
or shift( @stack ), next;
ref( $value ) eq 'HASH'
and push( @stack, $value ), next;
$color{$key} ||= $value;
}
return @color{ @_ };
}
regards,
fabian
------------------------------
Date: Wed, 9 Mar 2005 04:02:19 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: negative backreference?
Message-Id: <d0lsgb$20n0$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>], who wrote in article <d0c48i$39r$1@mamenchi.zrz.TU-Berlin.DE>:
> > (mutatis mutandis). Having different match than \w+ will lead so more
> > complicated stuff than \b... In perfect life, one would use something
> > like my (proposed) onion rings:
> >
> > /rdns=(\S*) helo=(?& \S* & (?!\1)/;
/rdns=(\S*) helo=(?& \S* & (?!\1))/
maybe even
/rdns=(\S*) helo=(?& \S* &! \1)/
> Is that proposal available somewhere?
I think so. google for it...
> I'm not sure how "(?&" is supposed to work.
A & B & C & D ...
B should match a substring of what A matched, C should match a
substring of what B matched etc... One can replace & by &! (negating
the following group). Actually, another, "anchored", flavor is useful
in other situations: one where B should match *exactly* the string
which A matched (and not a substring thereof). [example above uses
the second flavor]
It was never clear to me how to distinguish these two flavors; maybe
something as simple as && vs &...
> Should the parens balance?
Sure, thanks.
Yours,
Ilya
------------------------------
Date: 09 Mar 2005 00:17:26 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: perl 5.8.5 segfaults on patternmatch
Message-Id: <slrnd2sg4m.v9v.abigail@alexandra.abigail.nl>
peter pilsl (pilsl@goldfisch.at) wrote on MMMMCCVII September MCMXCIII in
<URL:news:422e02df$1@e-post.inode.at>:
}}
}} I recently discovered segfaulting of perl 5.8.5 doing many
}} patternmatches like /abc.*$/ and /^.*abc/ on a big datastructure.
}}
}} I seem to able to avoid the problem by using the more accurate
}} searchpatterns /abc.*/ and /.*abc/ instead, but I generally wonder what
}} to do with a segfaulting perl ?
}}
}} I tried to create a very short script demonstrating the problem, but
}} could not. The shortest version of my tool is still about 100 lines of
}} code and the inputfile (a stored hash) is about 1M. Does it make any
}} sense to upload the script, the inputfile and the coredump somewhere to
}} let anyone peek into it or is it just a bug and I should be happy to
}} have found a way around it?
It *could* be a bug - perl shouldn't segfault unless it hits some limits.
I've recently found Perl segfaulting on when doing a match on a <5k string
due to a stack depth limit. It's questionable whether this is a bug or not -
it's unavoidable to hit the limit, but it's hitting the limit on strings
an eigth the size that makes Perl 5.000 hit the limit.
But I can't say whether your program is hit by the same problem. Considering
you need 100 lines to get bitten, probably not (the one I'm referring too
can be triggered by a simple one-liner). You could post the 100 line program,
but I'm afraid not many people are willing to digest a 100 line program
to find out what triggers the bug.
Abigail
--
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_;
sub _ {push @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_ and goto &{+shift}}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20050309
------------------------------
Date: 09 Mar 2005 00:19:41 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: perlpod/perldoc Q: I want asterisk bullets
Message-Id: <slrnd2sg8t.v9v.abigail@alexandra.abigail.nl>
J Krugman (jkrugman345@yahbitoo.com) wrote on MMMMCCVII September
MCMXCIII in <URL:news:d0kand$f5q$1@reader1.panix.com>:
:)
:)
:)
:) I'm writing a POD page, and I want my itemized lists to use asterisks
:) for bullets, like this:
:)
:) * first item
:)
:) * second item
:)
:) * etc., etc.
:)
:) So I write my POD source like this:
:)
:) =over
:)
:) =item *
:)
:) first item
:)
:) =item *
:)
:) second item
:)
:) =item *
:)
:) etc., etc.
:)
:) =back
:)
:) But, when I run perldoc on my POD file, what I see on the screen is
:)
:) o first item
:)
:) o second
:)
:) o etc., etc.
:)
:) What's really annoying is that all the other POD pages installed
:) on my system (e.g. perlpod.pod) use the exact same POD source code
:) (i.e. "=item *", etc.) as what I'm using, and yet when these other
:) pages are displayed, the lists have asterisks, not o's for bullets.
It might help to tell us what pod translator you used (pod2man, pod2text,
pod2html, something else), what version of the tool you used, what version
of Perl you used, and to gives us a small POD sample that exhibits the
same problem.
Abigail
--
END {print "Hacker\n"}
CHECK {print "another "}
BEGIN {print "Just " }
INIT {print "Perl " }
------------------------------
Date: Wed, 9 Mar 2005 03:55:56 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: Re: perlpod/perldoc Q: I want asterisk bullets
Message-Id: <d0ls4c$cum$1@reader1.panix.com>
In <slrnd2sg8t.v9v.abigail@alexandra.abigail.nl> Abigail <abigail@abigail.nl> writes:
>J Krugman (jkrugman345@yahbitoo.com) wrote on MMMMCCVII September
>MCMXCIII in <URL:news:d0kand$f5q$1@reader1.panix.com>:
>:)
>:)
>:)
>:) I'm writing a POD page, and I want my itemized lists to use asterisks
>:) for bullets, like this:
>:)
>:) * first item
>:)
>:) * second item
>:)
>:) * etc., etc.
>:)
>:) So I write my POD source like this:
>:)
>:) =over
>:)
>:) =item *
>:)
>:) first item
>:)
>:) =item *
>:)
>:) second item
>:)
>:) =item *
>:)
>:) etc., etc.
>:)
>:) =back
>:)
>:) But, when I run perldoc on my POD file, what I see on the screen is
>:)
>:) o first item
>:)
>:) o second
>:)
>:) o etc., etc.
>:)
>:) What's really annoying is that all the other POD pages installed
>:) on my system (e.g. perlpod.pod) use the exact same POD source code
>:) (i.e. "=item *", etc.) as what I'm using, and yet when these other
>:) pages are displayed, the lists have asterisks, not o's for bullets.
>It might help to tell us what pod translator you used (pod2man, pod2text,
>pod2html, something else), what version of the tool you used, what version
>of Perl you used, and to gives us a small POD sample that exhibits the
>same problem.
I used the perldoc executable that came with perl v5.8.4, as in
% perldoc readme.pod
The perl used is v5.8.4. As for an example, what I already posted
is pretty much it. On the screen it looks like this:
README(1) User Contributed Perl Documentation README(1)
o first item
o second item
o etc., etc.
perl v5.8.4 2005-03-08 README(1)
What's puzzling me is that when I use the same programs (perl/perldoc
v5.8.4) to display a pod file (e.g. the perlpod.pod file included
in the Perl distribution) that uses the exact same directives for
its bullets as I use, the displayed bullets are asterisks, not o's.
I need to play some more with this to pinpoint the problem more
precisely.
jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
------------------------------
Date: Wed, 9 Mar 2005 04:08:45 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: Re: perlpod/perldoc Q: I want asterisk bullets
Message-Id: <d0lssd$fjj$1@reader1.panix.com>
OK, here's an example that exhibits some annoying behavior:
=over
=item *
whatever:
=over
=item *
first item
=item *
second item
=item *
etc., etc.
=back
=back
It looks like this when displayed using perl/perldoc v5.8.4:
TEST(1) User Contributed Perl Documentation TEST(1)
o whatever:
o first item
o second item
o etc., etc.
perl v5.8.4 2005-03-08 TEST(1)
If I change the very first =item line in the source to
=item ?
where ? stands for anything other than *, the outer bullet is
rendered as ? (whatever it is) and the inner bullets are rendered
as *'s. But I have not found the incantation to render all bullets
as *'s.
jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
------------------------------
Date: 8 Mar 2005 16:22:04 -0800
From: "invinity" <invinity@nvinity.net>
Subject: Re: Praesideo: Latin for 'to watch over'
Message-Id: <1110327724.528141.46810@l41g2000cwc.googlegroups.com>
John,
Yeah I thought about that. I was just hoping that noone else would say
anything :-). I actually put the translation in the subject to draw
people in... I was trying to 'sell' my post.
Do you think it would be better to stick with the current namespace
"Server::ApacheIVHost"? Or maybe just "ApacheIVHost"?
Thanks for the input
Matt
------------------------------
Date: Tue, 8 Mar 2005 20:07:33 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Praesideo: Latin for 'to watch over'
Message-Id: <slrnd2smj5.8kk.tadmc@magna.augustmail.com>
invinity <invinity@nvinity.net> wrote:
> Yeah I thought about that.
What that is that that?
It is customary to quote some context when composing a followup.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Mar 2005 02:42:50 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Praesideo: Latin for 'to watch over'
Message-Id: <Xns9613D2B666BA4castleamber@130.133.1.4>
invinity wrote:
> John,
>
> Yeah I thought about that. I was just hoping that noone else would say
> anything :-). I actually put the translation in the subject to draw
> people in... I was trying to 'sell' my post.
>
> Do you think it would be better to stick with the current namespace
> "Server::ApacheIVHost"? Or maybe just "ApacheIVHost"?
"I am currently writing a module that is designed to automate the
startup and management of Apache processes. In addition, the module is
designed to provide a VirtualHost-like environment, but with a
dedicated Apache process for each host, all on a single IP address."
Something like:
Apache::ProcessManager ?
or even:
Apache::Manager
Apache::Manager::Process for a single process?
I have no idea how the virtualisation exactly works, but maybe:
my $process = new Apache::Manager::Process;
my $manager = new Apache::Manager;
$manager->manage( $process );
$process->virtualize( port => 8080 );
$process->start;
:
:
$process->kill;
I know, giving things a name is hard. I have been refactoring my pet
project too often :-D
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 8 Mar 2005 17:07:31 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: Python docs [was: function with a state]
Message-Id: <1110330451.100511.179530@o13g2000cwo.googlegroups.com>
thanks for the help...
-------
the python doc is stilted. It tried to organized the thing and with a
style around some highbrow inane "computer science" outlook.
i found the little section on global
(http://python.org/doc/2.4/ref/global.html)
and can't make out what shit it is trying to say without having read
and figured out the entire doc of its style and contexts and
definitions. (formalization varies and computing model and jargons mean
different things.)
Python doc writers needs to re-organize and re-style their docs so that
its organization is towards programing, as opposed to how the
implementation works (as in the Lib Reference), or a formalization of
the language spec. (e.g. the fucking semi-joke of "(for language
lawyers)" and BNF and those Runtime "Service" shits.) Its style
needs to shift from highbrowism to pragmatic and exemplary.
I've addressed some of the jargon-riding ills common in industry with
examples from the Python doc, archived here:
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
as to the way of its stiltedenss and academicism, which make it hard
for programers to find or apply any info, i'll expound later.
PS just so that there is no misunderstanding: The docs of unix and
Perl, are fucking criminally incompetent. Python docs, although stilted
in a academic way, but nevertheless is solid, and its writers are
educated, and tried best to make it a quality one, albeit sometimes
inevitably showed some masterbation and jargonization. While the unix
and Perl docs, (and essentially all things out of unix, e.g. Apache
docs), are fucking incompetent drivels and in many cases exorbitant
lies, and they semi-present it as humor and want and brainwash people
to take them as norm. In a nutshell, these people are spreading
untruths and indirectly are causing massive harm in the computing
industry. People, we need to stop it. This each of us can do by not
accepting their attitudes or behavior. In online forums, work place,
conventions, conversations etc., raise questions or otherwise voice
your opinion whenever you can.
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: Wed, 09 Mar 2005 04:56:38 GMT
From: nospam@geniegate.com
Subject: Re: use a hash from a module within a main program without passing by reference or value
Message-Id: <Lucy111023096926590x6a43a0@air.tunestar.net>
In: <d0i7mp$56d$1@beech.fernuni-hagen.de>, "Sebastian Marants" <semura@gmx.de> wrote:
>Hello,
>
>i have a module and my program that uses it.
>i want to use the hash which is only declared
>in my module within the main program.
>I want the output to be
>one
>two
>two
>one
>
>but it prints nothing
>anyone can help me out and teach me the
>scope of variables when using modules?
>in other words: how can i make %MYCOOLHASH
>available in test.pl without passing it by reference
>or value.
Well... as everyone else pointed out, don't. :-)
If we're going to do it anyway, you could use Exporter to export the symbol
into the callers name space. Don't bother with @EXPORT_OK, just go ahead and
cram it into the callers namespace if pollution is the goal.
If we're going to do ticky-tacky things, we could use a glob to create an
'alias' (well sort of):
local(*bogus) = \%mycoolmodule::MYCOOLHASH;
$bogus{test1} = "puke";
Or, you could access it from anywhere by simply accessing it:
$mycoolmodule::MYCOOLHASH{test1} = 'home invader!';
I actually perfer this for global variables, since it makes clear what we're
doing w/out actually contaminating other name spaces. (Some folks might
disagree with me) of course, accessors and all that stuff are better, but if
you have a real reason for getting at the global variable, absolute addressing
works. (has the disadvantage that if you rename your module, you're kind of
screwed)
Finally, have a look at perltie, 'mycoolmodule' (might I suggest camel caps to
distinguish it from perl pragma's?)
In essence, with tie, your module can *be* the hash. This is how the DBM's do
it. You get to treat it like a hash, but you get the setter/getter pattern.
In your case, using a static global variable, a tied hash will provide hours of
entertainment to anyone trying to figure out why setting the value of one hash
impacts any other tied hashes they may have.
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
------------------------------
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 7868
***************************************