[28263] in Perl-Users-Digest
Perl-Users Digest, Issue: 9627 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 19 00:05:43 2006
Date: Fri, 18 Aug 2006 21:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 18 Aug 2006 Volume: 10 Number: 9627
Today's topics:
Composite Class Help - Can't access object's member dat <Brett.R.Davis@gmail.com>
Re: Composite Class Help - Can't access object's member Leah.M.Davis@gmail.com
Re: Composite Class Help - Can't access object's member <1usa@llenroc.ude.invalid>
Re: Composite Class Help - Can't access object's member <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: FAQ 4.33 How do I pad a string with blanks or pad a <bdalzell@qis.net>
Re: get() not working...need help <benmorrow@tiscali.co.uk>
Re: How to install module when I am not allowed to inst <Brett.R.Davis@gmail.com>
Re: How to install module when I am not allowed to inst <jurgenex@hotmail.com>
Re: How to install module when I am not allowed to inst <zaifengwang@gmail.com>
Re: How to install module when I am not allowed to inst <jurgenex@hotmail.com>
Re: How to install module when I am not allowed to inst <mgarrish@gmail.com>
Re: How to install module when I am not allowed to inst <mgarrish@gmail.com>
Re: HOW to rename a NPH script ? <umu@hrz.tu-chemnitz.de>
Perl5 AST romerun@gmail.com
Re: reverse dns <john@castleamber.com>
Re: reverse dns <benmorrow@tiscali.co.uk>
Re: Sort Keys in hash table? <zhushenli@gmail.com>
Re: who needs perl when you haev happs? <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Aug 2006 15:06:01 -0700
From: "Brett.R.Davis@gmail.com" <Brett.R.Davis@gmail.com>
Subject: Composite Class Help - Can't access object's member data (hash of arrays)
Message-Id: <1155938761.054958.311710@m73g2000cwd.googlegroups.com>
I need help please!
I cannot figure out what I am doing wrong while trying to access an
object's member data - a hash of arrays whose elements are objects of
another class.
The realtionship is:
LMI::Class::Register - has a - LMI::Class::Field stored in a hash of
arrays :
Declared in the LMI::Class:Register like
$self->{FIELDS} = {};
I get the following error messages when trying to access the objects
contained in the FIELD hash of arrays:
Pseudo-hashes are deprecated at
/home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
line 168.
Use of uninitialized value in hash element at
/home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
line 168.
Bad index while coercing array into hash at
/home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
line 168.
FIELDS contains a hash of arrays containing Field Objects (defined
after this method)
# begin code
sub write_field {
my $self = shift;
my $field = shift;
my $symbolic = shift;
my $special;
if (exists $self->{FIELDS}{$field}) {
foreach my $f_obj (@{$self->{FIELDS}{$field}}) {
if (defined $f_obj->{SPECIALS}) {
#Line 168
foreach $special ($f_obj->specials()) {
if (exists $self->{F_TABLE}{$special}) {
$f_obj->data($symbolic);
$self->{DATA} = $self->{DATA} |
$f_obj->get_vector($self->{SIZE});
return 1;
}
}
}
else {
$f_obj->data($symbolic);
$self->{DATA} = $self->{DATA} |
$f_obj->get_vector($self->{SIZE});
return 1;
}
}
}
return 0;
}
When I run Data::Dumper on $f_obj I get:
$VAR1 = [
bless( {
'SIZE' => 4,
'SPECIALS' => undef,
'NAME' => 'VER',
'DESCRIPTION' => 'This field defines the version of
the DID1 register format',
'VECTOR' => undef,
'DATA' => '0',
'MASK' => 4026531840,
'SYMBOLS' => {
'Fury_ib' => '1',
'Stellaris_ib' => '0'
}
}, 'LMI::Class::Field' )
];
When I run Data::Dumper on the container object (contains above object)
$VAR1 = bless( {
'SIZE' => 32,
'SPECIALS' => [
undef,
undef
],
'NAME' => 'DID1',
'ADDR_OFFSET' => 4,
'F_TABLE' => {},
'FLAGS' => undef,
'IBADDR' => 0,
'DESCRIPTION' => 'Device Identification 1',
'DATA' => 0,
'MASK' => 0,
'FIELDS' => {
'VER' => [
[
bless( {
'SIZE' => 4,
'SPECIALS' => undef,
'NAME' => 'VER',
'DESCRIPTION' =>
'This field defines the...',
'VECTOR' => undef,
'DATA' => '0',
'MASK' =>
4026531840,
'SYMBOLS' => {
'Fury_ib' => '1',
'Stellaris_ib' => '0'
}
}, 'LMI::Class::Field'
)
]
]
}
}, 'LMI::Class::Register' );
----------this is the class field constructor------
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{DESCRIPTION} = undef;
$self->{MASK} = undef;
$self->{SIZE} = undef;
$self->{DATA} = undef;
$self->{VECTOR} = undef;
$self->{SYMBOLS} = undef;
$self->{SPECIALS} = undef;
bless($self, $class); # but see below
return $self;
}
------------------this is the class register
constructor---------------------
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{NAME} = undef;
$self->{DESCRIPTION} = undef;
$self->{ADDR_OFFSET} = 0;
$self->{IBADDR} = 0;
$self->{SIZE} = 32;
$self->{DATA} = 0;
$self->{MASK} = 0;
$self->{FIELDS} = {};
$self->{SPECIALS} = undef;
$self->{F_TABLE} = {};
$self->{FLAGS} = undef;
bless($self, $class);
return $self;
}
------------------------------
Date: 18 Aug 2006 19:00:39 -0700
From: Leah.M.Davis@gmail.com
Subject: Re: Composite Class Help - Can't access object's member data (hash of arrays)
Message-Id: <1155952839.077352.309950@h48g2000cwc.googlegroups.com>
thank you - i will try to boil it down to a specific case.
Mumia W. wrote:
> On 08/18/2006 05:06 PM, Brett.R.Davis@gmail.com wrote:
> > [...]
> > I get the following error messages when trying to access the objects
> > contained in the FIELD hash of arrays:
> >
> > Pseudo-hashes are deprecated at
> > /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> > line 168.
> > Use of uninitialized value in hash element at
> > /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> > line 168.
> > Bad index while coercing array into hash at
> > /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> > line 168.
> >
> >
> > FIELDS contains a hash of arrays containing Field Objects (defined
> > after this method)
> >
> > # begin code
> > sub write_field {
> > my $self = shift;
> > my $field = shift;
> > my $symbolic = shift;
> > my $special;
> >
> > if (exists $self->{FIELDS}{$field}) {
> > foreach my $f_obj (@{$self->{FIELDS}{$field}}) {
> > if (defined $f_obj->{SPECIALS}) {
> > #Line 168
>
> According to the output from Data::Dumper below, $f_obj is an
> array reference, not a hash reference, so $f_obj->{SPECIALS}
> is invalid.
>
>
> > foreach $special ($f_obj->specials()) {
> > if (exists $self->{F_TABLE}{$special}) {
> > $f_obj->data($symbolic);
> > $self->{DATA} = $self->{DATA} |
> > $f_obj->get_vector($self->{SIZE});
> > return 1;
> > }
> > }
> > }
> > else {
> > $f_obj->data($symbolic);
> > $self->{DATA} = $self->{DATA} |
> > $f_obj->get_vector($self->{SIZE});
> > return 1;
> > }
> > }
> > }
> > return 0;
> >
> > }
> >
> > When I run Data::Dumper on $f_obj I get:
> >
> > $VAR1 = [
> > bless( {
> > 'SIZE' => 4,
> > 'SPECIALS' => undef,
> > 'NAME' => 'VER',
> > 'DESCRIPTION' => 'This field defines the version of
> > the DID1 register format',
> > 'VECTOR' => undef,
> > 'DATA' => '0',
> > 'MASK' => 4026531840,
> > 'SYMBOLS' => {
> > 'Fury_ib' => '1',
> > 'Stellaris_ib' => '0'
> > }
> > }, 'LMI::Class::Field' )
> > ];
> >
> > When I run Data::Dumper on the container object (contains above object)
> >
> > $VAR1 = bless( {
> > 'SIZE' => 32,
> > 'SPECIALS' => [
> > undef,
> > undef
> > ],
> > 'NAME' => 'DID1',
> > 'ADDR_OFFSET' => 4,
> > 'F_TABLE' => {},
> > 'FLAGS' => undef,
> > 'IBADDR' => 0,
> > 'DESCRIPTION' => 'Device Identification 1',
> > 'DATA' => 0,
> > 'MASK' => 0,
> > 'FIELDS' => {
> > 'VER' => [
> > [
> > bless( {
> > 'SIZE' => 4,
> > 'SPECIALS' => undef,
> > 'NAME' => 'VER',
> > 'DESCRIPTION' =>
> > 'This field defines the...',
> > 'VECTOR' => undef,
> > 'DATA' => '0',
> > 'MASK' =>
> > 4026531840,
> > 'SYMBOLS' => {
> >
> > 'Fury_ib' => '1',
> >
> > 'Stellaris_ib' => '0'
> > }
> > }, 'LMI::Class::Field'
> > )
> > ]
> > ]
> > }
> > }, 'LMI::Class::Register' );
> >
> > [...]
>
> Your program is not complete and runnable by others, and it's
> too long; I can't help you beyond the above.
------------------------------
Date: Sat, 19 Aug 2006 02:11:24 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Composite Class Help - Can't access object's member data (hash of arrays)
Message-Id: <Xns9823E1D3DE8C7asu1cornelledu@127.0.0.1>
Leah.M.Davis@gmail.com wrote in
news:1155952839.077352.309950@h48g2000cwc.googlegroups.com:
[ TOFU snipped ]
> thank you - i will try to boil it down to a specific case.
Please do not top-post. Please choose *one* posting handle and stick with
it. Please do read the posting guidelines and follow them. They help you
compose a post so as to maximize the help you can get.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sat, 19 Aug 2006 00:14:32 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Composite Class Help - Can't access object's member data (hash of arrays)
Message-Id: <IJsFg.7885$Qf.727@newsread2.news.pas.earthlink.net>
On 08/18/2006 05:06 PM, Brett.R.Davis@gmail.com wrote:
> [...]
> I get the following error messages when trying to access the objects
> contained in the FIELD hash of arrays:
>
> Pseudo-hashes are deprecated at
> /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> line 168.
> Use of uninitialized value in hash element at
> /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> line 168.
> Bad index while coercing array into hash at
> /home/bdavis/usr/local/lib/lib/perl5/site_perl/5.8.5/LMI/Class/Register.pm
> line 168.
>
>
> FIELDS contains a hash of arrays containing Field Objects (defined
> after this method)
>
> # begin code
> sub write_field {
> my $self = shift;
> my $field = shift;
> my $symbolic = shift;
> my $special;
>
> if (exists $self->{FIELDS}{$field}) {
> foreach my $f_obj (@{$self->{FIELDS}{$field}}) {
> if (defined $f_obj->{SPECIALS}) {
> #Line 168
According to the output from Data::Dumper below, $f_obj is an
array reference, not a hash reference, so $f_obj->{SPECIALS}
is invalid.
> foreach $special ($f_obj->specials()) {
> if (exists $self->{F_TABLE}{$special}) {
> $f_obj->data($symbolic);
> $self->{DATA} = $self->{DATA} |
> $f_obj->get_vector($self->{SIZE});
> return 1;
> }
> }
> }
> else {
> $f_obj->data($symbolic);
> $self->{DATA} = $self->{DATA} |
> $f_obj->get_vector($self->{SIZE});
> return 1;
> }
> }
> }
> return 0;
>
> }
>
> When I run Data::Dumper on $f_obj I get:
>
> $VAR1 = [
> bless( {
> 'SIZE' => 4,
> 'SPECIALS' => undef,
> 'NAME' => 'VER',
> 'DESCRIPTION' => 'This field defines the version of
> the DID1 register format',
> 'VECTOR' => undef,
> 'DATA' => '0',
> 'MASK' => 4026531840,
> 'SYMBOLS' => {
> 'Fury_ib' => '1',
> 'Stellaris_ib' => '0'
> }
> }, 'LMI::Class::Field' )
> ];
>
> When I run Data::Dumper on the container object (contains above object)
>
> $VAR1 = bless( {
> 'SIZE' => 32,
> 'SPECIALS' => [
> undef,
> undef
> ],
> 'NAME' => 'DID1',
> 'ADDR_OFFSET' => 4,
> 'F_TABLE' => {},
> 'FLAGS' => undef,
> 'IBADDR' => 0,
> 'DESCRIPTION' => 'Device Identification 1',
> 'DATA' => 0,
> 'MASK' => 0,
> 'FIELDS' => {
> 'VER' => [
> [
> bless( {
> 'SIZE' => 4,
> 'SPECIALS' => undef,
> 'NAME' => 'VER',
> 'DESCRIPTION' =>
> 'This field defines the...',
> 'VECTOR' => undef,
> 'DATA' => '0',
> 'MASK' =>
> 4026531840,
> 'SYMBOLS' => {
>
> 'Fury_ib' => '1',
>
> 'Stellaris_ib' => '0'
> }
> }, 'LMI::Class::Field'
> )
> ]
> ]
> }
> }, 'LMI::Class::Register' );
>
> [...]
Your program is not complete and runnable by others, and it's
too long; I can't help you beyond the above.
------------------------------
Date: 18 Aug 2006 21:04:30 -0700
From: "bdz" <bdalzell@qis.net>
Subject: Re: FAQ 4.33 How do I pad a string with blanks or pad a number with zeroes?
Message-Id: <1155960270.727802.254540@b28g2000cwb.googlegroups.com>
Thanks for the explaination and examples.
To clarify: $padded = sprintf("%0*d", $pad_len, $num);
When I tried it out in a short sample program:
## begin code ###
#!/usr/bin/perl
while (-1){
print "enter number of spaces: ";
$pad_len=<STDIN>;
chomp($pad_len);
print "enter number: ";
$num=<STDIN>;
chomp($num);
$padded = sprintf("%0*d", $pad_len, $num);
print "$padded\n";
}
### end code ###
yields a string of length $pad_length with the number of zeros added to
make it that length rather than adding $pad_length zeros to the left of
a number.
Is there anything one can do to preserve the leading zeros in the
string for later use, as in a file name for example, or do they have to
be generated whenever you need the string?
------------------------------
Date: Fri, 18 Aug 2006 23:12:41 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: get() not working...need help
Message-Id: <pjqhr3-jkg.ln1@osiris.mauzo.dyndns.org>
Quoth usenet@DavidFilmer.com:
> Matt Garrish wrote:
> > DF> Hmmm. I'm not familiar with the '...' command either.
> > You've seriously never encountered the range operator before? ; )
>
> Not as a standalone command (which is what the OP's 'code' showed).
> And it's not even semicolon terminated. Maybe that's a Perl6 thing...
IIRC it's known as the 'yadayadayada' operator...
Ben
--
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
benmorrow@tiscali.co.uk (Kate Rusby)
------------------------------
Date: 18 Aug 2006 15:14:01 -0700
From: "Brett.R.Davis@gmail.com" <Brett.R.Davis@gmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <1155939241.313436.98760@h48g2000cwc.googlegroups.com>
If you download the package manually, you can do it this way:
perl Makefile.PL PREFIX=/home/username/usr/local
make
make install
make test
This installs the package in your home direcotory, this implies that
you need to set the PERL5LIB variable which sets your user defined
include paths so that you can find it when you "use" the module.
zaifengwang@gmail.com wrote:
> I want to install module PDF::API2 under the environment of campus
> network - the administor does not allow me install this module
> system-wide.
>
> I used "PPM>set root u:\mydirectory" and "PPM>set build
> u:\mydirectory" to tell PPM that I want to install the module in my
> private directory, the result is as following:
> "unknown or ambiguous setting 'root'/'build'. see help setting".
>
> I appreciate very much if you can help me out with this question.
>
> James
------------------------------
Date: Fri, 18 Aug 2006 22:20:55 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <b3rFg.424$0J6.86@trnddc02>
zaifengwang@gmail.com wrote:
> I want to install module PDF::API2 under the environment of campus
> network - the administor does not allow me install this module
> system-wide.
Your Question is Asked Frequently: "perldoc -q module":
How do I keep my own module/library directory?
jue
------------------------------
Date: 18 Aug 2006 18:14:27 -0700
From: "pegasus" <zaifengwang@gmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <1155950067.725687.193450@75g2000cwc.googlegroups.com>
First of all, thanks a lot for you guys' help, but the problem is still
open...
To Matt:
As you predicted, those settings didn't work. I saw those settings from
the book "SAMS Teach Yourself Perl in 24 hours" Appendix A P431. In
fact, there are not such settings when I consult the "perldoc set". Is
there something wrong with this book? confusing.
I am under Windows so it's nothing to do with CPAN, I think.
To Brett:
Thanks for your information but I am in Windows instead of Unix so I
don't think your method will work.
To Jue:
Before I posted I have checked this FAQ but still it considered only
Unix environment rather than Windows, So I don't think that FAQ can
help me with this problem.
Matt Garrish wrote:
> zaifengwang@gmail.com wrote:
>
> > I want to install module PDF::API2 under the environment of campus
> > network - the administor does not allow me install this module
> > system-wide.
> >
> > I used "PPM>set root u:\mydirectory" and "PPM>set build
> > u:\mydirectory" to tell PPM that I want to install the module in my
> > private directory, the result is as following:
> > "unknown or ambiguous setting 'root'/'build'. see help setting".
> >
>
> Did you just make those settings up? I've never seen/heard of any root
> or build settings in ppm. Have a look at the documentation:
>
> http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html
>
> You'll need to go to the cpan shell if you want to build in a specific
> directory. PPM does have a target option, but that just allows you to
> pick a Perl distro to install the module for if you have multiple
> versions on your machine.
------------------------------
Date: Sat, 19 Aug 2006 01:59:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <OfuFg.254$E_.193@trnddc06>
[I'm not going to recreate the right thread with follow-ups and answers for
your reply]
pegasus wrote:
[In the context of how to install a module in a custom directory being
pointed to the FAQ "How do I keep my own module/library directory?"]
>
> Before I posted I have checked this FAQ but still it considered only
> Unix environment rather than Windows, So I don't think that FAQ can
> help me with this problem.
I may be wrong but I don't see anything in that FAQ that would be
Unix-specific.
jue
------------------------------
Date: 18 Aug 2006 20:49:00 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <1155959340.934232.280850@m73g2000cwd.googlegroups.com>
pegasus wrote:
[please don't top post]
> Matt Garrish wrote:
> > zaifengwang@gmail.com wrote:
> >
> > > I want to install module PDF::API2 under the environment of campus
> > > network - the administor does not allow me install this module
> > > system-wide.
> > >
> > > I used "PPM>set root u:\mydirectory" and "PPM>set build
> > > u:\mydirectory" to tell PPM that I want to install the module in my
> > > private directory, the result is as following:
> > > "unknown or ambiguous setting 'root'/'build'. see help setting".
> > >
> >
> > You'll need to go to the cpan shell if you want to build in a specific
> > directory. PPM does have a target option, but that just allows you to
> > pick a Perl distro to install the module for if you have multiple
> > versions on your machine.
>
> As you predicted, those settings didn't work. I saw those settings from
> the book "SAMS Teach Yourself Perl in 24 hours" Appendix A P431. In
> fact, there are not such settings when I consult the "perldoc set". Is
> there something wrong with this book? confusing.
>
Yes, most SAMS books aren't worth the paper they're printed on.
> I am under Windows so it's nothing to do with CPAN, I think.
There's nothing stopping you from using the CPAN shell on windows. CPAN
is the real Perl archive, ppm is just activestate's own package manager
and though the modules they provide are tested to work on Windows
they're often old and limited in number. I'm assuming that you have a
local account into this environment and can configure the shell to
install where you want. If not, then it will install to the default
Perl directories and if those are off-limits to you then you'll
probably run into problems.
[referencing make in another post]
>
> Thanks for your information but I am in Windows instead of Unix so I
> don't think your method will work.
>
Again, there are versions of make available for Windows. If you don't
have access to the CPAN shell or can't congifure it to build locally in
this environment you can always try building the modules on your own
computer and uploading them. This method is fraught with problems
though, as you may not have permission to run any compiled code that
goes along with the module and unless your environment and the remote
environment are identical you'll likely run into other bugs.
[reference to How do I keep my own module/library directory?]
> Before I posted I have checked this FAQ but still it considered only
> Unix environment rather than Windows, So I don't think that FAQ can
> help me with this problem.
>
Perl is Perl. What works on Unix generally works on Windows.
Matt
------------------------------
Date: 18 Aug 2006 20:50:00 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: How to install module when I am not allowed to install moudule in system directory?
Message-Id: <1155959400.314015.49580@m79g2000cwm.googlegroups.com>
pegasus wrote:
[please don't top post]
> Matt Garrish wrote:
> > zaifengwang@gmail.com wrote:
> >
> > > I want to install module PDF::API2 under the environment of campus
> > > network - the administor does not allow me install this module
> > > system-wide.
> > >
> > > I used "PPM>set root u:\mydirectory" and "PPM>set build
> > > u:\mydirectory" to tell PPM that I want to install the module in my
> > > private directory, the result is as following:
> > > "unknown or ambiguous setting 'root'/'build'. see help setting".
> > >
> >
> > You'll need to go to the cpan shell if you want to build in a specific
> > directory. PPM does have a target option, but that just allows you to
> > pick a Perl distro to install the module for if you have multiple
> > versions on your machine.
>
> As you predicted, those settings didn't work. I saw those settings from
> the book "SAMS Teach Yourself Perl in 24 hours" Appendix A P431. In
> fact, there are not such settings when I consult the "perldoc set". Is
> there something wrong with this book? confusing.
>
Yes, most SAMS books aren't worth the paper they're printed on.
> I am under Windows so it's nothing to do with CPAN, I think.
There's nothing stopping you from using the CPAN shell on windows. CPAN
is the real Perl archive, ppm is just activestate's own package manager
and though the modules they provide are tested to work on Windows
they're often old and limited in number. I'm assuming that you have a
local account into this environment and can configure the shell to
install where you want. If not, then it will install to the default
Perl directories and if those are off-limits to you then you'll
probably run into problems.
[referencing make in another post]
>
> Thanks for your information but I am in Windows instead of Unix so I
> don't think your method will work.
>
Again, there are versions of make available for Windows. If you don't
have access to the CPAN shell or can't congifure it to build locally in
this environment you can always try building the modules on your own
computer and uploading them. This method is fraught with problems
though, as you may not have permission to run any compiled code that
goes along with the module and unless your environment and the remote
environment are identical you'll likely run into other bugs.
[reference to How do I keep my own module/library directory?]
> Before I posted I have checked this FAQ but still it considered only
> Unix environment rather than Windows, So I don't think that FAQ can
> help me with this problem.
>
Perl is Perl. What works on Unix generally works on Windows.
Matt
------------------------------
Date: Sat, 19 Aug 2006 03:48:03 +0200
From: Ulrich Mueller <umu@hrz.tu-chemnitz.de>
Subject: Re: HOW to rename a NPH script ?
Message-Id: <Pine.LNX.4.64.0608190342340.7639@herein.hrz.tu-chemnitz.de>
let's shortly analyze this communication process:
1. I POSE A QUESTION
2. YOU ADVICE ME TO ASK SOMEWHERE ELSE (STILL KINDLY)
3. I TELL YOU I VE DONE SO ALREADY WITH NO LUCK, SO TRYING HERE (KINDLY)
4. YOU JUST REPEAT 2. WITHOUT ANY CONSIDERATION OF 3.
( maybe I got it wrong, as English is not my mothertongue,
but terms like "you didn't get it" , "get huffy" and "be off"
don't seem to be kindly advice anymore )
5. I'M STARTING OFF-TOPIC AS WELL
( sorry for adopting to this style that quickly )
... more flames
... filtering rules
... i read guidelines
... Sherm deescalates situation, thanks again
... I explain and excuse my posting
... You just GO ON with real insults "whine and cry like a baby ..."
So this thing gets me to the point where I suppose,
that between 3. and 4. you maybe misunderstood
" Child seems not to be grown up old enough
to participate in usenet, is it? "
This didn't refer to you (oooh, what an insult) but to mod_perl,
a child of mother apache and father perl,
and I just asked this way
if there is a newsgroup for mod_perl maybe,
sorry for my tries in poetry... :(
Ulrich
------------------------------
Date: 18 Aug 2006 17:31:27 -0700
From: romerun@gmail.com
Subject: Perl5 AST
Message-Id: <1155947487.366672.322600@m79g2000cwm.googlegroups.com>
Hi All,
I have been wondering for a long time if there exists any abstract
syntax tree parser for Perl5 or any attempt to create it. In the CPAN
there are some B:: modules that can give some kinds of Perl5 OP tree,
which loses some important information to do some static checking such
as type checking via type annotation, reference leaking, unreachable
code, etc. Any suggest on where should I look ?
-thanks
kem
------------------------------
Date: 18 Aug 2006 22:06:14 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: reverse dns
Message-Id: <Xns9823ADFAA6828castleamber@130.133.1.4>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "JB" == John Bokma <john@castleamber.com> writes:
>
> JB> axel@white-eagle.invalid.uk wrote:
> >> sihyung@gmail.com wrote:
> >>> Does anybody know how to perform a reverse dns that returns the
> >>> number of domains associated with a certain IP? Thanks
> >>
> >> No.
> >>
> >> DNS does not work that way... hint... domains do not have IP
> >> numbers.
>
> JB> What the OP means (guess) is that for a given IP address he
> wants to JB> get a list of all domains that are hosted on that
> address.
>
> JB> The Perl question could be, which CPAN module can be used to
> accomplish
>
> why even use a module? the getXXbyXX functions support basic reverse
> dns lookups.
Tested this, but it doesn't return virtual hosts on a given IP address. No
idea if Net::DNS suffers from the same problem.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: Sat, 19 Aug 2006 00:03:55 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: reverse dns
Message-Id: <rjthr3-12h.ln1@osiris.mauzo.dyndns.org>
Quoth John Bokma <john@castleamber.com>:
> Uri Guttman <uri@stemsystems.com> wrote:
>
> >>>>>> "JB" == John Bokma <john@castleamber.com> writes:
> >
> > JB> axel@white-eagle.invalid.uk wrote:
> > >> sihyung@gmail.com wrote:
> > >>> Does anybody know how to perform a reverse dns that returns the
> > >>> number of domains associated with a certain IP? Thanks
> > >>
> > >> No.
> > >>
> > >> DNS does not work that way... hint... domains do not have IP
> > >> numbers.
> >
> > JB> What the OP means (guess) is that for a given IP address he
> > wants to JB> get a list of all domains that are hosted on that
> > address.
> >
> > JB> The Perl question could be, which CPAN module can be used to
> > accomplish
> >
> > why even use a module? the getXXbyXX functions support basic reverse
> > dns lookups.
>
> Tested this, but it doesn't return virtual hosts on a given IP address. No
> idea if Net::DNS suffers from the same problem.
Well... yes. DNS Doesn't Work Like That. Given an IP address, all you
can do is look it up in .in-addr.arpa., in which case what you get is at
most one PTR to (if you're lucky) the canonical hostname for that
address.
The only way to find all the hostnames that resolve to a given ip is to
trawl the *whole* of the DNS and grep out the appropriate entries. Not
something I'd recommend trying... :)
Ben
--
Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read.
benmorrow@tiscali.co.uk Groucho Marx
------------------------------
Date: 18 Aug 2006 20:30:56 -0700
From: "Davy" <zhushenli@gmail.com>
Subject: Re: Sort Keys in hash table?
Message-Id: <1155958256.128784.253450@75g2000cwc.googlegroups.com>
Davy =E5=86=99=E9=81=93=EF=BC=9A
> A. Sinan Unur wrote:
> > "Davy" <zhushenli@gmail.com> wrote in news:1155768562.219578.123460
> > @i3g2000cwc.googlegroups.com:
> >
> > > I want to sort key in hash table.
> > > The hash table key format is some integer split with ";" like:
> > > "5;12;17;28"
> > > And I want to sort the key from the first integer to the last
> > > integer(i.e. the first integer has highest priority, and the second,
> > > third,... until the last):
> > >
> > > example:
> > > 5;12;17;28
> > > 5;13;15;2
> > > 5;13;18;1
> >
> > perldoc -f sort
> >
> > perldoc -q sort
> >
[snip]
Hi,
I have write a program based on my idea. And the program run well.
#---code begin---
use strict;
use warnings;
my $separator =3D ";";
my @data_list =3D (
"5;3;7",
"1;5;11",
"11;4;8",
"1;3;9"
);
my @data_sort =3D sort compare (@data_list);
print_1d_list(\@data_sort);
# input string like "5;3;14"
# compare the string from the first data to the last data
# i.e. 5->3->14
sub compare {
my @a_list =3D split /$separator/, $a;
my @b_list =3D split /$separator/, $b;
my $a_list_length =3D (@a_list); # prevent while from dead-loop
my $compare_result =3D 0; #equal
my $index =3D 0;
while ($compare_result =3D=3D 0) {
my $compare_result =3D ($a_list[$index] <=3D> $b_list[$index]);
if ($compare_result !=3D 0) {
return $compare_result;
}
else {
$index ++;
}
# prevent while from dead-loop
if ($index > $a_list_length) {
die("sort compare index overflow");
}
# Debug usage
# print "index =3D $index\n";
# print "compare_result =3D $compare_result\n";
}
}
sub print_1d_list {
my $list_ref =3D $_[0];
my @list =3D @{$list_ref};
foreach my $list_element (@list) {
print "$list_element\n";
}
}
#--- code end
Thanks!
Davy
> > perldoc Sort::Maker
> > http://search.cpan.org/~uri/Sort-Maker-0.05/Sort/Maker.pm
> [snip]
>
> Hi Sinan,
>
> Thank you for your help! I will try to use the Maker.pm.
> Because I want to learn Perl, I want to write routines. Anyone can
> recommend some references on this subject.
>
> Thanks!
> Davy
>
> >
> > Show us what you have tried after reading the above, tell us what is not
> > working, and we'll help.
> >
> > Sinan
> > --
> > A. Sinan Unur <1usa@llenroc.ude.invalid>
> > (remove .invalid and reverse each component for email address)
> >
> > comp.lang.perl.misc guidelines on the WWW:
> > http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 18 Aug 2006 22:18:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: who needs perl when you haev happs?
Message-Id: <51rFg.97$E_.33@trnddc06>
gavino wrote:
> What applications benefit from HAppS?
Maybe you want to ask in a NG that cares about HAppS (whatever that is)?
> HTTP requests and SMTP envelopes encapsulate transactions and not vice
> versa.
So? Why would Perl care about HTTP or SMTP? The one has nothing to do with
the other except that maybe a few people are use Perl to write applications
for web or mail servers.
jue
------------------------------
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 9627
***************************************