[25175] in Perl-Users-Digest
Perl-Users Digest, Issue: 7424 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 19 03:05:32 2004
Date: Fri, 19 Nov 2004 00:05:08 -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 Fri, 19 Nov 2004 Volume: 10 Number: 7424
Today's topics:
Re: Can PERL open a Windows handle? <tadmc@augustmail.com>
Re: Complex datastructure documentation? <tadmc@augustmail.com>
Re: Complex datastructure documentation? <postmaster@castleamber.com>
Re: Complex datastructure documentation? <postmaster@castleamber.com>
Re: Complex datastructure documentation? <uri@stemsystems.com>
Re: Complex datastructure documentation? <postmaster@castleamber.com>
Re: Complex datastructure documentation? <postmaster@castleamber.com>
Re: Complex datastructure documentation? <postmaster@castleamber.com>
Re: Complex datastructure documentation? <uri@stemsystems.com>
Re: Complex datastructure documentation? <uri@stemsystems.com>
Configurable timeout value of Cyrus::IMAP::Admin module <sam.wun@authtec.net>
Re: First Perl Program <bik.mido@tiscalinet.it>
how to add parameter to HTTP header in Perl?(not fowwlo <end@dream.life>
Re: how to add parameter to HTTP header in Perl?(not fo <postmaster@castleamber.com>
Re: Managing PERL5LIB with multiple perl installation <FILTERjvsSPAM@india.ti.com>
Re: Not Initializing Variables Correctly? <tadmc@augustmail.com>
Re: perldoc problem on linux <tadmc@augustmail.com>
Re: Problem with Hashes <tadmc@augustmail.com>
Re: Really? <tadmc@augustmail.com>
Re: Really? <tassilo.von.parseval@rwth-aachen.de>
Re: Really? <tadmc@augustmail.com>
Re: regex challange: collapse nested {} blocks <tadmc@augustmail.com>
Re: the antichomp <tadmc@augustmail.com>
Re: the antichomp <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Nov 2004 23:38:55 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Can PERL open a Windows handle?
Message-Id: <slrncpr1nf.6ff.tadmc@magna.augustmail.com>
Paul S. <pauls@nospam.com> wrote:
> Can PERL
The name of the programming language discussed here is "Perl".
> open a Windows Handle?
What is a "Windows Handle" ?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 22:41:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <slrncpqubk.6aa.tadmc@magna.augustmail.com>
John Bokma <postmaster@castleamber.com> wrote:
> Uri Guttman wrote:
>> JB> I don't even know to what the above translates:
>>
>> JB> $hash->{Host}{$host}[1]{$sid} ?
>>
>> translates?
>
> To readable Perl.
That *is* readable Perl.
It is (a reference to) a HoHoLoH data structure.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Nov 2004 06:21:24 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <Xns95A639FDE17Ecastleamber@130.133.1.4>
Tad McClellan wrote:
> John Bokma <postmaster@castleamber.com> wrote:
>> Uri Guttman wrote:
>
>
>>> JB> I don't even know to what the above translates:
>>>
>>> JB> $hash->{Host}{$host}[1]{$sid} ?
>>>
>>> translates?
>>
>> To readable Perl.
>
> That *is* readable Perl.
>
> It is (a reference to) a HoHoLoH data structure.
The below, the thing snippet, above, is to me not readable Perl.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 19 Nov 2004 06:35:09 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <Xns95A65F30F04Dcastleamber@130.133.1.4>
Uri Guttman wrote:
>>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
>
> >> OO has NOTHING to do with coding but rather with architecture,
> >> design and APIs.
>
> JB> OO can improve the readability (and hence make it more
> understandable) JB> and improve maintainability of your code.
> PERIOD. It has a lot to do JB> with coding.
>
> then you don't understand OO.
Ok, then I don't understand OO. I consider my own OO designed stuff (and
that of others even) more readable compared to when I (or someone else)
don't use OO, especially when I work with complex datastructures.
> JB> I don't even know to what the above translates:
> >>
> JB> $hash->{Host}{$host}[1]{$sid} ?
> >>
> >> translates?
>
> JB> To readable Perl. Note that I am not a native English speaker,
> so the JB> choice of my words might be wrong.
>
> that line of perl is fine by my standards.
Yes to me too. The one *above* it, that was snipped, not. To me that is.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Fri, 19 Nov 2004 06:41:35 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <x73bz68hnk.fsf@mail.sysarch.com>
>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
JB> Ok, then I don't understand OO. I consider my own OO designed
JB> stuff (and that of others even) more readable compared to when I
JB> (or someone else) don't use OO, especially when I work with
JB> complex datastructures.
you still are not seeing how OO has nothing to do with the data
structures and syntax. i have tried to explain it to you (and others
have tried too). just think about the fact that coding and design are
not the same thing. many languages (which have different syntax and ways
to build structures) can do OO so that shows that OO and syntax are
separate features of a program. same with code quality vs OO or not.
it is a very important concept you should learn. design is not
coding. OO is design. OO will not clean up bad syntax.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 19 Nov 2004 06:56:58 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <Xns95A69A5250FDcastleamber@130.133.1.4>
Sherm Pendley wrote:
> John Bokma wrote:
>
>> OO can improve the readability (and hence make it more
understandable)
>> and improve maintainability of your code. PERIOD. It has a lot to do
>> with coding.
>
> No, Uri's right. OO is about the high-level design and architecture of
> an app. It's a way of thinking about objects and the relationships
> between them. Coding is just syntax.
So is OO :-)
> In terms of the high-level OO concepts involved, a method call is a
> method call, regardless of the syntax used to code it:
>
> $obj->do_something($foo);
>
> or
>
> do_something($obj, $foo);
I mean:
$car{door_open} = 1;
$car{people}++;
$car{door_open} = 0;
vs.
$car->open_door();
$car->person_enters();
$car->close_door();
Or:
$car->open_door()->person_enters()->close_door();
And *not* vs:
open_door( $car );
Although, one can state that if you have a house and a car, that:
$house->open_door();
$car->open_door();
is way more clear compared to kludges I see in PHP:
open_car_door( $car );
open_house_door( $house );
> Sure, it's *nice* to be working in a language that provides a bit of
> "syntax sugar" to make OO constructs a bit easier to read. But, it's
not
> at all a requirement
It *can* make code more readable.
// for regexp is also syntax sugar. Have a peek at PHP if you want to
see what it does to *readability*.
> - you could use an object-oriented approach in a
> "procedural" language like C or assembler, if you want to.
Since I have done so, and since I considered my coding more readable
that way (besides the other advantages), I think I am still right by
saying that OO can improve readability, especially when juggling
datastructures.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 19 Nov 2004 07:16:42 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <Xns95A6CF6F5743castleamber@130.133.1.4>
Doug O'Leary wrote:
> Hey;
>
> I sent John Bokma a sincere apology and an incredibly long
> winded data description. Unfortunately, due to a stuck shift
> key, (f vs F), it went to him via email instead of getting
> posted here.
A repost of the email follows:
And thanks for the apology Doug, I had the idea that there was some kind
of misunderstanding. And also, I am sometimes a bit straight to the
(my) point. (bit too much, some of my messages could be written a bit
friendlier).
[ begin email ]
John Bokma, I think I owe you an apology.
I think I radically misunderstood your post. I am not an OO programmer.
I've had one C++ class back in 1992. My background is UNIX and database
administration, not programming. To me, perl is a tool to use in my
job - it's not my job.
I took your post to imply that I did no pre-coding analysis/design, and
that I needed some perl classes (training classes). Although an
argument could certainly be made for the training classes, I did a
rather significant amount of design work.
I also took your "rewrite it" to mean rewrite the script. In
database parlance, data structures are redesigned; code is rewritten.
Assuming you meant OO classes and rewriting the data structure, then I
offer my sincerest and most humble apologies.
The documentation that I'm alluding to is documentation that I prepare
for any program that I generate. It has several sections:
1. Overview: brief description of the script.
2. Program logic: *Near* line by line walk through of the code using
straight English.
3. Functions: Function prototypes and a similar walk through of the
function code.
4. Variables: Definition of each variable, type, initialized value,
where it's used, locality, etc.
5. Suggested improvements
Most of my clients are not perl programmers. Some, a distinct
minority, are familiar with the language. The purpose of this
documentation is to make support easier. In case they need to
modify/add functionality of the script, they can use that documentation
to at least narrow down where the modifications should be done.
Also, in case they bring in a real perl programmer, he at least
has a starting point for the logic flow of the script.
In comp.lang.perl.misc, you wrote:
>>
>> But if interested, clarify what
>>
>> ${${${${$hash}{Host}}{$host}}[1]}{$sid} = [ @dls, %lvs ]
>>
>> means, and I try to come up with an OO design. Maybe others can chip
>> in a bit too.
This script is pretty much a done deal. (1) the client contact, who
understands perl is happy with it and (2) I'm scheduled to roll off
this contract at the end of next week with a number of other things
yet to be done. That being said, I'd be interested in any options
for future endevors.
To translate the above, I need to describe the data.
* There are 29 separate HP hosts running 0 to many different oracle
databases.
* Oracle tablespaces are stored on raw HP logical volumes - one LV
per tablespace, one lv set per database instance.
* Oracle System Identifiers (sids) are not necessarily unique across
the environment. Contrary to good dba practices, the dbas have
used the same sid on different hosts.
* Omniback, HP's backup software, uses a datalist as a backup
definition.
In this datalist is a section that identifies which LVs on which host
are to be backed up as part of an Oracle database backup.
* More than one Omniback datalist can be defined for an individual
Oracle database.
* Part of the datalist definition is the host on which the backup
is to be done, the database sid, the suffix used for EMC business
continuance volume redefintion (long story, don't ask), and the
number of tape streams to run.
So, to put it more in data rationalization format:
One Omniback datalist supports one and only one database.
One Oracle database can be supported my more than one Omniback datalist.
One Oracle database will have a unique set of HP logical volumes
A set of HP LVs can support one and only one Oracle database.
A set of HP LVs can be on one and only one HP system (Not quite true,
but true enough for this purpose)
One Oracle SID can be (but shouldn't be) on more than one host but
cannot be duplicated on a single host.
One Omniback datalist can be on one and only one host, have one
sid, one suffix, and one stream definition.
Going through the whole normalization process, you end up with
two things that are truly unqiue: Hosts and Datalists - so they
end up being the keys to the top level structure:
(Using my syntax, since I'm familiar with it:)
${$hash}{'Datalist'}
${$hash}{'Host'}
Examining datalists, that seems ready made for a hash (%datalists)
for each individual datalist ($dl):
$datalist{'host'} = $host
$datalist{'sid'} = $sid
$datalist{'suffix'} = $suffix
$datalist{'stream'} = $stream
Jumping back to the top level:
${${$hash}{'Datalist'}}{$dl} = \%datalist
Examining hosts, we have a number of subordinate relationships.
* There can be one and only one sid on each host. That, to me,
implies a hash.
* Each sid on each host will have one to many datalists supporting it.
* Each sid on each host will have one set of logical volumes that
need to be backed up.
* As a convenience, the client asked to be able to update all the
datalists assigned to a specific host. In database parlance, this
enters the area of data denormalization.
So, back to the structure:
${${$host}{'Host'}}{$host} = [ @{host_based_datalists},
%{hash_of_oracle_sids}
]
${${${$host}{'Host'}}{$host}}[0] = \@{host_based_datalists}
${${${$host}{'Host'}}{$host}}[1] = %{hash_of_oracle_sids}
${${${${$host}{'Host'}}{$host}}[1]}{$sid} =
[ @{sid_based_datalists}, %{HP_LVs_per_database} ]
The configuration file for this monstrosity is multiline records as
follows:
Datalist = datalist1
Host = host1
Sid = TSTDB
Datalist = datalist2
Host = host2
Sid = PROD1
Suffix = bcv
Stream = 4
Datalist = datalist2.1
Host = host2
Sid = PROD1
Suffix = bcv
Stream = 4
I have a function that reads the config file, generates the
data structure, and returns the hash reference - $hash. In fact,
I originally called it $monster_hash, but didn't want to type that
much...
So, to end what turned out to be *WAY* too many lines of
description:
>> But if interested, clarify what
>>
>> ${${${${$hash}{Host}}{$host}}[1]}{$sid} = [ @dls, %lvs ]
@dls is an array of datalists assigned to Oracle database $sid.
%lvs is a hash of HP LVs that Oracle $sid uses.
${${${${$hash}{Host}}{$host}}[1]}{$sid} is a hash keyed on $sid
whose value is an array of an array of subordinate datalists
and a hash of HP LVs.
${${${${$hash}{Host}}{$host}}} is a hash keyed on $host whose value
is an array of an array of host based datalists and a hash of
Oracle sids on that host.
I'm sure that made it all as clear as mud. But, on the bright side,
I probably just did a good bit of work towards documenting the
data structure! (I wonder if I can bill for this? :) )
Uri is probably correct in that this can probably be displayed
better. However, it is a good solid data structure following
most of the rules of data normalization.
1. Repeating groups have been eliminated.
2. With the purposeful exception of host and oracle based datalists,
redundant data groups have been eliminated.
3. Data in each hash value is dependent on the key of the hash.
Sorry for the length of this, but you asked. And, back to the
original topic of this post, once again, I apologize for reacting
so strongly to your post. I misinterpreted it to mean something
different.
Of course, assuming I didn't misinterpret it, I stand by my
statements! :-)
Doug
--
-------- Senior UNIX Admin O'Leary Computer Enterprises
dkoleary@olearycomputers.com (w) 630-904-6098 (c) 630-248-2749 resume:
http://home.comcast.net/~dkoleary/resume.html
[end email]
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 19 Nov 2004 07:23:50 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <Xns95A6E32ADCA5castleamber@130.133.1.4>
Uri Guttman wrote:
>>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
>
> JB> Ok, then I don't understand OO. I consider my own OO designed
> JB> stuff (and that of others even) more readable compared to when I
> JB> (or someone else) don't use OO, especially when I work with
> JB> complex datastructures.
>
> you still are not seeing how OO has nothing to do with the data
> structures and syntax.
With OO one can hide a complex data structure and provide a nice wrapper
to it. OO = data + methods. But you are probably right, it has nothing
to do with datastructures.
> i have tried to explain it to you (and others
> have tried too
I saw just one "Uri is right", and I saw no explanation.
>). just think about the fact that coding and design are
> not the same thing. many languages (which have different syntax and
> ways to build structures) can do OO so that shows that OO and syntax
> are separate features of a program. same with code quality vs OO or
> not.
>
> it is a very important concept you should learn. design is not
> coding. OO is design. OO will not clean up bad syntax.
I wrote: *can* make code more readable. Maybe you should read my
examples and comment on those instead of droning on how I don't
understand OO design.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Fri, 19 Nov 2004 07:55:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <x7llcy6zo5.fsf@mail.sysarch.com>
>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
JB> Uri Guttman wrote:
>> you still are not seeing how OO has nothing to do with the data
>> structures and syntax.
JB> With OO one can hide a complex data structure and provide a nice wrapper
JB> to it. OO = data + methods. But you are probably right, it has nothing
JB> to do with datastructures.
hiding is not coding. you still have to code somewhere to manage the
data structures. that is the whole point of why OO and structure design
have nothing to do with each other. you can do one completely
independently from the other.
>> it is a very important concept you should learn. design is not
>> coding. OO is design. OO will not clean up bad syntax.
JB> I wrote: *can* make code more readable. Maybe you should read my
JB> examples and comment on those instead of droning on how I don't
JB> understand OO design.
no, OO cannot make code more readable. it can make DESIGN more
understandable. again, code is not design. we are talking about code and
data structures and not design. since OO is in the realm of design it
has NO EFFECT on coding.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 19 Nov 2004 08:01:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Complex datastructure documentation?
Message-Id: <x7is826zes.fsf@mail.sysarch.com>
>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
>> No, Uri's right. OO is about the high-level design and architecture of
>> an app. It's a way of thinking about objects and the relationships
>> between them. Coding is just syntax.
JB> So is OO :-)
well, smiley notwithstanding, OO is not syntax. there is the crux of
your confusion. API is not syntax. object design is not
syntax. archtecture is not syntax.
JB> I mean:
JB> $car{door_open} = 1;
JB> $car{people}++;
JB> $car{door_open} = 0;
JB> $car->open_door();
JB> $car->person_enters();
JB> $car->close_door();
that is design, not syntax. one is direct access coding and the other is
OO method calls. they are not the same. underneath the method you still
need the equivilent code to do the real work. that is why OO may hide
coding but it doesn't replace it.
JB> It *can* make code more readable.
that is not the same code. one is direct data munging and the other is
method calls. compare apples to apples please.
JB> Since I have done so, and since I considered my coding more readable
JB> that way (besides the other advantages), I think I am still right by
JB> saying that OO can improve readability, especially when juggling
JB> datastructures.
this is frustrating as you just don't get that coding is not OO. what
about all the code to IMPLEMENT the methods? hiding it doesn't make it
go away. the OP's poor syntax could be inside a method and it STILL IS
BAD CODE no matter how pretty the OO API? do you get that? bad code can
exist ANYWHERE and OO cannot clean it up by itself. it has to be written
as good code.
oy, i have to give up.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 19 Nov 2004 13:52:07 +0800
From: sam <sam.wun@authtec.net>
Subject: Configurable timeout value of Cyrus::IMAP::Admin module
Message-Id: <cnk37m$1hq4$1@news.hgc.com.hk>
Hi,
As I am writing a perl login module that will sync the cyrus::imap:admin
login with the webmin admin user login. I would like to make the timeout
of login cyrus::imap::admin to be the same as the webmin admin user.
Is there any timeout confiugration option I can define in the Cyrus perl
module?
Thanks
Sam.
------------------------------
Date: Fri, 19 Nov 2004 08:59:28 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: First Perl Program
Message-Id: <vropp09pcehvsvqcvmdt6g0b4ljrb9kk3a@4ax.com>
On 18 Nov 2004 10:25:39 GMT, Dave Weaver <zen13097@zen.co.uk> wrote:
>> > my @parts = (split( ',', $_ ))[1..3];
>>
>> my @parts = split /,/, $_, 3;
>
>These aren't equivalent.
Yes, of course they are not! I didn't look carefully and somehow I
assumed the OP just wanted the first three fields. Apologies...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 19 Nov 2004 15:30:37 +0800
From: Alont <end@dream.life>
Subject: how to add parameter to HTTP header in Perl?(not fowwlow the ? in url)
Message-Id: <41a19f69.26281484@news.individual.de>
this is the header IE send to server:
POST /services/test.asp HTTP/1.1
Cache-Control: no-cache
Cookie: ASPSESSIONIDCQTDRQQR=IEDGMDLBFKGNEBGBIKNOEDLN
paramater1=baozhuangxiang&ext=txt
I want Perl can send this header too, but I don't know how to add
"paramater1=baozhuangxiang&ext=txt " to the header?
$url='http://localhost/services/test.asp'
$request = HTTP::Request->new(POST => $url);
#before send the request, how I can add
"paramater1=baozhuangxiang&ext=txt" to the header?
$response = $lwp->request($request); #send request
if ($response->is_success) {
$data = $response->content;
--
Your fault as a Government is My failure as a Citizen.
------------------------------
Date: 19 Nov 2004 07:54:43 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: how to add parameter to HTTP header in Perl?(not fowwlow the ? in url)
Message-Id: <Xns95A6136E42CE7castleamber@130.133.1.4>
Alont wrote:
> this is the header IE send to server:
> POST /services/test.asp HTTP/1.1
> Cache-Control: no-cache
> Cookie: ASPSESSIONIDCQTDRQQR=IEDGMDLBFKGNEBGBIKNOEDLN
>
> paramater1=baozhuangxiang&ext=txt
>
> I want Perl can send this header too, but I don't know how to add
> "paramater1=baozhuangxiang&ext=txt " to the header?
>
> $url='http://localhost/services/test.asp'
> $request = HTTP::Request->new(POST => $url);
>
> #before send the request, how I can add
> "paramater1=baozhuangxiang&ext=txt" to the header?
http://johnbokma.com/perl/currencyconverter.html has an example of this.
So:
my $action = POST
'http://localhost/services/test.asp', [
parameter1 => 'baozhuangxiang',
ex => 'txt',
];
my $ua = LWP::UserAgent->new;
my $request = $ua->request( $action );
could do the trick in your case.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 19 Nov 2004 05:11:06 GMT
From: Jahagirdar Vijayvithal S <FILTERjvsSPAM@india.ti.com>
Subject: Re: Managing PERL5LIB with multiple perl installation
Message-Id: <cnjv9a$68g$1@home.itg.ti.com>
* John Bokma <postmaster@castleamber.com>:
> Jahagirdar Vijayvithal S wrote:
>
>> The default global installation of perl here is 5.005_03
>>
>> I have installed v5.8.4 locally as a higher version was needed for some
>> of the modules i am using.
>>
>> Now I need to constantly switch the value of PERL5LIB enviornment
>> variable depending on wether I am using my local scripts or scripts
>> developed by others . Is there a way to automate this without changing
>> my perl scripts?
>
> What breaks under 5.8.4?
>
For example when using the gui perl debugger "perl -d:ptkdb <script>"
On Setting PERL5LIB to point to PERL 5.6 installation
-----------------------------------------------------------
%perl5.8.4 -d:ptkdb ~/bin/mac_core.pl
gives
ld.so.1: /user/jvs/jvs/bin/perl: fatal: relocation error: file
/usr/local/lib/perl5/site_perl/5.6.0//sun4-solaris/auto/Tk/Event/Event.so:
symbol perl_get_sv: referenced symbol not found Killed
where as perl 5.005_03 and perl 5.6 work
And setting PERL5LIB to point to PERL5.8.4 installation gives
-----------------------------------------------------------
Perl 5.006 required--this is only version 5.00503, stopped at /db/dsputils/jvs/lib/perl5/5.8.4//vars.pm line 3.
BEGIN failed--compilation aborted at /db/dsputils/jvs/lib/perl5/5.8.4//vars.pm line 3.
BEGIN failed--compilation aborted at /db/dsputils/jvs/lib/perl5/site_perl/5.8.4/sun4-solaris//Tk/Event.pm line 2.
BEGIN failed--compilation aborted at /db/dsputils/jvs/lib/perl5/site_perl/5.8.4/sun4-solaris//Tk.pm line 13.
BEGIN failed--compilation aborted at /db/dsputils/jvs/lib/perl5/5.8.4//Devel/ptkdb.pm line 12.
BEGIN failed--compilation aborted.
with 5.00503
and
ld.so.1: -v: fatal: relocation error: file /db/dsputils/jvs/lib/perl5/site_perl/5.8.4/sun4-solaris//auto/Tk/Event/Event.so: symbol Perl_get_sv: referenced symbol not found Killed
with perl 5.6
------------------------------
Date: Thu, 18 Nov 2004 22:47:47 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Not Initializing Variables Correctly?
Message-Id: <slrncpqunj.6aa.tadmc@magna.augustmail.com>
Bob Walton <see@sig.invalid> wrote:
> That seems like reasonable behavior: if the
> cell has no value, it generates undef in Perl.
I would say that representing an empty spreadsheet cell as
an empty string would be ever so much more reasonable. :-)
I'd reserve undef for cells outside the 2-D limits of the spreadsheet.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 23:10:59 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perldoc problem on linux
Message-Id: <slrncpr033.6aa.tadmc@magna.augustmail.com>
Zhiliang Hu <zhilianghu@yahoo.com> wrote:
> James Willmore <jwillmore@fastmail.us> wrote in message news:<pan.2004.11.17.14.46.12.514340@fastmail.us>...
>> (Please DON'T top-post - it's considered rude)
> I am sorry I didn't know the difference posting on top or bottom -
That is Part One of composing a followup.
Part Two is trimming the quoted text to just enough to provide
the context for the comments you are about to add.
See also:
http://web.presby.edu/~nnqadmin/nnq/nquote.html
> I learn some custom here.
Trimming quoted material and interleaving comments following
the quoted text that the comment applies to is widely expected
in nearly all of Usenet, it is not particular to "here" in
this newsgroup.
> Thanks Jim.
Thank *you* for simply changing how you post instead of the more
usual whining about it. Very refreshing!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 22:59:12 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Problem with Hashes
Message-Id: <slrncpqvd0.6aa.tadmc@magna.augustmail.com>
daniel kaplan <nospam@nospam.com> wrote:
> "Sherm Pendley" <spamtrap@dot-app.org> wrote in message
> news:ZcqdnarTSYenxADcRVn-rw@adelphia.com...
>> daniel kaplan wrote:
>
>> The concept here is that, unlike C expressions, Perl expressions can
>> return a list of values. Some expressions return either a list or a
>> scalar value depending on the context in which they're used.
>>
>> The expression "my $a = @foo" evaluates @foo in scalar context, which
>> (as you probably know) returns the number of elements in @foo.
>>
>> The expression my ($a) = @foo" evaluates @foo in list context, which
>> returns a list of the elements in @foo. You can assign the result to
>> another array, or to a list of scalars.
> my apologies, and this sounds like idiocy not letting go, but am having a
> problem grapsing here:
You've already seen the "Context" section in perldata.pod then?
> in the OP, there was this:
>
> sub1(\%HoH); #Passing the Hoh by reference...
>
> and receieved here within the subroutine:
>
> my $a = @_;
>
> where i can't grasp what i am missing is this...he passed the REFERENCE to
> the hash, not the HASH itself
So far so good...
> ....and put it
No he didn't (where "it" is the "reference").
He put the number 1 (the number of elements in the @_ array)...
> in a SCALAR
... into that scalar.
> ...where later he
> would use that reference as needed...
>
> i am obviosuly missing sometihing here...
The argument passing in the call was fine.
The argument grabbing in the sub definition was not fine.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 23:04:25 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Really?
Message-Id: <slrncpqvmp.6aa.tadmc@magna.augustmail.com>
Matija Papec <perl@my-header.org> wrote:
> Octo Mancer <wh@tever.tld> wrote:
>>It seems that talking bollocks about Perl is not confined to graduate
>>students ...
>>
>>http://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci214291,00.html
>
> So you actually have something to say
I expect he was trying to say that Perl *mis*information is
widespread, along with an example that I found a bit amusing.
> or just want to populate killfile?
Huh?
I didn't see anything remotely killfilable in the OP.
What did you see?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 19 Nov 2004 06:22:06 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Really?
Message-Id: <slrncpr0nu.qg.tassilo.von.parseval@localhost.localdomain>
Also sprach Tad McClellan:
> Matija Papec <perl@my-header.org> wrote:
>> Octo Mancer <wh@tever.tld> wrote:
>
>>>It seems that talking bollocks about Perl is not confined to graduate
>>>students ...
>>>
>>>http://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci214291,00.html
>>
>> So you actually have something to say
>
>
> I expect he was trying to say that Perl *mis*information is
> widespread, along with an example that I found a bit amusing.
I don't see any misinformation in the quoted paragraph.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 19 Nov 2004 00:26:59 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Really?
Message-Id: <slrncpr4hj.6n3.tadmc@magna.augustmail.com>
Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote:
> Also sprach Tad McClellan:
>
>> Matija Papec <perl@my-header.org> wrote:
>>> Octo Mancer <wh@tever.tld> wrote:
>>
>>>>It seems that talking bollocks about Perl is not confined to graduate
>>>>students ...
>>>>
>>>>http://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci214291,00.html
>>>
>>> So you actually have something to say
>>
>>
>> I expect he was trying to say that Perl *mis*information is
>> widespread, along with an example that I found a bit amusing.
>
> I don't see any misinformation in the quoted paragraph.
Click on the "SED" link and you'll see that it is not "sed".
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 23:35:18 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regex challange: collapse nested {} blocks
Message-Id: <slrncpr1gm.6ff.tadmc@magna.augustmail.com>
ken <ken@nospam.org> wrote:
> Okay, I thought this might be a problem that has been addressed,
It is a Question that is Asked Frequently. :-)
> I have source code files with blocks
> denoted by {}.
> I want hide to (or collapse) all code blocks at a depth > N.
> Any help
> would be appreciated.
perldoc -q balanced
Can I use Perl regular expressions to match balanced text?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 22:27:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: the antichomp
Message-Id: <slrncpqthn.6aa.tadmc@magna.augustmail.com>
wana <ioneabu@yahoo.com> wrote:
> To install, I had to copy the File directory from lib to use it
> because I am on a shared server where I don't have root access, so
> make install won't work for me.
You do not need to be root to install modules.
perldoc -q module
How do I keep my own module/library directory?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Nov 2004 22:29:21 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: the antichomp
Message-Id: <slrncpqtl1.6aa.tadmc@magna.augustmail.com>
wana <ioneabu@yahoo.com> wrote:
> Uri Guttman wrote:
>> and if you have your lines in an array then this is how you would do it:
>> write_file( 'my_file_with_newlines', map "$_\n", @array );
> I would not thought of it myself (the use of map), but now I will.
If you want to "transform a list", use map().
If you want to "filter a list", use grep().
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7424
***************************************