[23781] in Perl-Users-Digest
Perl-Users Digest, Issue: 5985 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 28 14:05:49 2003
Date: Sun, 28 Dec 2003 11:05:06 -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 Sun, 28 Dec 2003 Volume: 10 Number: 5985
Today's topics:
Re: A Challenge... <bik.mido@tiscalinet.it>
Re: Cygwin problem with 'print' (Fiaz Idris)
Determine if a process was spawed by screen <travislspencer@hotmail.com>
Re: Determine if a process was spawed by screen <travislspencer@hotmail.com>
Help with PAR. <walter@chisenski.com>
Re: Help with PAR. (Anno Siegel)
Re: Help with PAR. <kuujinbo@hotmail.com>
Re: Help with PAR. <walter@chisenski.com>
Re: I don't know what's wrong here ! <Juha.Laiho@iki.fi>
Re: I don't know what's wrong here ! <groleau@freeshell.org>
Re: installing mod manually <aolblowz@yahoo.com>
newbie: multi-screen CGI script <groups@donstefani.com>
Re: ObjectA calling ObjectB (Midas)
Re: ObjectA calling ObjectB (Randal L. Schwartz)
Re: ObjectA calling ObjectB <gnari@simnet.is>
Re: ObjectA calling ObjectB <gnari@simnet.is>
Re: ObjectA calling ObjectB (Midas)
Re: ObjectA calling ObjectB (Midas)
Re: Parsing File <matthew.garrish@sympatico.ca>
problems associated with CPAN module installation (lin ying)
Re: problems associated with CPAN module installation <syscjm@gwu.edu>
Re: problems associated with CPAN module installation <noreply@gunnar.cc>
Re: why this code shots up memory usage <bik.mido@tiscalinet.it>
Re: why this code shots up memory usage (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 29 Dec 2003 12:45:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A Challenge...
Message-Id: <6020vv8nv2kvl6dmfq25t1r6ioqf032rad@4ax.com>
On Sat, 27 Dec 2003 19:10:49 GMT, Ala Qumsieh <qumsieh@cim.mcgill.ca>
wrote:
>> perl -le map{print$"x$_,$x=$x?"$_$x$_":$_}reverse 0..9
BTW: can you really run these without quoting? Which shell are you
using?
Please note that to be definite and to avoid messing with the cmd line
I'll switch to consider scripts contained in files.
>Hmmm .. reverse() is such a long-named function.
>
>perl -le map{print$"x-$_,$x=$x?-$_.$x.-$_:-$_}-9..0
Hmmm, that's a good idea! But then you can earn one more char by
reverting to C<for>:
#!/usr/bin/perl -l
print$"x-$_,$x=$x?-$_.$x.-$_:-$_ for-9..0
And you can still save two:
#!/usr/bin/perl -l
print$"x-$_,$x=-$_.$x.($x&&-$_)for-9..0
In terms of e.g. <http://terje.perlgolf.org/>, these would count as
-l print$"x-$_,$x=$x?-$_.$x.-$_:-$_ for-9..0
-l print$"x-$_,$x=-$_.$x.($x&&-$_)for-9..0
and would score 44 and 42 strokes respectively. Notwithstanding my
(limited!) experience with Perlgolf gurus popping out with solutions
you wouldn't have ever imagined about, I doubt that one can do
anything better than the last one...
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: 27 Dec 2003 22:35:39 -0800
From: ifiaz@hotmail.com (Fiaz Idris)
Subject: Re: Cygwin problem with 'print'
Message-Id: <93c1947c.0312272235.7f3ca2f5@posting.google.com>
Thanx to both of you.
Now the script works as expected.
Basically, the problem is with the file format.
Changing DOS format to Unix format and everything works.
Infact, there were other problems due to this and now all of
them resolved.
------------------------------
Date: Sun, 28 Dec 2003 08:32:17 -0800
From: "Travis Spencer" <travislspencer@hotmail.com>
Subject: Determine if a process was spawed by screen
Message-Id: <bsn0r502l3l@enews4.newsguy.com>
Hello,
I am trying to figure out if a process was spawned by screen
(www.guckes.net/screen), in order to determine correctly if it is a runaway.
I have come up with a subroutine, but it is slow and doesn't perform
reliably. Can someone offer some suggestions that will speed it up and/or
increase its accuracy?
sub IsUsingScreen
{
my ($user, $pid) = @_;
my @process = `ps -p $pid -o user,pid,ppid,comm`;
# Calling `ps -p` returns two rows of output: a header row and the
# row of data. To get the parent process's user, pid, etc., the
# second row of output, $process[1], needs to be split on the
# whitespace delimiter after all leading whitespace has been
# trimmed off.
$process[1] =~ s/^\s+//m;
my ($p_user, $p_pid, $p_ppid, $p_comm) = split(/\s+/, $process[1]);
if ($p_user eq $user)
{
&IsUsingScreen($user, $p_ppid);
}
else
{
return $p_comm =~ /screen/;
}
}
Thanks.
--
Regards,
Travis Spencer
Portland, OR. USA
------------------------------
Date: Sun, 28 Dec 2003 09:26:05 -0800
From: "Travis Spencer" <travislspencer@hotmail.com>
Subject: Re: Determine if a process was spawed by screen
Message-Id: <bsn3os02qvo@enews4.newsguy.com>
I guess I should have mentioned that my solution needs to run on Solaris 8+
and Redhat 9.
--
Regards,
Travis Spencer
Portland, OR. USA
------------------------------
Date: Sun, 28 Dec 2003 01:29:59 -0700
From: Walter Chisenski <walter@chisenski.com>
Subject: Help with PAR.
Message-Id: <walter-76CEBC.01295828122003@news.west.cox.net>
Alright PAR gurus. I'm running Mac OS X 10.3 and just installed PAR, as
I'm trying to improve my Perl skills.
I ran the following commands to configure CPAN and install PAR.
sudo perl -MCPAN -eshell
install Bundle::CPAN
install PAR
It went through and looked like it completed 'make', 'make test' and
'make install' without any issues. After finishing, I attempted to
compile my first Perl script
pp -o hello hello.pl (Yes, Hello World :)
It completed without error, but when I run the UNIX executable I'm
getting the following errors before the script runs:
format error: bad signature: 0xcefaedfe at offset 0 in file
IO::File=GLOB(0x18f1d90)
at -e line 660
format error: bad signature: 0x00000000 at offset 165 in file
IO::File=GLOB(0x18f1d90)
at -e line 159
format error: bad signature: 0x4741505f at offset 37 in file
IO::File=GLOB(0x18f1d90)
at ../blib/lib/PAR.pm line 211
After the errors it runs the script (as simple as it is) without issue.
I understand that File::GLOB is a Perl extension (or module) for the BSD
glob routine and of course PAR.pm is a PAR file... Any ideas why I'm
seeing the error?
Is anyone else using PAR on OS X? Is there something about OS X that
PAR doesn't like without doing some additional configuration? Any
information or help would be great!
--
Walter
------------------------------
Date: 28 Dec 2003 12:41:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Help with PAR.
Message-Id: <bsmj2h$fnh$1@mamenchi.zrz.TU-Berlin.DE>
Walter Chisenski <walter@chisenski.com> wrote in comp.lang.perl.misc:
> Alright PAR gurus. I'm running Mac OS X 10.3 and just installed PAR, as
> I'm trying to improve my Perl skills.
[...]
> format error: bad signature: 0xcefaedfe at offset 0 in file
> IO::File=GLOB(0x18f1d90)
> at -e line 660
Googling for "format error: bad signature" shows you're not the only
one with that problem. I haven't followed the links, but there seems
to be an Archive::Zip connection.
Anno
------------------------------
Date: Sun, 28 Dec 2003 21:38:07 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: Help with PAR.
Message-Id: <bsmj3n$iud$1@pin3.tky.plala.or.jp>
Walter Chisenski wrote:
[snip]
> After finishing, I attempted to
> compile my first Perl script
>
> pp -o hello hello.pl (Yes, Hello World :)
>
> It completed without error, but when I run the UNIX executable I'm
> getting the following errors before the script runs:
>
> format error: bad signature: 0xcefaedfe at offset 0 in file
> IO::File=GLOB(0x18f1d90)
> at -e line 660
> format error: bad signature: 0x00000000 at offset 165 in file
> IO::File=GLOB(0x18f1d90)
> at -e line 159
> format error: bad signature: 0x4741505f at offset 37 in file
> IO::File=GLOB(0x18f1d90)
> at ../blib/lib/PAR.pm line 211
[snip]
This was discussed a couple of weeks ago:
http://groups.google.com/groups?th=354cac850fee8c26
A simple comp.lang.perl.misc Google search on 'par glob error' would
have also given the answer...
HTH - keith
------------------------------
Date: Sun, 28 Dec 2003 11:06:10 -0700
From: Walter Chisenski <walter@chisenski.com>
Subject: Re: Help with PAR.
Message-Id: <walter-181421.11061028122003@news.west.cox.net>
Thanks to both Anno and Keith for the replies.
While I did Google and read the older thread in this group that you
listed, I wasn't sure the issue was related per se, due to the File=GLOB
error being different (PAR.pm vs. Module.pm). I suppose that's due to
my low level of knowledge with Perl.
Either way, I did install PAR-0.76_99 and the issue is resolved.
Thanks,
--
Walter
In article <walter-76CEBC.01295828122003@news.west.cox.net>,
Walter Chisenski <walter@chisenski.com> wrote:
> Alright PAR gurus. I'm running Mac OS X 10.3 and just installed PAR, as
> I'm trying to improve my Perl skills.
>
> I ran the following commands to configure CPAN and install PAR.
>
> sudo perl -MCPAN -eshell
> install Bundle::CPAN
> install PAR
>
> It went through and looked like it completed 'make', 'make test' and
> 'make install' without any issues. After finishing, I attempted to
> compile my first Perl script
>
> pp -o hello hello.pl (Yes, Hello World :)
>
> It completed without error, but when I run the UNIX executable I'm
> getting the following errors before the script runs:
>
> format error: bad signature: 0xcefaedfe at offset 0 in file
> IO::File=GLOB(0x18f1d90)
> at -e line 660
> format error: bad signature: 0x00000000 at offset 165 in file
> IO::File=GLOB(0x18f1d90)
> at -e line 159
> format error: bad signature: 0x4741505f at offset 37 in file
> IO::File=GLOB(0x18f1d90)
> at ../blib/lib/PAR.pm line 211
>
> After the errors it runs the script (as simple as it is) without issue.
> I understand that File::GLOB is a Perl extension (or module) for the BSD
> glob routine and of course PAR.pm is a PAR file... Any ideas why I'm
> seeing the error?
>
> Is anyone else using PAR on OS X? Is there something about OS X that
> PAR doesn't like without doing some additional configuration? Any
> information or help would be great!
>
> --
> Walter
------------------------------
Date: Sun, 28 Dec 2003 11:07:00 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: I don't know what's wrong here !
Message-Id: <bsmden$2u1$1@ichaos.ichaos-int>
groleau@freeshell.org said:
>Gunnar Hjalmarsson wrote:
>> I don't think that you can undefine those variables explicitly. This
>> is how you typically do it instead:
>>
>> if (/^\s*(\d+)\s+(@\S+@)?\s*(\S+)(?:\s+(.+))?/) {
>> # It matched - do something
>> } else {
>> # It did not match - do something else
>> }
...
>I may also try the 'if' but I'd prefer it to
>match every line because if the syntax is bad
>I'd like to use what I can in the diagnostic
>messages.
It's exactly this error handling you'd be doing in the 'else' branch
above. So, in the above, the code will attempt a patch on every line,
and go to the 'if/then' branch when the match succeeds, and to the
'else' branch when the match fails. In the 'else' brach you do whatever
error reporting/recovery you see appropriate.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: Sun, 28 Dec 2003 10:06:47 -0500
From: Wes Groleau <groleau@freeshell.org>
Subject: Re: I don't know what's wrong here !
Message-Id: <n8Kdnflyu9gYbHOiRVn-tw@gbronline.com>
"Ragnar Hafsta��������������������" wrote:
> or unicode LATIN SMALL LETTER ETH
>
> you can use 'd' if it gives you trouble
I normally use UTF-8. I'll put in 'eth'
Probably won't be distributing this, since
I plan to add some 'personal' features that
do non-standard things with the GEDCOM format.
But, ya never know.....
--
Wes Groleau
"Grant me the serenity to accept those I cannot change;
the courage to change the one I can;
and the wisdom to know it's me."
-- unknown
------------------------------
Date: Sun, 28 Dec 2003 04:48:15 -0500
From: lucas <aolblowz@yahoo.com>
Subject: Re: installing mod manually
Message-Id: <CaGdnSfGwLlCO3OiRVn-tw@golden.net>
James Willmore wrote:
> You're welcome. And, have you emailed the author so this modification
> is available to all?
Been off on holidays, away from this computer, but that sounds like a plan.
I'll send one out
--
lucas
-------------------------
Perl Coder since 2001
shift || die;
-------------------------
------------------------------
Date: Sun, 28 Dec 2003 17:48:37 GMT
From: Don Stefani <groups@donstefani.com>
Subject: newbie: multi-screen CGI script
Message-Id: <VHEHb.2940$qH.349@newssvr25.news.prodigy.com>
Don Stefani humbly exposes his stupidity to the world...
Hello,
Looking at the Perl Cookbook: (Recipe 19:12 Writing a Multiscreen CGI Script)
I'm trying to do this:
<code>
%States = (
'Default' => \&front_page,
'Shirt' => \&shirt,
'Sweater' => \&sweater,
'Checkout' => \&checkout,
'Card' => \&credit_card,
'Order' => \&order,
'Cancel' => \&front_page,
);
if ($States{$page}) {
$States{$page}->(); # call the correct subroutine
} else {
no_such_page();
}
</code>
But I can get the following to work. just fine, but 'The Cookbook' calls my method,
"tedious and clumsy". I'm trying to work away from that! ;-)
I'm testing with just two views, but I'll probably end with six or so.
I must admit I only kind of know what I'm doing. I'm sure that's the key to the problem.
I have a feeling I might be making things too complicated. A good hint and a flaming kick
in the pants are very welcomed. TIA - Don
<code>
#!/usr/bin/perl -w
use strict;
use CGI;
use Lib::AccountMgrGeneral;
use Lib::MysqlModule;
use Lib::WebForms;
my $q = new CGI;
my $amg = new AccountMgrGeneral;
my $mysql = new MysqlModule;
my $wf = new WebForms;
my $view = $q->param('view') || 'srch';
# HTML top-------------------------
print "Content-type:text/html\n\n";
print $amg->header();
if ($view eq 'nsi')
{
print $wf->NameServerInput();
}
else
{
print $wf->SearchForm();
}
# HTML Bottom------------
print $amg->footer();
</code>
------------------------------
Date: Sat, 27 Dec 2003 23:37:00 GMT
From: MidasOneTwo@hotmail.nospam.com (Midas)
Subject: Re: ObjectA calling ObjectB
Message-Id: <3fee160b.61989446@news.iprimus.ca>
Kinda quiet. I don't know if I broke a rule or guideline ...
The following is what I'm trying to do:
My main module would have three code sections:
Part 1) Create 10 new assorted objects
Part 2) Link up the objects, somehow, so they can communicate with each other directly, like parts of an electrical circuit.
Part 3) Call the first object, which calls another, etc. like an electrical circuit.
To change the circuit, I would only change part 2 and perhaps part 3.
For example, ObjectX could have an input, for a string, and two outputs.
If the input is "TurnOnS", it calls ObjectY.Input3
If the input is "TurnOnT", it calls ObjectZ.Input7
ObjectX would call either, ObjectY.Input3 or ObjectZ.Input7, because it was connected that way in part 2.
I could then later change part 2 so ObjectX called either ObjectE.Input2 or ObjectF.Input9
In other words, I could "re-wire" the circuit without changing anything in the objects.
How can I do this in Perl?
Midas
------------------------------
Date: Sun, 28 Dec 2003 00:25:20 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: ObjectA calling ObjectB
Message-Id: <b823f5fccf16953e88524991fc715d9e@news.teranews.com>
>>>>> "Midas" == Midas <MidasOneTwo@hotmail.nospam.com> writes:
Midas> Kinda quiet. I don't know if I broke a rule or guideline ...
First, it takes time for usenet to propogate, although it's measured
in hours instead of days now. :)
Second, in the US at least, this is a holiday weekend. Most "normal"
people aren't reading work-related things right now.
Third, so far your previous two posts have been so confusing that I
couldn't even find a way to answer (and I wrote an entire section of
my most recent book on Perl objects!).
Lemme take a crack at this problem:
Midas> The following is what I'm trying to do:
Midas> My main module would have three code sections:
Midas> Part 1) Create 10 new assorted objects
Midas> Part 2) Link up the objects, somehow, so they can communicate with each other directly, like parts of an electrical circuit.
Midas> Part 3) Call the first object, which calls another, etc. like an electrical circuit.
Midas> To change the circuit, I would only change part 2 and perhaps part 3.
Midas> For example, ObjectX could have an input, for a string, and two outputs.
Midas> If the input is "TurnOnS", it calls ObjectY.Input3
Midas> If the input is "TurnOnT", it calls ObjectZ.Input7
Midas> ObjectX would call either, ObjectY.Input3 or ObjectZ.Input7, because it was connected that way in part 2.
Midas> I could then later change part 2 so ObjectX called either ObjectE.Input2 or ObjectF.Input9
Midas> In other words, I could "re-wire" the circuit without changing anything in the objects.
Midas> How can I do this in Perl?
Does it help if we say that $x->$y(@z) calls the method named $y in
object $x passing it @z for parameters? And that this works even
when symbolic references are turned off? The only restriction is
that $_ must be a simple scalar, but you can always do this:
$x->$_(@z) for ... some complex expression ...;
which temporarily aliases $_ to the result of a complex expression.
Is that the piece you need, or do you need more non-Perl "how do I do
this with objects" programming help?
print "Just another Perl hacker,"
--
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: Sun, 28 Dec 2003 01:05:29 -0000
From: "Ragnar Hafstað" <gnari@simnet.is>
Subject: Re: ObjectA calling ObjectB
Message-Id: <bsla9g$kb0$1@news.simnet.is>
"Midas" <MidasOneTwo@hotmail.nospam.com> wrote in message
news:3fee160b.61989446@news.iprimus.ca...
> Kinda quiet. I don't know if I broke a rule or guideline ...
>
> The following is what I'm trying to do:
>
> My main module would have three code sections:
>
> Part 1) Create 10 new assorted objects
> Part 2) Link up the objects, somehow, so they can communicate with each
other directly, like parts of an electrical circuit.
> Part 3) Call the first object, which calls another, etc. like an
electrical circuit.
>
> To change the circuit, I would only change part 2 and perhaps part 3.
>
> For example, ObjectX could have an input, for a string, and two outputs.
> If the input is "TurnOnS", it calls ObjectY.Input3
> If the input is "TurnOnT", it calls ObjectZ.Input7
would ObjectX allways just call one of its 2 outputs and return to caller?
in that case, you could just have your 10 assorted objects have one creator
method,
one descriptor method and one input method
the descriptor would return some description of its outputs.
the input method just returns a structure describing what outputs it wants
to 'call'.
the main program creates the objects in some array structure and sets up a
list of 'connections'
between object outputs and object inputs (Part 2 above). this could be read
from a file.
Part 3: call first object, which returns info about what object to call next
and so on...
to 'change the circuit' you just change the file
the descriptor method is to allow the main program to sanity check your
connections.
does this fit your ideas at all?
gnari
P.S. I notice you asked the same question on comp.lang.python
------------------------------
Date: Sun, 28 Dec 2003 01:23:29 -0000
From: "Ragnar Hafstað" <gnari@simnet.is>
Subject: Re: ObjectA calling ObjectB
Message-Id: <bslbb9$kbd$1@news.simnet.is>
"Midas" <MidasOneTwo@hotmail.nospam.com> wrote in message
news:3fee160b.61989446@news.iprimus.ca...
> Kinda quiet. I don't know if I broke a rule or guideline ...
>
> The following is what I'm trying to do:
>
> My main module would have three code sections:
>
> Part 1) Create 10 new assorted objects
> Part 2) Link up the objects, somehow, so they can communicate with each
other directly, like parts of an electrical circuit.
> Part 3) Call the first object, which calls another, etc. like an
electrical circuit.
>
> To change the circuit, I would only change part 2 and perhaps part 3.
>
> For example, ObjectX could have an input, for a string, and two outputs.
> If the input is "TurnOnS", it calls ObjectY.Input3
> If the input is "TurnOnT", it calls ObjectZ.Input7
>
> ObjectX would call either, ObjectY.Input3 or ObjectZ.Input7, because it
was connected that way in part 2.
>
> I could then later change part 2 so ObjectX called either ObjectE.Input2
or ObjectF.Input9
> In other words, I could "re-wire" the circuit without changing anything in
the objects.
what have you tried, and what are the specific problems you are having?
I can think of several ways to do this.
one would be, at linkup-time (Part 2 above), to call a method Connect of the
assorted objects
this method takes 3 arguments: a output number, an object reference, and an
input number
so for each output of ObjectX the main program calls this method, say:
ObjectX->Connect(1,$objY,3) and ObjectX->Connect(2,$objZ,7)
ObjextX stores this info somewhere, for example:
$self->{outputs}[$out]=[$obj,$inp];
when ObjectX's input method is called, if will select correct output based
on input and call
for example: my
($call,$inp)=@{$self->{outputs}[2]};$call->Input($inp,@arguments);
is this ok?
gnari
------------------------------
Date: Sun, 28 Dec 2003 02:48:07 GMT
From: MidasOneTwo@hotmail.nospam.com (Midas)
Subject: Re: ObjectA calling ObjectB
Message-Id: <3fee397b.71063462@news.iprimus.ca>
Thanks for replying.
On Sun, 28 Dec 2003 00:25:20 GMT, merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>First, it takes time for usenet to propogate, although it's measured
>in hours instead of days now. :)
Yes, sorry, but someone posted a challenge around the same time and the responses were coming in fast.
>Second, in the US at least, this is a holiday weekend. Most "normal"
>people aren't reading work-related things right now.
I'm studying both Python and Perl and three Python group readers replied to my question before anyone in the Perl group did. However, if what you're saying is that it was impolite for me to write "Kinda quiet" then OK. I appologize to you and the group for that.
>Third, so far your previous two posts have been so confusing that I
>couldn't even find a way to answer (and I wrote an entire section of
>my most recent book on Perl objects!).
I tried to avoid this situation. I needed help to word my question. How do you get help to word a question?
>Does it help if we say that $x->$y(@z) calls the method named $y in
>object $x passing it @z for parameters? And that this works even
>when symbolic references are turned off? The only restriction is
>that $_ must be a simple scalar, but you can always do this:
>
> $x->$_(@z) for ... some complex expression ...;
>
>which temporarily aliases $_ to the result of a complex expression.
>Is that the piece you need, ...
Possibly yes. I thought I'd recognize an answer outright but I'll take what you said and experiment a bit then post back. In any case many thanks for your time and knowledge.
>or do you need more non-Perl "how do I do
>this with objects" programming help?
I was looking for "how do I do this with Perl objects" programming help. Thanks for the response. I'll look into what you've written and I'll write back here a little later.
Midas
------------------------------
Date: Sun, 28 Dec 2003 03:23:52 GMT
From: MidasOneTwo@hotmail.nospam.com (Midas)
Subject: Re: ObjectA calling ObjectB
Message-Id: <3fee4b38.75604989@news.iprimus.ca>
Thanks for replying.
On Sun, 28 Dec 2003 01:05:29 -0000, "Ragnar Hafstað" <gnari@simnet.is> wrote:
>would ObjectX allways just call one of its 2 outputs and return to caller?
Yes ObjectX would just call one of its two outputs. However, other objects would have more outputs and more than one input.
>in that case, you could just have your 10 assorted objects have one creator
>method,
>one descriptor method and one input method
>the descriptor would return some description of its outputs.
>the input method just returns a structure describing what outputs it wants
>to 'call'.
>the main program creates the objects in some array structure and sets up a
>list of 'connections'
>between object outputs and object inputs (Part 2 above). this could be read
>from a file.
>Part 3: call first object, which returns info about what object to call next
>and so on...
>
>to 'change the circuit' you just change the file
>
>the descriptor method is to allow the main program to sanity check your
>connections.
>
>does this fit your ideas at all?
I'll look into this. Thank you for your suggestions.
>P.S. I notice you asked the same question on comp.lang.python
Yes. I'm studying both Perl and Python. I realized I didn't know the answer to my question in either language.
------------------------------
Date: Sun, 28 Dec 2003 10:58:07 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Parsing File
Message-Id: <d4DHb.245$Vl6.165881@news20.bellglobal.com>
"Sara" <genericax@hotmail.com> wrote in message
news:776e0325.0312241206.5b462f94@posting.google.com...
>
> Jim, this may not be obvious, but when you think about it- it should
> be. How could the script "die" then "open a file"? Its really the same
> thing as
>
> unless (open) {die;}
>
I don't think he was ever under that impression. He was asking why you would
put the die statement before you check the open. The logical flow of your
script is not to die at that point (unless your open happens to succeed),
but to open the file (or die if it doesn't work), hence the reason most
people write their code the other way. Also, using 'unless' or 'if' to check
the success of the open is generally pointless, as you're just adding
verbiage to your script.
Matt
------------------------------
Date: 27 Dec 2003 22:22:37 -0800
From: sir_linying@hotmail.com (lin ying)
Subject: problems associated with CPAN module installation
Message-Id: <1f7463ce.0312272222.20563511@posting.google.com>
Hi, all
I tried to install modules I downloaded from CPAN to my private
directory. But those modules need to use other modules. How can I once
for all download all required modules in their correct calling
hierarchy? Should I download every module one by one and figure out
right path information manually?
Thanks a lot for all possible help!
Ying
------------------------------
Date: Sun, 28 Dec 2003 02:26:36 -0500
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: problems associated with CPAN module installation
Message-Id: <3FEE85AC.8080303@gwu.edu>
lin ying wrote:
> Hi, all
>
> I tried to install modules I downloaded from CPAN to my private
> directory. But those modules need to use other modules. How can I once
> for all download all required modules in their correct calling
> hierarchy? Should I download every module one by one and figure out
> right path information manually?
>
CPAN will download and install all the required dependencies if you
let it.
Chris Mattern
------------------------------
Date: Sun, 28 Dec 2003 13:19:13 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: problems associated with CPAN module installation
Message-Id: <bsmi22$ecuhd$1@ID-184292.news.uni-berlin.de>
Chris Mattern wrote:
> lin ying wrote:
>> How can I once for all download all required modules in their
>> correct calling hierarchy?
>>
> CPAN will download and install all the required dependencies if you
> let it.
I.e. CPAN.pm will. Check out the documentation for that module.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 29 Dec 2003 12:45:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: why this code shots up memory usage
Message-Id: <5kcuuv8lvu99o3f22tsfkghkca9c6osr1f@4ax.com>
On Sat, 27 Dec 2003 18:25:49 +0000 (UTC), Ben Morrow
<usenet@morrow.me.uk> wrote:
>> >Indeed I agree, I won't never use them in future.
>>
>> "You will never" or "you won't ever"...
>> ;-)
>
>There en't nuffin' wrong wi' dobble negitives.. ;)
So I won't never correct them any more!
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: 28 Dec 2003 14:30:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: why this code shots up memory usage
Message-Id: <bsmpeo$kem$1@mamenchi.zrz.TU-Berlin.DE>
Ben Morrow <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
>
> Michele Dondi <bik.mido@tiscalinet.it> wrote:
> > On Fri, 26 Dec 2003 10:45:08 +0530, "Madhur" <a_madhur@vsnl.net>
> > wrote:
> >
> > >Indeed I agree, I won't never use them in future.
> >
> > "You will never" or "you won't ever"...
> > ;-)
>
> There en't nuffin' wrong wi' dobble negitives.. ;)
"Two negatives make a positive, but two positives never make a negative."
"Yeah, right!"
Anno
------------------------------
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.
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 5985
***************************************