[24501] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6681 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 11 14:05:48 2004

Date: Fri, 11 Jun 2004 11:05:08 -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, 11 Jun 2004     Volume: 10 Number: 6681

Today's topics:
    Re: $array.fieldname question <jurgenex@hotmail.com>
    Re: 'my' doesn't totally isolate ctcgag@hotmail.com
    Re: 'my' doesn't totally isolate ctcgag@hotmail.com
        ActivePerl and Expect question (Dipak Prasad)
        ActivePerl and Expect question (Dipak Prasad)
    Re: ActivePerl and Expect question (Kevin Collins)
    Re: Extracting Text <postmaster@castleamber.com>
    Re: Extracting Text (J. Romano)
    Re: Extracting Text <postmaster@castleamber.com>
    Re: Magic var for Current "Index" in array within loop? <lawrence.tierney@bipsolutions.com>
    Re: match aaa but not 123aaa (Kevin Collins)
    Re: Microsoft Word and Perl (Ilaiyarasan)
    Re: Negative Look Ahead question? ctcgag@hotmail.com
    Re: parsing file name assigning extension to a variable (Alexander Heimann)
    Re: parsing file name assigning extension to a variable (Randal L. Schwartz)
    Re: parsing file name assigning extension to a variable <postmaster@castleamber.com>
    Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ };  ctcgag@hotmail.com
    Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ };  (Anno Siegel)
    Re: perl IF DBI::errsrt (Kevin Collins)
        PerlNet & DateTime.pm (Adalid Claure)
    Re: reverse IP lookup for check all doimains on the ser <wherrera@lynxview.com>
    Re: SOAP::Lite using HTTPS as a transport? <vek@station02.ohout.pharmapartners.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 11 Jun 2004 14:04:23 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: $array.fieldname question
Message-Id: <HZiyc.12088$H65.534@nwrddc02.gnilink.net>

ZZT wrote:
> okay, I have an ini-file looks like this:

There are modules on CPAN to read INI files.
Did you check those?

> #in result I create an array for the section names
> @sections=("def","ref");
> #while $sections[1] then eq to "ref" for instance

> # following variables should then be defined
> $def.var1=value1;
> $def.var2=value2;
> $ref.var1=value3;
> $ref.var2=value4;

That is impossible because it is not Perl.
Perl does not use the dot notation. Maybe you are confusing Perl with Pascal
or Modula?

> #then I'd like to apply several routines with the help of this
> variables foreach (@sections)
> {
>    function1 ($$_.var1);      # -> function1($def.var1);

I smell symbolic references. Please check the FAQ (perldoc -q "variable
name") and Google about why this is a very bad idea.

> How can I do this?

Instead of telling you how to shoot yourself in the foot I'd rather suggest
to use a better data structure like a hash (for each section in the INI
file) of hashes (for each definition within a section).

jue




------------------------------

Date: 11 Jun 2004 15:16:27 GMT
From: ctcgag@hotmail.com
Subject: Re: 'my' doesn't totally isolate
Message-Id: <20040611111627.899$aW@newsreader.com>

jbrock@panix.com (John Brock) wrote:
> In article <2isfpnFq4pbsU1@uni-berlin.de>,
> Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote:
> >John Brock wrote:
> >> I seem to have misunderstood something about 'my'.
>
> >You have rather misunderstood something about the defined() function.
> >
> >     perldoc -f defined
>
> Hmmm....   So how am I supposed to distinguish between an array
> which has not been assigned to and one whose length just happens
> to be zero?

How am I supposed to distinguish between an array that never held elements
summing up to 19856, versus an array that used to, but now doesn't, hold
elements that summed to 19856?

Perhaps if you can explain what you are trying to accomplish through
making this distinction, we could suggest a better way to accomplish it.

> Also, I can still get the behavior I expected by using undef() on
> the array in question after I define it with 'my', but I am not
> sure why this works if undefined() simply tells me whether memory
> for the array has *ever* been allocated.  Can I trust this behavior?

No.  If you want to have a status variable, make an explicit one.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 11 Jun 2004 15:24:14 GMT
From: ctcgag@hotmail.com
Subject: Re: 'my' doesn't totally isolate
Message-Id: <20040611112414.275$89@newsreader.com>

jbrock@panix.com (John Brock) wrote:
> In article <x78yeuakff.fsf@mail.sysarch.com>,
> Uri Guttman  <uri@stemsystems.com> wrote:
>
> >you are not making much sense here. why should you care if an array was
> >allocated or not? it is not a useful boolean as you have little control
> >over it. what control you see is an undocumented side effect and may go
> >away.
>
> If would be a useful boolean if I did have control over it.  What
> I've learned here is that I don't.  Too bad.  Live and learn.

You could always use references.  Then you can distinguish an undefined
scalar versus a scalar with reference to an empty array.  This leads to
very intricate code with hard to find bugs, but if the fundamental problem
is very intricate with subtle logic traps, then that is just the nature of
the beast.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 11 Jun 2004 06:53:25 -0700
From: dipakprasad@hotmail.com (Dipak Prasad)
Subject: ActivePerl and Expect question
Message-Id: <6ab178e3.0406110553.41658947@posting.google.com>

Hi

I have a question regarding ActivePerl and Expect.  I am working with
already existing ActivePerl (5.6.1 Build 635) s/w for Windows.  I need
to integrate and automate an interactive CLI-Menu driven 3rd party s/w
to the ActivePerl s/w.  I was planning to do that using Expect, when I
found out that Expect is not supported by ActivePerl.  My question is
there something equivalent to Expect provided by ActivePerl (I have
never used Active Perl before), and/or is there a way to make Expect
work with ActivePerl?

Thank


------------------------------

Date: 11 Jun 2004 06:54:11 -0700
From: dipakprasad@hotmail.com (Dipak Prasad)
Subject: ActivePerl and Expect question
Message-Id: <6ab178e3.0406110554.1c4e14f5@posting.google.com>

Hi

I have a question regarding ActivePerl and Expect.  I am working with
already existing ActivePerl (5.6.1 Build 635) s/w for Windows.  I need
to integrate and automate an interactive CLI-Menu driven 3rd party s/w
to the ActivePerl s/w.  I was planning to do that using Expect, when I
found out that Expect is not supported by ActivePerl.  My question is
there something equivalent to Expect provided by ActivePerl (I have
never used Active Perl before), and/or is there a way to make Expect
work with ActivePerl?

Thanks

Dipak Prasad


------------------------------

Date: Fri, 11 Jun 2004 17:17:40 GMT
From: spamtotrash@toomuchfiction.com (Kevin Collins)
Subject: Re: ActivePerl and Expect question
Message-Id: <slrnccjq9j.q1h.spamtotrash@doom.unix-guy.com>

In article <6ab178e3.0406110554.1c4e14f5@posting.google.com>, Dipak Prasad
wrote:
> Hi
> 
> I have a question regarding ActivePerl and Expect.  I am working with
> already existing ActivePerl (5.6.1 Build 635) s/w for Windows.  I need
> to integrate and automate an interactive CLI-Menu driven 3rd party s/w
> to the ActivePerl s/w.  I was planning to do that using Expect, when I
> found out that Expect is not supported by ActivePerl.  My question is
> there something equivalent to Expect provided by ActivePerl (I have
> never used Active Perl before), and/or is there a way to make Expect
> work with ActivePerl?

Are your referring to the Perl Expect module (i.e., Perl::Expect or Expect.pm)
or are you talking about the extension of the Tcl programming languange called
Expect? The former is based (I expect - pun intended!) on the latter, but they
are different things.

Kevin


------------------------------

Date: Fri, 11 Jun 2004 09:39:06 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Extracting Text
Message-Id: <40c9c40d$0$22544$58c7af7e@news.kabelfoon.nl>



Tore Aursand wrote:

> On Fri, 11 Jun 2004 11:08:59 +0000, Anno Siegel wrote:
> 
>>>>next unless ( index($_, 'GO:000') >= 0 );
> 
> 
>>>index($_, 'GO:000') > -1 or next;
> 
> 
>>1 + index $_, 'GO:000' or next;
> 
> 
> While we're at it: How about keeping those two lines (the check and the
> print) on one line?
> 
>   while ( <> ) {
>       index($_, 'GO:000') and print;
>   }

what if $_ is 'GO:000' ?

-- 
John                               MexIT: http://johnbokma.com/mexit/
                            personal page:       http://johnbokma.com/
    Experienced Perl programmer available:     http://castleamber.com/
             Happy Customers: http://castleamber.com/testimonials.html


------------------------------

Date: 11 Jun 2004 08:31:13 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Extracting Text
Message-Id: <b893f5d4.0406110731.4aed958e@posting.google.com>

jakegottlieb@hotmail.com (Jake Gottlieb) wrote in message news:<986e0b6a.0406100819.14848438@posting.google.com>...

> I am trying to extract lines with:  
> 
> GO:0009986
> 
> out of:
> 
> ENSG00000113494.3	AAA60174.1	GO:0009123	5618	216638_s_at
> ENSG00000113494.3	AAD32032.1	GO:0009345	5618	216638_s_at
> ENSG00000113494.3	AAK32703.1	GO:0009764	5618	216638_s_at
> ENSG00000113494.3	AAH59392.1	GO:0009986	5618	216638_s_at
<snip>

   If all you want is to print out the lines that contain
"GO:0009986", you can just use the "grep" command (if you happen to be
on UNIX):

   grep "GO:0009986" file.txt

If you really want to use Perl for this task, you can use a one-liner
that's almost as simple:

   perl -ne "print  if /GO:0009986/" file.txt

If that looks confusing to you, let me offer a short explanation:

   The -ne switch tells perl to run the "print  if /GO:0009986/"
command on every line of file.txt (with $_ as the current line). 
Since the "print" statement has no arguments, it defaults to $_. 
Therefore, the above line is identical to:

   perl -ne  '$line = $_; print $line if /GO:0009986/'  file.txt

which means that, for every line, that line will only get printed if
the string "GO:0009986" is found in that line.

   But it's not entirely clear to me if you wanted to search for the
exact string "GO:0009986" or just any string that matched "GO:" and
any seven digits.  If the latter is the case, you can use the
following:

On Unix:
   perl -ne 'print  if /GO:\d{7}/' file.txt
On Win32:
   perl -ne "print  if /GO:[0-9]{7}/" file.txt

   I hope this helps!

   -- Jean-Luc


------------------------------

Date: Fri, 11 Jun 2004 12:20:36 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Extracting Text
Message-Id: <40c9e9e4$0$206$58c7af7e@news.kabelfoon.nl>

J. Romano wrote:

>    If all you want is to print out the lines that contain
> "GO:0009986", you can just use the "grep" command (if you happen to be
> on UNIX):
> 
>    grep "GO:0009986" file.txt

the grep family is available on Windows, and many more OSes.


-- 
John                               MexIT: http://johnbokma.com/mexit/
                            personal page:       http://johnbokma.com/
    Experienced Perl programmer available:     http://castleamber.com/
             Happy Customers: http://castleamber.com/testimonials.html


------------------------------

Date: Fri, 11 Jun 2004 16:50:09 +0100
From: "Lord0" <lawrence.tierney@bipsolutions.com>
Subject: Re: Magic var for Current "Index" in array within loop?
Message-Id: <jwkyc.215$yD6.191@newsfe6-win>

> I forgot congratuate Lawrence on getting the best subject line of the
> 4.  Good subject lines and search engines are the secret to effective
> Usenet.  Lawrence may have forgotten to use a search engine himself
> but at least he's done his bit to help the next person who does.

Cheers for the backhanded compliment




------------------------------

Date: Fri, 11 Jun 2004 16:41:16 GMT
From: spamtotrash@toomuchfiction.com (Kevin Collins)
Subject: Re: match aaa but not 123aaa
Message-Id: <slrnccjo5c.q1h.spamtotrash@doom.unix-guy.com>

In article <L7-cnZoOaeEUwlTdRWPC-w@speakeasy.net>, Ken Sington wrote:
> Tad McClellan wrote:
>> Ken Sington <ken_sington@nospam_abcdefg.com> wrote:
>> 
>>>Jay Tilton wrote:
>> 
>> 
>>>>    /(?<!123)YaaaY/
>> 
>> 
>>>now to find out what ?<! means...
>> 
>> 
>> 
>> It is actually a 4-character opening token (?<! and a 1-char close token )
>> 
>> See "zero-width negative look-behind assertion" in perlre.pod.
>> 
>> 
> 
> I noticed in:
> s/(?<!123)(1)(2)(3)/$1$2$3/
> the first set of () dosen't seem to count.
> I would have expected a forth one to be $4
> what happened to $4? or should I say -$1?

The 1st set of parens "(?< ... )" are non-capturing, as are all of the other (I
believe) "(? ... )" extended patterns. For more info, see the section "Extended
Patterns" in 'perldoc perlre'.

Kevin


------------------------------

Date: 11 Jun 2004 08:12:11 -0700
From: Ilaiy@hotmail.com (Ilaiyarasan)
Subject: Re: Microsoft Word and Perl
Message-Id: <1980fc05.0406110712.39be97ce@posting.google.com>

I think it still gives me a problem 

my $newdoc = $word->ActiveDocument;
foreach my $obj_Story ($newdoc->StoryRanges ){
	$obj_Story->Fields->Update;
	    while (my $obj_Story = $obj_Story->NextStoryRange){
	    	$obj_Story->Fields->Update;
	    }
	    	
It srill gave me the same error i am not sure why it is doing that
because it works perfectly in VB but when you get the same code in
Perl it kind of acts really stange..

Ilaiy 

Ben Morrow <usenet@morrow.me.uk> wrote in message news:<cabdue$og7$4@wisteria.csv.warwick.ac.uk>...
> Quoth Ilaiy@hotmail.com (Ilaiyarasan):
> > I have been trying to update my word document using perl, i used 
> > 
> > $word->Selection->WholeStory;
> > $word->Selection->Fields->{Update};
> > 
> > But this is a little slow and at times doesnot update completely. I
> > modified the code and right now getting a wired error but the same in
> > VBA works really well .
> > 
> > my $newdoc = $word->ActiveDocument;
> > foreach my $obj_Story ($newdoc->StoryRanges ){
> > 	$obj_Story->Fields->{Update};   ==> Cannot find object 
> 
> I don't know much about OLE, but surely that should be
> 
> $obj_Story->Fields->update;
> 
> ? update is a method, not a property.
> 
> > 	while ($obj_Story->NextStoryrange != ""){
>                                     ^^
>                                     R, surely?
> 
> > 		$obj_Story = $obj_Story->NextStoryRange;
> > 		$obj_Story->Fields->{Update};    ==> Cannot find object 
> > 	}
> 
> I would write that loop the other way round:
> 
> $obj_Story->Fields->update
>     while $obj_Story = $obj_Story->NextStoryRange;
> 
> That way you don't need the extra statement before the loop.
> 
> > The equivalent in VBA is .. 
> > 
> >     Dim obj_Story As Range
> >     For Each obj_Story In ActiveDocument.StoryRanges
> >         obj_Story.Fields.update
> >         While Not (obj_Story.NextStoryRange Is Nothing)
> >             Set obj_Story = obj_Story.NextStoryRange
> >                 obj_Story.Fields.update
> >         Wend
> >     Next obj_Story
> >         Set obj_Story = Nothing
> 
> Ben


------------------------------

Date: 11 Jun 2004 15:45:29 GMT
From: ctcgag@hotmail.com
Subject: Re: Negative Look Ahead question?
Message-Id: <20040611114529.675$ER@newsreader.com>

simon.fairey@ft.com (Simon Fairey) wrote:
> Why does the following not work unless I put foo before the (?!)
> portion,

It works perfectly.  You just don't understand what it is doing.

> I have strings and I want to match all strings (I know
> nothing about the content of the strings) that don't contain a certain
> phrase but I have to use a negative RE rather than negating a positive
> RE

Why do you have to do it the way that doesn't work, rather than the way
that does work?  If you have artificial restrictions on what you can do,
you had best explain what they are in more detail that this, otherwise how
can we help?

>
> foreach(qw(foobar fooboo)){
>   print "Checking <$_>....";
>   if(/(?!bar)/){
>     print "Match\n";
>   }else{
>     print "No Match\n";
>   }
> }

While "foo" has a "bar" immediately after it, the empty string at the start
of "foobar" does not have a "bar" immediately after it, so that empty
string is what matches.  Of course, it could find the empty string between
f and o, or the one between o and o, if for reason it didn't stop at the
first one.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 11 Jun 2004 08:07:51 -0700
From: AlexanderHeimann@yahoo.com (Alexander Heimann)
Subject: Re: parsing file name assigning extension to a variable
Message-Id: <1c63154d.0406110707.8c5a4c1@posting.google.com>

"gnari" <gnari@simnet.is> wrote in message news:<caat96$7ne$1@news.simnet.is>...
> "Alexander Heimann" <AlexanderHeimann@yahoo.com> wrote in message
> news:1c63154d.0406101601.29f1448f@posting.google.com...
> 
> [snip problem without actual question]
> 
> > 1. open directory..
> > 2. go file by file
> > 3  assign extension of file to a variable @recordNum
> 
> $recordNum ?
> 
> > 4  assign contents of file to a variable @content
> 
> $content ?
> 
> > 5  then insert content with SQL statement where PK = @recordNum
> 
> ditto
> 
> > 6  then do next file until end of directory
> 
> sounds good. go for it and let us know how it goes.
> 
> gnari
thanks everyone for all your help. i will let you guys know how it goes.

have an awesome weekend...


------------------------------

Date: Fri, 11 Jun 2004 15:56:34 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: parsing file name assigning extension to a variable
Message-Id: <4d7a928255dd1d7f546d185990aa05b9@news.teranews.com>

>>>>> "Tore" == Tore Aursand <tore@aursand.no> writes:

Tore> On Thu, 10 Jun 2004 19:54:58 -0500, John Bokma wrote:
>> [...]
>> Or File::Find

Tore> ...or File::Find::Rule, which I find a lot easier to work with. :)

 ... or File::Finder, which is at least two characters shorter. :)

-- 
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: Fri, 11 Jun 2004 12:25:01 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: parsing file name assigning extension to a variable
Message-Id: <40c9eaed$0$206$58c7af7e@news.kabelfoon.nl>

Randal L. Schwartz wrote:

>>>>>>"Tore" == Tore Aursand <tore@aursand.no> writes:
> 
> Tore> On Thu, 10 Jun 2004 19:54:58 -0500, John Bokma wrote:
> 
>>>[...]
>>>Or File::Find
> 
> 
> Tore> ...or File::Find::Rule, which I find a lot easier to work with. :)
> 
> ... or File::Finder, which is at least two characters shorter. :)

More on my list to check out :-D. Thanks.

-- 
John                               MexIT: http://johnbokma.com/mexit/
                            personal page:       http://johnbokma.com/
    Experienced Perl programmer available:     http://castleamber.com/
             Happy Customers: http://castleamber.com/testimonials.html


------------------------------

Date: 11 Jun 2004 15:32:01 GMT
From: ctcgag@hotmail.com
Subject: Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ }; print keys %h'
Message-Id: <20040611113201.974$ND@newsreader.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
> No, the elements returned from "keys" aren't lvalues. "perldoc
> -f keys" explicitly says so:
>
>                The returned values are copies of the original
>                keys in the hash, so modifying them will not
>                affect the original hash.  Compare "values".
>
> ("values" *does* return lvalues.)

I think that they are lvalues, they just aren't lvalues tied
to the original keys.   They are anonymous (if you don't
count the alias) independent lvalues.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 11 Jun 2004 16:18:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ }; print keys %h'
Message-Id: <cacm05$2nt$1@mamenchi.zrz.TU-Berlin.DE>

 <ctcgag@hotmail.com> wrote in comp.lang.perl.misc:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> >
> > No, the elements returned from "keys" aren't lvalues. "perldoc
> > -f keys" explicitly says so:
> >
> >                The returned values are copies of the original
> >                keys in the hash, so modifying them will not
> >                affect the original hash.  Compare "values".
> >
> > ("values" *does* return lvalues.)
> 
> I think that they are lvalues, they just aren't lvalues tied
> to the original keys.   They are anonymous (if you don't
> count the alias) independent lvalues.

You are right in that they are assignable (and a good thing that is too).
What I meant was, of course, "assignable with an effect on the original
hash".

Lvalue hash keys, in that sense, would be a bad idea anyway.  If a
key is assigned a string that already exists in the hash, one of the
corresponding values has to go.  It is by no means clear which one,
but whichever you choose, there is an occasional side effect on the
hash's values.  Not an operation I'd like to see in a language.

Anno


------------------------------

Date: Fri, 11 Jun 2004 17:08:18 GMT
From: spamtotrash@toomuchfiction.com (Kevin Collins)
Subject: Re: perl IF DBI::errsrt
Message-Id: <slrnccjpo2.q1h.spamtotrash@doom.unix-guy.com>

In article <841xkms3lg.fsf@notvalid.se>, moller@notvalid.se wrote:
> Xaver Biton <javier@t-online.de> writes:
> 
>> Hi,
>> 
>> I'writing a program which will be used to migrate a mysql DB to
>> another mysql DB.
>> 
>> Because the data quantity is relative big, if an arror occur while
>> inserting a record  in the new db I would like to deviate this record
>> error table.
>> 
>> How ban achive that.
>> If someone could make a little example I would be grathefull.
> 
> Not an answer to your question but..
> 
> In cases like this it's *almost* *always* better to use
> the tools provided by the database.

No, in cases like *this*, it is next to impossible to use the tools provided by
the database. The OP said he wants to do something when an error occurs (other
than fail, which is what would happen) and the tools provided by MySQL don't
support that.

> From webpage:
> "The mysqldump client can be used to dump a database or a collection of
>  databases for backup or for transferring the data to another SQL server
>  (not necessarily a MySQL server). The dump will contain SQL statements
>  to create the table and/or populate the table. "
> 
> Start reading here if interested.
> http://dev.mysql.com/doc/mysql/en/mysqldump.html

Kevin


------------------------------

Date: 11 Jun 2004 09:26:49 -0700
From: zethon@gmail.com (Adalid Claure)
Subject: PerlNet & DateTime.pm
Message-Id: <3a50d96f.0406110826.2b588c6e@posting.google.com>

Hello,

I am using PerlNet for a project and am attempting to use Perl's
DateTime module, but I am having problems.

Perl
--------------------
package Foo;

use strict;
use DateTime;


=for interface
    [interface: pure]
 static Foo();
=cut

sub new {
    my($package) = @_;

    return bless {}, $package;
}

1;


in the C#
------------------
Foo foovar = new Foo(); // throws an exception


This will compile just fine. However when I try to use it from C#, I
get an exception: "An unhandled exception of type
'System.NullReferenceException' occurred in perlrt.dll"

This is the only module I've found (so far?) causing this problem. Or
am I doing something wrong and can't see it?


------------------------------

Date: Fri, 11 Jun 2004 07:38:56 -0600
From: Bill <wherrera@lynxview.com>
Subject: Re: reverse IP lookup for check all doimains on the server
Message-Id: <jomdnV-SjJRlKFTdRVn-sQ@adelphia.com>

PHP2 wrote:
> Have someone any idea what I must to do?
> 
> if I add some IP of server that I can see all domains on the same IP on the
> server.
> 
> like here: http://whois.webhosting.info/216.127.92.54
> 
> Mario
> 
> 
Have you seen the docs for Net::DNS?

use Net::DNS;
my $res   = Net::DNS::Resolver->new;
my $query = $res->query("example.com", "NS");

if ($query) {
     foreach $rr (grep { $_->type eq 'NS' } $query->answer) {
         print $rr->nsdname, "\n";
     }
}
else { warn "query failed: ", $res->errorstring, "\n" }

-hth



------------------------------

Date: 11 Jun 2004 13:42:13 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: SOAP::Lite using HTTPS as a transport?
Message-Id: <slrnccjdll.3kd.vek@station02.ohout.pharmapartners.nl>

On Fri, 11 Jun 2004 11:23:29 +0000 (UTC),
    Ben Morrow <usenet@morrow.me.uk> wrote:


>
> Quoth josh.kuo@prioritynetworks.net (josh):
>> According to http://cookbook.soaplite.com/, it should be as easy as
>> this:
>> 
>> my ( $soap ) = SOAP::Lite
>>       -> uri('Demo')
>> #      -> proxy('http://localhost/cgi-bin/soap.cgi')
>>       -> proxy('https://localhost/cgi-bin/soap.cgi')
>> 
>> But this is the error I get:
>> 
>> 500 Can't locate object method "new" via package
>> "LWP::Protocol::https::Socket" at ./client.pl line 8
>> 
>> I am running Mandrake 10.0 Community, with all default RPMs (urpmi
>> perl-SOAP-Lite).
>> 
>> My goal is to have secure (preferrably SSL) communication between the
>> SOAP server and client(s). Is there a better way than HTTPS? I just
>> thought HTTPS makes a natural choice since I already got HTTP working.
>
> What version of LWP do you have? I have 5.76, and that has an
> LWP::Protocol::https::Socket class with a new method.
>
> Try
>
> perl -MLWP -le'print $LWP::VERSION'
>
> and
>
> perl -MLWP::Protocol::https -le'print
>     LWP::Protocol::https::Socket->can("new")'
>
> . If the first prints something less than 5.76 and the second prints
> nothing then upgrade LWP. If the second prints CODE(0xXXXXXXXX) then
> your problem is elsewhere.
>
> Ben
>

$ perl -MLWP -le'print $LWP::VERSION'
5.69

That version also works with SOAP::Lite.  The SSLeay module version may also
be important.

$ perl -MNet::SSLeay -le'print $Net::SSLeay::VERSION'
1.25
$ perl -MCrypt::SSLeay -le'print $Crypt::SSLeay::VERSION'
0.51

Either one of the SSLeay modules should work, but only one of
them supports proxy servers using the CONNECT protocol.  I beleive
Crypt::SSLeay is required for proxy support.


Villy


------------------------------

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 6681
***************************************


home help back first fref pref prev next nref lref last post