[12433] in Perl-Users-Digest
Perl-Users Digest, Issue: 6033 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 17 15:07:16 1999
Date: Thu, 17 Jun 99 12:00:33 -0700
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, 17 Jun 1999 Volume: 8 Number: 6033
Today's topics:
Re: a thread on threads (the skinny on the schedule) <dgris@moiraine.dimensional.com>
Re: a thread on threads (the skinny on the schedule) <tchrist@mox.perl.com>
Re: a thread on threads (the skinny on the schedule) <gbartels@xli.com>
Re: a thread on threads (the skinny on the schedule) <gbartels@xli.com>
Re: a thread on threads (the skinny on the schedule) <tchrist@mox.perl.com>
Re: a thread on threads (the skinny on the schedule) <emschwar@rmi.net>
Re: Afraid to ask about Y2K! <keithmur@mindspring.com>
Re: Afraid to ask about Y2K! <keithmur@mindspring.com>
Re: Afraid to ask about Y2K! <emschwar@rmi.net>
Re: blank row in array <dave@dave.org.uk>
Re: cgi query error <rootbeer@redcat.com>
Re: Clear screen function in Perl? <kimntodd@dontspamus.execpc.com>
configuring pop3 host for net::pop3 <hojo@i-tel.com>
Re: date formats (Lee)
Re: exporting a hash from a module (Andrew Allen)
Re: exporting a hash from a module <rootbeer@redcat.com>
help! pattern matching question loertly@uu.net
Re: How do I jump from one web page to another? <rootbeer@redcat.com>
Re: How to do binary number calculations? (brian d foy)
Re: How to extract emails from Outlock Express <founder@pege.org>
image counter with perl <moelter@legion.de>
Re: image counter with perl <rootbeer@redcat.com>
Re: Inclusive Split <rootbeer@redcat.com>
matinal musings and the madrugada <tchrist@mox.perl.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jun 1999 11:02:31 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <m3zp1ypxp4.fsf@moiraine.dimensional.com>
Greg Bartels <gbartels@xli.com> writes:
> perl 5.006
> should be available end of '99
> performance estimate: 85% to 90%
>
> does anyone contest these numbers to being
> significantly off-base?
No offense to Dan, who's worked very hard on making threads
and perl work, but I'll be very surprised if those numbers
are achievable.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 17 Jun 1999 11:19:52 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <37692e38@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Greg Bartels <gbartels@xli.com> writes:
:Current perl threads:
:(speed compared with unthreaded perl)
:worst case: 48%
Remember that that means that unthreaded perl runs more
than twice as fast as the threaded one does in that case.
--tom
--
I hope to get Perl 5 out this summer, for certain values of summer.
-- <1993Jun5.052825.3897@netlabs.com>
------------------------------
Date: Thu, 17 Jun 1999 12:47:18 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <37692696.6D420B39@xli.com>
Daniel Grisinger wrote:
>
> No offense to Dan, who's worked very hard on making threads
> and perl work, but I'll be very surprised if those numbers
> are achievable.
he said he had the patch that gives the next thread speedup.
the one scheduled to come out with 5.005_04 in a month or so.
which he put at 73% to 85% speed compared with unthreaded
perl. ie. threaded perl will be 15% to 27% slower than
unthreaded perl. its still slower, but its a respectable
improvement over the current 52% speed degradation.
I dont have the permissions to install it here at work,
but it seems that "independent observers" could at least
confirm that he isnt pulling numbers out of the air.
anyone willing to do a benchmark with the patch?
Greg
------------------------------
Date: Thu, 17 Jun 1999 13:06:54 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <37692B2E.9E6D19FD@xli.com>
Tom Christiansen wrote:
> Remember that that means that unthreaded perl runs more
> than twice as fast as the threaded one does in that case.
assuming, for the moment, that a near future release of
threads has a performance hit deemed acceptable, is
there any reason not to use threads?
I should probably look at fork() and IPC::Sharable
to see what it would take to make processes with all
teh data shared. an ideal benchmark for my appliation
would compare N threads with Q shared variables
versus N forked processes with Q IPC::shared variables.
but other than a speed hit, which we assume for the
moment is good enough to be acceptable, I dont
see any reason not to use threads.
are there other problems with threads?
Greg
------------------------------
Date: 17 Jun 1999 12:25:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <37693d7e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, Greg Bartels <gbartels@xli.com> writes:
:assuming, for the moment, that a near future release of
:threads has a performance hit deemed acceptable, is
:there any reason not to use threads?
It's highly unclear how they light-weight processes (threads) interact
with process-oriented features, such as signals. It's also a lot easier
to debug without LWP.
Real story: I know one large software company whose MS-damaged manager
ordained that a project use for multitasking LWP not real processes.
That project was very behind schedule and full of bugs as multiple PCs
went shooting off random pointers into a shared address space. It's like
living in the old Apple and Microsoft idiot-based non-access controlled
"operating systems". So this company zapped the dumb manager, ripped
out the LWP, rewrote it as cooperating processes, and everything got
done much more cleanly.
There aren't many systems I would like to run without careful memory
protection -- which is what LWP is often like. The only difference is
that with LWP, memory access is dangerous, and with standard processes,
it isn't. processes, communication is well-defined.
Also, the LW part of LWP is definitely overvalued these days. Linux
"threads" are still faster than NT "processes". Go figure. Ever heard
of NT fibers? Sigh.
:I should probably look at fork() and IPC::Sharable
:to see what it would take to make processes with all
:teh data shared. an ideal benchmark for my appliation
:would compare N threads with Q shared variables
:versus N forked processes with Q IPC::shared variables.
That's a good idea, and I've done that test, but in fact,
it may not be the best model. Consider pipes. Sometimes,
that's enough. See below.
That doesn't mean threads have no use. I certainly don't wish to
imply that. But anybody who doens't understand forks, select, signals,
semaphores, locking, deadlocks, access protocols, and shared memory should
stay far, far away. Handing a script kiddie threads is like handing a
six-year old an Uzi. Tools and features that may well be useful in the
hands of a professional can be suicide in the hands of an amateur.
--tom "whose address space do you want to violate today" christiansen
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1999-06-17 12:24 MDT by <tchrist@jhereg.perl.com>.
# Source directory was `/home/tchrist'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", "mkdir", and "sed" may be needed.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 1398 -rw-r--r-- prime-fork
# 733 -rw-r--r-- prime-thread
#
echo=echo
if mkdir _sh09551; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= prime-fork ==============
if test -f 'prime-fork' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'prime-fork' '(file already exists)'
else
shar: Saving prime-fork (text)
$echo 'x -' extracting 'prime-fork' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'prime-fork' &&
X#!/usr/bin/perl
X# prime-fork - demo silly prime number finder
X# using forks.
X
Xsub forksub(&);
X
Xuse strict;
Xmain();
Xexit;
X
Xsub main {
X my($head,$tail) = queue();
X my $kid = forksub {
X close($tail);
X check_num($head, 2)
X };
X close $head;
X for (my $i = 3; $i <= 1000; $i++) {
X enqueue($tail, $i);
X }
X close $tail;
X waitpid($kid,0);
X}
X
X
Xsub check_num {
X my ($stream, $cur_prime) = @_;
X my ($spawned, $num);
X
X my($head, $tail) = queue();
X
X while ($num = dequeue($stream) ) {
X next unless $num % $cur_prime;
X if ($spawned) {
X enqueue($tail, $num);
X next;
X }
X print "Found prime $num\n";
X $spawned = forksub {
X close($tail);
X check_num($head, $num)
X };
X close $head;
X }
X close($head) unless $spawned;
X close($tail);
X waitpid($spawned,0) if $spawned;
X exit;
X}
X
Xsub forksub(&) {
X my $coderef = $_[0];
X my $pid = fork();
X die "cannot fork: $!" unless defined $pid;
X return $pid if $pid;
X goto &$coderef; # don't need no stinkin' stack frames
X}
X
Xsub queue {
X local(*READER, *WRITER);
X pipe(READER, WRITER) || die "can't pipe: $!";
X return (*READER, *WRITER);
X}
X
Xsub enqueue(*$) {
X my ($stream, $n) = @_;
X syswrite($stream, pack("L", $n), 4); # XXX: errno
X}
X
Xsub dequeue(*) {
X my ($stream) = @_;
X my $n;
X sysread($stream, $n, 4) == 4 || return;
X unpack("L", $n);
X}
SHAR_EOF
: || $echo 'restore of' 'prime-fork' 'failed'
fi
# ============= prime-thread ==============
if test -f 'prime-thread' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'prime-thread' '(file already exists)'
else
shar: Saving prime-thread (text)
$echo 'x -' extracting 'prime-thread' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'prime-thread' &&
X#!/usr/bin/perl
X# prime-thread - demo silly prime number finder
X# using threads. see prime-fork.
X
Xuse Thread;
Xuse Thread::Queue;
X
Xmy $stream = new Thread::Queue;
Xmy $firstborn = new Thread(\&check_num, $stream, 2);
X
Xfor my $i ( 3 .. 1000 ) {
X $stream->enqueue($i);
X}
X
X$stream->enqueue(undef);
X$firstborn->join();
X
Xsub check_num {
X my ($upstream, $cur_prime) = @_;
X my $kid;
X my $downstream = new Thread::Queue;
X while (my $num = $upstream->dequeue) {
X next unless $num % $cur_prime;
X if ($kid) {
X $downstream->enqueue($num);
X } else {
X print "Found prime $num\n";
X $kid = new Thread(\&check_num, $downstream, $num);
X }
X }
X $downstream->enqueue(undef) if $kid;
X $kid->join() if $kid;
X}
SHAR_EOF
: || $echo 'restore of' 'prime-thread' 'failed'
fi
rm -fr _sh09551
exit 0
--
I know it's weird, but it does make it easier to write poetry in perl. :-)
--Larry Wall in <7865@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 17 Jun 1999 12:58:47 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <xkfvhcmk61k.fsf@valdemar.col.hp.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> Also, the LW part of LWP is definitely overvalued these days. Linux
> "threads" are still faster than NT "processes".
Er, unless I'm reading that wrong, your second sentence is contradicting
the first. Did you switch Linux and NT there, or was there some other
point I'm being too dense right now to catch?
-=Eric
------------------------------
Date: Thu, 17 Jun 1999 13:11:50 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <37693A66.8FA3DB04@mindspring.com>
Tom Christiansen wrote:
>
[cut]
> Here's one reference:
>
> If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), hour
> is restricted to run from 1 to 12, and `:minute' may be omitted
> (taken to be zero). `am' indicates the first half of the day,
> `pm' indicates the second half of the day. In this notation, 12
> is the predecessor of 1: midnight is `12am' while noon is `12pm'.
> -> (This is the zero-oriented interpretation of `12am' and `12pm', as
> -> opposed to the old tradition derived from Latin which uses `12am'
> -> for noon and `12pm' for midnight.)
>
> The point is that twelve o'clock noon and twelve o'clock midnight properly
> pertain to neither the period ante meridian nor the one post meridian.
> I, being apparently of the old school, was taught that 12am was noon,
> whereas you, being apparently of the new one, were taught that 12am
> was midnight. But the real point here is that both these views are in
> some senses technically wrong. It's just twelve o'clock noon. Period.
> Anything else is confusing.
>
Generally speaking, I go with new school for this reason:
If I were to ask you what time it was, if you looked at your clock or
watch and said, "Twelve o'clock", if this were during the day, it would,
in a number of cases approaching infinity, be post meridian; and if it
were at night, it would be after midnight, therefore ante meridian.
This is because generally speaking people truncate to the last minute
mark when giving the time. (All this assumes a lot of other stuff also,
like "meridian" being an abstraction, not actually the position of the
sun in the sky; your clock is accurate; etc.) Therefore, in this
practical context, you would have been correct in the daytime to say
"Twelve o'clock pm" and at night to say "Twelve o'clock am".
------------------------------
Date: Thu, 17 Jun 1999 13:47:28 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <376942C0.860F1144@mindspring.com>
finsol@ts.co.nz wrote:
>
> IT departments are frequently cut-off from the rest
> of the organisation and have very little loyalty to it as IT personnel
> have very little understanding of the business issues.
How about:
"IT personnel have very little understanding of the business issues, as
IT departments are frequently cut-off from the rest of the
organization."
And whose fault would that be? Typically, other departments in an
organization want to supply as little information as possible to IT, and
learn as little as possible about how IT might relate to their
departments' functioning. I guess IT needs to use psychic powers to
understand the business issues and then guess at how they might address
the other departments' needs.
Better efforts at communication and integration need to come from *both*
sides.
Sorry for the off-topic, but I'm sensitive to this stuff, having often
seen the attitude: "You need to magically understand how you can
address our business needs, but we don't want to put forth the effort to
understand the technology in any degree, or, in fact, convey or
understand our own requirements in terms of simple logic." Or,
How many times have folks in this group tried to find out the business
requirements for a system in terms of logical, everyday English, only to
be evaded and begged off due to lack of understanding of "computerese",
"technical stuff", etc., etc.? Who doesn't understand the business
issues, if the user can't express them in terms of sequence,
cause-and-event, dependencies, etc.?
Then again, there are the folks that are too lazy to make the
distinction between a language having a Y2K problem, and the possibility
of writing programs with Y2K problems using that language. Then wonder
why they get criticism instead of constructive suggestions.
Here's the suggestion, finsol, or whoever:
grep all the damn source code to find all references to localtime.
Follow all the code that uses it to where the returned value is
translated to human-readable form. This may be quite difficult if it is
stored to a database, for instance, in the two-digit form; you could try
to find all references to that database field, but that could be really
really hard and chancy, since the name of the database field itself
could be stored in a variable. Other than that, any competent Perl
programmer should be able to easily tell if the localtime value is used
appropriately.
Now, was that obvious or what?
Sorry again, having a bad day...
------------------------------
Date: 17 Jun 1999 12:49:21 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <xkfyahik6ha.fsf@valdemar.col.hp.com>
"Keith G. Murphy" <keithmur@mindspring.com> writes:
> This is because generally speaking people truncate to the last minute
> mark when giving the time. (All this assumes a lot of other stuff also,
> like "meridian" being an abstraction, not actually the position of the
> sun in the sky; your clock is accurate; etc.)
It could be argued that it's *never* noon, exactly-- we're always just a
little bit before or after. So in that sense, at any time that your
watch is displaying "12:00:00" it's already after 12 {noon|midnight} by
some infinestimal, and thus {pm|am} are appropriate suffixes.
But I think we'd better end this thread; it's making me Zeno-phobic.
-=Eric
------------------------------
Date: Thu, 17 Jun 1999 18:03:47 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: blank row in array
Message-Id: <37692A73.E3858E4A@dave.org.uk>
Michael Hill wrote:
>
> I created this array like this:
>
> @myarr = ($mypart);
>
> then populated it like:
>
> push (@myarr, "parta");
> push (@myarr, "partb");
> push (@myarr, "partc");
>
> Then when i display the array I have a blank row.
>
> I had to modify my code like below to prevent the blank row.
>
> @myarr = ($mypart);
> pop(@myarr);
> push (@myarr, "parta");
> push (@myarr, "partb");
> push (@myarr, "partc");
>
> Shouldn't I be able to create the array empty instead of with a blank
> row?
If you want to create an empty array then don't create it with an
element in it.
my @myarr = ();
or even just
my @myarr;
You start by adding the contents of $mypart to the array and even if
$mypart is empty you get a one element array.
hth,
Dave...
------------------------------
Date: Thu, 17 Jun 1999 11:21:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: cgi query error
Message-Id: <Pine.GSO.4.02A.9906171121090.13900-100000@user2.teleport.com>
On Thu, 17 Jun 1999, Ryan Corder wrote:
> Can't call method "param" without a package or object reference at
Have you seen what the perldiag manpage says about this message? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 11:51:51 -0500
From: "End User" <kimntodd@dontspamus.execpc.com>
Subject: Re: Clear screen function in Perl?
Message-Id: <7kbasu$as1$1@ffx2nh3.news.uu.net>
or for NT/9x you can simply use:
system('cls');
HTH,
Todd
David Cantrell <NukeEmUp@ThePentagon.com> wrote in message
news:3768d30b.79493806@news.insnet.net...
> On 15 Jun 1999 16:57:40 -0700, Tom Christiansen <tchrist@mox.perl.com>
> said:
>
> >In comp.lang.perl.misc, jan@ude.org writes:
> >
> >: I use scrolling for updating the screen but that's not
> >:the best way to do it. Is there a clear screen funtion ...
> >
> > what part of the answer to this question as
> >elaborated in the standard perlfaq8 manpage included with
> >every Perl distribution was unclear to you?
>
> Although it should be pointed out that any method involving 'clear'
> will only work on a Unix-like system. Likewise, Term::Cap assumes
> various Unix idioms, such as the existence of a termcap file.
>
> On a Windoze system you can do:
>
> system("command /c cls");
>
> But this WON'T work:
>
> $clear=`command /c cls`;
> print $clear;
>
> (both tested on NT4)
>
> [Copying newsgroup posts to me by mail is considered rude]
>
> --
> David Cantrell, part-time Unix/perl/SQL/java techie
> full-time chef/musician/homebrewer
> http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Thu, 17 Jun 1999 17:46:38 GMT
From: hojo <hojo@i-tel.com>
Subject: configuring pop3 host for net::pop3
Message-Id: <7kbc9r$plm$1@nnrp1.deja.com>
I am trying to write a set of scripts that use Net::POP3. However, i am
not sure how to configure the pophost section in Net::Config. Our pop
server is kicked of via inetd. That, and I am not sure where it is as I
did not install it on my system (rh 5.0, perl5.00502). Where do I
begin? Do I need to run pop as a background daemon, or can I get at it
through inetd?
thank You
--
=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
hojo@i-tel.com
=-=-=-=-=-=-=-=-=-=
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 17 Jun 1999 13:51:09 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: date formats
Message-Id: <B38EADCD96683E9B81@204.112.166.88>
In article <slrn7mgh11.ejb.abigail@alexandra.delanet.com>,
abigail@delanet.com (Abigail) wrote:
>Lee (rlb@intrinsix.ca) wrote on MMCXV September MCMXCIII in
><URL:news:B38D50BB9668847178@204.112.166.88>:
>"" In article <3767ADCD.A1E1DBF3@ateb.com>,
>"" Emily Latham <frog@ateb.com> wrote:
>""
>"" >Just so all of you know and can stop acting as though I am a complete
>"" >moron.
>""
>"" Nothing personal, Emily.
>""
>"" They do it to each other, too. :)
>
>
>No we don't, you moron. ;)
Does this mean that I became part of "we" when I wasn't looking?
Or does it just mean that I'm a moron?
Lee
------------------------------
Date: 17 Jun 1999 17:21:22 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: exporting a hash from a module
Message-Id: <7kbaqi$395$1@fcnews.fc.hp.com>
akluyskens@my-deja.com wrote:
: I want to create a module that contains some subroutines that will be
: used in all our scripts. The first subroutine defines a hash containing
: our scripting directory structure. The problem is that untill now I
: cannot export this complete hash the the script calling the module.
<way too much irrelevant code snipped>
: #!/usr/bin/perl
: package ibmtools::bootstrap;
: require Exporter;
: @ISA = qw(Exporter);
: @EXPORT = qw(def_std_dir);
: @EXPORT_OK = qw (%std_dir);
: This is a test script calling the module:
: #!/usr/bin/perl
: require ibmtools::bootstrap;
Ummm.. did you even bother reading the Exporter manpage? Right at the
top, in the SYNOPSIS section:
In other files which wish to use ModuleName:
use ModuleName; # import default symbols into my package
use ModuleName qw(...); # import listed symbols into my package
use ModuleName (); # do not import any symbols
Andrew
------------------------------
Date: Thu, 17 Jun 1999 10:40:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: exporting a hash from a module
Message-Id: <Pine.GSO.4.02A.9906171032130.13900-100000@user2.teleport.com>
On Thu, 17 Jun 1999 akluyskens@my-deja.com wrote:
> I want to create a module
So, you should probably have started with h2xs, which will set lots of
things up for you. If you're not using h2xs, you're using insufficient
Laziness.
> that contains some subroutines that will be used in all our scripts.
> The first subroutine defines a hash containing our scripting directory
> structure. The problem is that untill now I cannot export this
> complete hash the the script calling the module.
> This is the module:
>
> #!/usr/bin/perl
Well, there's nothing _wrong_ wrong with that, but it's misleading.
Modules don't need (and can't use) any shebang line.
[ screenful snipped ]
> package ibmtools::bootstrap;
You should generally capitalize the names of your modules, so as to keep
them separate from pragmas.
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw(def_std_dir);
> @EXPORT_OK = qw (%std_dir);
It would be nice to use 'use strict' from the start. Then you'd be
declaring the globals you're using here. That's not as hard as it sounds;
h2xs would have done most of it for you.
[ five more screensful snipped ]
> This is a test script calling the module:
>
> #!/usr/bin/perl
> require ibmtools::bootstrap;
> ibmtools::bootstrap::def_std_dir(%std_dir);
No, that's not it. You want 'use' rather than 'require' for a module,
generally. Probably something like this.
use IBM_Tools::Bootstrap qw{ %std_dir };
There may be other problems with your code; I barely glanced at the
text I snipped. If I hadn't spotted these problems right away, I wouldn't
have responded at all - which implies that it's best to cut your code down
to a minimal example before posting it.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 13:59:46 -0400
From: loertly@uu.net
Subject: help! pattern matching question
Message-Id: <37693792.C5C184D6@uu.net>
I'm trying to search a variable for a particular text string and then
perform a function based on that value.
Here is the code -
$foo = `output of some system command`;
if ($foo =~ m/highest return code was 0 in/m) { # this is actually a
text message
<true>;
} else {
<false, text not found>;
}
The return code is actually just a text message and is what I am after.
It could be a 0, 1,3. This string is also the thriteenth line that is
in the variable but the if statement never returns true.
What am I doing wrong?
Thanks,
Les
------------------------------
Date: Thu, 17 Jun 1999 11:20:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How do I jump from one web page to another?
Message-Id: <Pine.GSO.4.02A.9906171115390.13900-100000@user2.teleport.com>
On Thu, 17 Jun 1999, Andrew Chang wrote:
> Newsgroups: comp.lang.perl, comp.lang.perl.misc
If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.
> This is probably not perl related, but how do I jump to another web
> page from my home page automatically?
It's not about Perl. You suspected that, and yet you chose to ask here
anyway. So maybe you can help us to keep this from happening again: Is
there anything anyone could have done which would have helped you to
realize before posting that a newsgroup about web-related issues would be
a better choice for web-related questions?
But maybe you want to set your browser to use a different home page in the
first place. Check the docs, FAQs, and newsgroups about browsers. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 13:24:54 -0400
From: brian@pm.org (brian d foy)
Subject: Re: How to do binary number calculations?
Message-Id: <brian-ya02408000R1706991324540001@news.panix.com>
In article <37690CD8.C45EC66E@on.bell.ca>, Christian Vo <chrisvo@on.bell.ca> posted:
> Can anyone point me to the appropriate module/documentation
> on how to do binary calculations in PERL ?
>
> All I want to do is take to integers, convert them to binary and do an
> AND...
you don't need to convert to binary. numbers are numbers regardless
of their base. just use the bitwise operators. see the docs for
more info :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Thu, 17 Jun 1999 18:37:22 +0200
From: "Mosl Roland" <founder@pege.org>
Subject: Re: How to extract emails from Outlock Express
Message-Id: <7kbe0b$9vo$3@orudios.magnet.at>
Bart Lateur <bart.lateur@skynet.be> wrote in message
news:3769d391.7367255@news.skynet.be...
> Mosl Roland wrote:
>
> >I would like to extract all emails from
> >Outlock Express 5 and store the
> >messages in an own database system.
> >
> >First step: how to extract from the
> >Outlock Express files?
>
> Your mistype of the name is very appropriate. Indeed: Outlook has it's
> own propriatary file format, and pretty much locks you out.
>
> You may try poking it using OLE, either in VB or (Activestate) Perl. It
> won't be easy, I guess.
But in the long run more easy than to always look for
lost mail after a crash.
Also I loose much time because OE is not good suited
for organising emails.
I plan a new version of my mind2 system
http://pege.org/minds based on perlscript
--
Mosl Roland - http://www.pege.org
clear targets for a confused civilization
------------------------------
Date: Thu, 17 Jun 1999 19:54:12 +0200
From: "Ute Mvlter" <moelter@legion.de>
Subject: image counter with perl
Message-Id: <7kbcr0$4rv$1@news-hrz.uni-duisburg.de>
I'm trying around for a few days with an image counter.
I can't get it work. I've searched the internet and tried a few scripts
but it doesen't work, too.
My html file has a line like that
<img src="http://www.ser.ver/cgi-bin/count.pl">
and the perl script something like that:
print "Location: "http://www.ser.ver/images/1.gif\n\n";
or
print "Content-Type: text/html\n\n";
print "<IMG SRC=\"http://www.ser.ver/images/1.gif\">";
or
any other possible combination i know
What's wrong ?
Can anybody help me ?
------------------------------
Date: Thu, 17 Jun 1999 11:33:22 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: image counter with perl
Message-Id: <Pine.GSO.4.02A.9906171132390.13900-100000@user2.teleport.com>
On Thu, 17 Jun 1999, Ute M=F6lter wrote:
> I can't get it work.=20
Sounds like a CGI program. :-)
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--=20
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 11:03:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Inclusive Split
Message-Id: <Pine.GSO.4.02A.9906171058210.13900-100000@user2.teleport.com>
On Thu, 17 Jun 1999, Mark-Jason Dominus wrote:
> In article <Pine.GSO.4.02A.9906161929210.26850-100000@user1.teleport.com>,
> Tom Phoenix <rootbeer@redcat.com> wrote:
> > while ($item_string =~
> > m{
> > \G # From where we left off, find...
>
> \G is superfluous there; it will match starting at the place it left
> off last time whether or not you put in \G. \G is for when you have
> two regexes and you want the *second* one to start looking at the
> place where the *first* one left off.
Well, no, that turns out not to be the case. I intentionally used \G as an
anchor so that, if what follows is _not_ the <X> tag (after some optional
whitespace), the loop will terminate. Without the \G, the pattern will
hunt on ahead through the string, looking for additional matches, which
was not my intention (although I may have had a different intention than
the original questioner).
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 17 Jun 1999 12:40:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: matinal musings and the madrugada
Message-Id: <37694109@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, keithmur@mindspring.com writes:
:Therefore, in this
:practical context, you would have been correct in the daytime to say
:"Twelve o'clock pm" and at night to say "Twelve o'clock am".
Then there's "twelve o'clock in the morning" which to me implies
a.m., compared with "twelve o'clock at night" which to me implies p.m.
Of course, twelve-thirty is obviously afternoon -- by very definition.
However, 12:00 high obviously is *NOT* afternoon -- again, by its very
definition. And were it but a minute or three prior, I would certainly
rounding to the closed quarter hour, call it twelve in the morning.
This morning-nonmorning thing is culturally dependent, you know.
In Spain at 2 o'clock p.m., one man might address the other with "buenas
tardes" while the other might respond "buenos dias", and both would
be correct. That's because the "tarde" guy had eaten his meal already
(although this would be a tad early for that), whereas the second one
hadn't eaten yet, so it was still "dia" for him. Odd, eh? Is 2am morning
or night? Is 8pm afternoon, evening, or night? Depends on the culture,
the time of the year, cultural factors, attitude, and maybe even whether
you've had supper yet. :-) For an equivalent in anglophonic culture,
consider the words lunch/dinner (weekdays) versus dinner/supper (holidays
or Sundays up at the grandparents). These words shift in meaning.
Spanish also has the noun "madruguda", which has no good translation
into English other than perhaps "oh dark thirty" or TFE ("Too Fricking
Early"). It's the period after night and before dawn. There's even a
reflexive verb "madrugarse", which is "too get up too damned early". :-)
Anyone who's ever spent Semana Santa in Sevilla for Holy Thursday => Good
Friday is painfully aware of the word, or its more Flamenco shortening,
la Madruga: They stay up all night. It's mind-numbing, and difficult
to explain.
If I could think of Perl context, I'd add some. :-)
--tom
--
This is the typical life of any Unix administrator. Most user/system problems
tend to read just like detective novels. Sometimes we win, sometimes we
reboot. --Albert Viall alv@cray.com
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 6033
**************************************