[18372] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 540 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 21 09:05:40 2001

Date: Wed, 21 Mar 2001 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985183510-v10-i540@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 21 Mar 2001     Volume: 10 Number: 540

Today's topics:
    Re: [Q] Avoid stripping of command line quotes (Abigail)
        find two, replace one <julle.ju@cnok.net>
    Re: find two, replace one (Rafael Garcia-Suarez)
    Re: find two, replace one <johnlin@chttl.com.tw>
    Re: find two, replace one (Tweetie Pooh)
    Re: find two, replace one (Bernard El-Hagin)
    Re: find two, replace one <julle.ju@cnok.net>
    Re: find two, replace one (Bernard El-Hagin)
    Re: find two, replace one <bart.lateur@skynet.be>
        form post parameter looks like directory but is a scrip d.lebbing@*no*spam*.iquip.nl
    Re: form post parameter looks like directory but is a s <ubl@schaffhausen.de>
    Re: Hash question (Rafael Garcia-Suarez)
    Re: Hash question (Bernard El-Hagin)
    Re: Hash question <ubl@schaffhausen.de>
    Re: How to sort ? <uri@sysarch.com>
    Re: IO::Select sel->add and array references <uri@sysarch.com>
    Re: perl Online/Offline status indicator needed (Abigail)
    Re: Print "tar" Success or Failure (BUCK NAKED1)
    Re: small question - reading/writing data structures to <jonni@ifm.liu.se>
        SOAP::Lite Server Error--? <david.sarno@yale.edu>
    Re: time calculation (Tweetie Pooh)
        Trouble compiling modules from CPAN <gusgaard@ementa.net>
    Re: usernames & passwords - how to ??? <ilya@is.sochi.ru>
    Re: usernames & passwords - how to ??? <craig.gould@*REMOVE.THIS*bt.com>
    Re: Very new to Perl - desperate for help! <daley@cs.man.ac.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Mar 2001 10:27:43 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: [Q] Avoid stripping of command line quotes
Message-Id: <slrn9bh0gv.nqg.abigail@tsathoggua.rlyeh.net>

Brian R. Jones (jonesbr@roger.ecn.purdue.edu) wrote on MMDCCLIX September
MCMXCIII in <URL:news:998t9f$92$1@mozo.cc.purdue.edu>:
,, Hello!
,, 
,, I'm probably missing something absolutely trivial, but how does
,, one tell perl _not_ to strip double quotes out of command line
,, arguments?  For example, say I have the following script called
,, tst.pl:
,, 
,,    #!/usr/bin/perl -w
,,    foreach (@ARGV) { print "$_\n" }
,,    exit;
,, 
,, Execute script:   tst.pl "hello"
,, Actual output:    hello
,, Desired output:   "hello"
,, 
,, I can't use \Q\E because @ARGV has already stripped the quotes
,, before I can ever access it... what simple trick am I missing?


You are missing how shells work.

Perl never gets to see the quotes, as the quotes are dealt with by the
shell. Do:

    tst.pl '"hello"' 

if you want to see the double quotes.


Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: Wed, 21 Mar 2001 10:37:17 +0200
From: Julle Ju <julle.ju@cnok.net>
Subject: find two, replace one
Message-Id: <3AB8683D.7BA5B224@cnok.net>


I wish to perform a search on file, find lines that have $find1 and
$find2, and finally replace $find2 with $replace. Why the following wont
work?

while($line=<INFILE>){
	if($line =~ /^(?=.*$find1)(?=.*$find2)/s){
		$line =~ s/$find2/$replace/g;
	}
}

Cheers,
JJ


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

Date: Wed, 21 Mar 2001 09:23:55 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: find two, replace one
Message-Id: <slrn9bgsph.f6.rgarciasuarez@rafael.kazibao.net>

Julle Ju wrote in comp.lang.perl.misc:
> 
> I wish to perform a search on file, find lines that have $find1 and
> $find2, and finally replace $find2 with $replace. Why the following wont
> work?
> 
> while($line=<INFILE>){
> 	if($line =~ /^(?=.*$find1)(?=.*$find2)/s){
> 		$line =~ s/$find2/$replace/g;
> 	}
> }

Well, it seems that it's easier to do
  while (<INFILE>) {
    /$find1/ and s/$find2/$replace/g;
  }
Or did I misunderstand the question?

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Wed, 21 Mar 2001 17:05:39 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: find two, replace one
Message-Id: <999qr1$j4@netnews.hinet.net>

"Julle Ju" wrote

> I wish to perform a search on file, find lines that have $find1 and
> $find2, and finally replace $find2 with $replace. Why the following wont
> work?
>
> while($line=<INFILE>){
> if($line =~ /^(?=.*$find1)(?=.*$find2)/s){
> $line =~ s/$find2/$replace/g;
> }
> }
>

"-w" or "use strict" will tell you the answer.

John Lin





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

Date: Wed, 21 Mar 2001 09:40:41 GMT
From: tp601553@cia.gov (Tweetie Pooh)
Subject: Re: find two, replace one
Message-Id: <Xns906B6273F5C63TweetiePooh@62.253.162.109>

rgarciasuarez@free.fr (Rafael Garcia-Suarez) honoured comp.lang.perl.misc on 
Wed 21 Mar 2001 09:23:55a with 
<slrn9bgsph.f6.rgarciasuarez@rafael.kazibao.net>:

>Julle Ju wrote in comp.lang.perl.misc:
>> 
>> I wish to perform a search on file, find lines that have $find1 and
>> $find2, and finally replace $find2 with $replace. Why the following wont
>> work?
>> 
>> while($line=<INFILE>){
>>      if($line =~ /^(?=.*$find1)(?=.*$find2)/s){
>>           $line =~ s/$find2/$replace/g;
>>      }
>> }
>
>Well, it seems that it's easier to do
>  while (<INFILE>) {
>    /$find1/ and s/$find2/$replace/g;
>  }
>Or did I misunderstand the question?
>

But of course this only changes the line in memory not in the file.


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

Date: Wed, 21 Mar 2001 09:51:47 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: find two, replace one
Message-Id: <slrn9bguak.em1.bernard.el-hagin@gdndev32.lido-tech>

On Wed, 21 Mar 2001 09:40:41 GMT, Tweetie Pooh <tp601553@cia.gov> wrote:
>rgarciasuarez@free.fr (Rafael Garcia-Suarez) honoured comp.lang.perl.misc on 
>Wed 21 Mar 2001 09:23:55a with 
><slrn9bgsph.f6.rgarciasuarez@rafael.kazibao.net>:
>
>>Julle Ju wrote in comp.lang.perl.misc:
>>> 
>>> I wish to perform a search on file, find lines that have $find1 and
>>> $find2, and finally replace $find2 with $replace. Why the following wont
>>> work?
>>> 
>>> while($line=<INFILE>){
>>>      if($line =~ /^(?=.*$find1)(?=.*$find2)/s){
>>>           $line =~ s/$find2/$replace/g;
>>>      }
>>> }
>>
>>Well, it seems that it's easier to do
>>  while (<INFILE>) {
>>    /$find1/ and s/$find2/$replace/g;
>>  }
>>Or did I misunderstand the question?
>>
>
>But of course this only changes the line in memory not in the file.

So did the OP's code, so the assumption that in this regard the OP knows 
what he's doing seems a safe one.

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Wed, 21 Mar 2001 14:56:00 +0200
From: Julle Ju <julle.ju@cnok.net>
Subject: Re: find two, replace one
Message-Id: <3AB8A4E0.80862D71@cnok.net>


> >
> >Well, it seems that it's easier to do
> >  while (<INFILE>) {
> >    /$find1/ and s/$find2/$replace/g;
> >  }
> >Or did I misunderstand the question?
> >
> 
> But of course this only changes the line in memory not in the file.

Thanks. I did try following:

open (INFILE, "$filename") or die("unable to open $filename");
{
undef $/;
$infile = <INFILE>;
}
close (INFILE) or die("unable to close $filename"); 

$infile =~ (/$find1/ and s/$find2/$replace/g);

will do nothing, while:

$infile =~ s/$find2/$replace/g;

 ...works fine.

On my $infile I have several lines where both $find1 and $find2 exist.
What am I missing (besides experience)?

JJ


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

Date: Wed, 21 Mar 2001 13:30:28 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: find two, replace one
Message-Id: <slrn9bhb4m.fob.bernard.el-hagin@gdndev32.lido-tech>

On Wed, 21 Mar 2001 14:56:00 +0200, Julle Ju <julle.ju@cnok.net> wrote:
>
>> >
>> >Well, it seems that it's easier to do
>> >  while (<INFILE>) {
>> >    /$find1/ and s/$find2/$replace/g;
>> >  }
>> >Or did I misunderstand the question?
>> >
>> 
>> But of course this only changes the line in memory not in the file.
>
>Thanks. I did try following:
>
>open (INFILE, "$filename") or die("unable to open $filename");
>{
>undef $/;
>$infile = <INFILE>;
>}
>close (INFILE) or die("unable to close $filename"); 

This won't allow you to do inplace editing of the file. Check out the -i
switch in perldoc perlrun for information on how to accomplish that.

>$infile =~ (/$find1/ and s/$find2/$replace/g);

The =~ operator is totally wrong here. That whole statement in the
parentheses does both the check and the substitution. It may have
confused you because it operates on the $_ special variable rather than
on your $infile. So try:

$infile =~ /$find1/ and $infile =~ s/$find2/$replace/g;

You may also be confused by the fact that there is no apperent if
statement here. Look for the 'and' operator in perldoc perlop to learn
more about that.

>will do nothing, while:
>
>$infile =~ s/$find2/$replace/g;
>
>...works fine.
>
>On my $infile I have several lines where both $find1 and $find2 exist.
>What am I missing (besides experience)?

See above. :-)

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Wed, 21 Mar 2001 13:46:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: find two, replace one
Message-Id: <p7chbtgh7fk0gkuk4fc9sebbin9k1orjlg@4ax.com>

Julle Ju wrote:

>$infile =~ (/$find1/ and s/$find2/$replace/g);
>
>will do nothing, while:
>
>$infile =~ s/$find2/$replace/g;
>
>...works fine.
>
>On my $infile I have several lines where both $find1 and $find2 exist.
>What am I missing (besides experience)?

Your $find1 pattern doesn't match what you think it should.

-- 
	Bart.


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

Date: Wed, 21 Mar 2001 12:40:10 GMT
From: d.lebbing@*no*spam*.iquip.nl
Subject: form post parameter looks like directory but is a script ?!
Message-Id: <3ab89f9c.89011191@news.euronet.nl>

Folks,

The folowing situation is uncomprehenseble to me and I need to know
how this works.  

A script is beeing called from a form like:
<form action="/secured/edit/article.cgi/3ab8a09e077a0001" method=POST
-->
This is special because article.cgi is the script and it takes
3ab8a09e077a0001 as a parameter!  I am puzzled, does anyone have any
idea to enlighten me on this one?  What is the trick?

Greetings,
	Dennis.



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

Date: Wed, 21 Mar 2001 14:39:15 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: form post parameter looks like directory but is a script ?!
Message-Id: <3AB8AF03.142CE73D@schaffhausen.de>

d.lebbing@*no*spam*.iquip.nl schrieb:
> 
> Folks,
> 
> The folowing situation is uncomprehenseble to me and I need to know
> how this works.
> 
> A script is beeing called from a form like:
> <form action="/secured/edit/article.cgi/3ab8a09e077a0001" method=POST
> -->
> This is special because article.cgi is the script and it takes
> 3ab8a09e077a0001 as a parameter!  I am puzzled, does anyone have any
> idea to enlighten me on this one?  What is the trick?

Is that a Perl script?


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

Date: Wed, 21 Mar 2001 09:27:38 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Hash question
Message-Id: <slrn9bgt0f.f6.rgarciasuarez@rafael.kazibao.net>

Ciaran McCreesh wrote in comp.lang.perl.misc:
> In article <tbf90mh8m69jb7@news.supernews.com> (whatever that means),
> Jason <jason.baker@stdbev.com> writes
> >Pardon the newbie question.  Im trying to read a file into a hash,  the file
> >is setup like
> >key = value
> >key1 = value1
> >etc...
> >and I would like that information placed into a hash.  I have figured out a
> >way to do this, but it entails first reading everything into an array and
> >then putting it into the hash.   Their must be a better way.  ANy
> >suggestions?
> 
> while (<FILE>) {
>   ($key, $value) = split /=/;
>   $hash($key} = $value;
> }
> 
> or something along those lines...

More robust perhaps :
  while (<FILE>) {
    chomp;
    my ($key, $value) = split /\s*=\s*/, $_, 2;
    $hash($key} = $value;
  }

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Wed, 21 Mar 2001 09:52:48 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Hash question
Message-Id: <slrn9bguci.em1.bernard.el-hagin@gdndev32.lido-tech>

On Wed, 21 Mar 2001 09:27:38 GMT, Rafael Garcia-Suarez
<rgarciasuarez@free.fr> wrote:
>Ciaran McCreesh wrote in comp.lang.perl.misc:
>> In article <tbf90mh8m69jb7@news.supernews.com> (whatever that means),
>> Jason <jason.baker@stdbev.com> writes
>> >Pardon the newbie question.  Im trying to read a file into a hash,  the file
>> >is setup like
>> >key = value
>> >key1 = value1
>> >etc...
>> >and I would like that information placed into a hash.  I have figured out a
>> >way to do this, but it entails first reading everything into an array and
>> >then putting it into the hash.   Their must be a better way.  ANy
>> >suggestions?
>> 
>> while (<FILE>) {
>>   ($key, $value) = split /=/;
>>   $hash($key} = $value;
>> }
>> 
>> or something along those lines...
>
>More robust perhaps :
>  while (<FILE>) {
>    chomp;
>    my ($key, $value) = split /\s*=\s*/, $_, 2;
>    $hash($key} = $value;
          ^

Small typo there. Should be a '{', of course.

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Wed, 21 Mar 2001 10:41:28 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Hash question
Message-Id: <3AB87748.DE61525@schaffhausen.de>

"Matthew O. Persico" schrieb:
> 
> Ciaran McCreesh wrote:
> >
> > In article <tbf90mh8m69jb7@news.supernews.com> (whatever that means),
> > Jason <jason.baker@stdbev.com> writes
> > >Pardon the newbie question.  Im trying to read a file into a hash,  the file
> > >is setup like
> > >key = value
> > >key1 = value1
> > >etc...
> > >and I would like that information placed into a hash.  I have figured out a
> > >way to do this, but it entails first reading everything into an array and
> > >then putting it into the hash.   Their must be a better way.  ANy
> > >suggestions?
> >
> > while (<FILE>) {
> >   ($key, $value) = split /=/;
> >   $hash($key} = $value;
> > }
> >
> > or something along those lines...
> 
> Such as
> 
> %hash = map {split /=/} <FILE>;

loads ther whole file into memory though which means:
its faster for small files and it takes a lot memory for
large files.

->malte


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

Date: Wed, 21 Mar 2001 09:08:35 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How to sort ?
Message-Id: <x77l1j4hgs.fsf@home.sysarch.com>

>>>>> "GJ" == Gwyn Judd <tjla@guvfybir.qlaqaf.bet> writes:

  GJ> I was shocked! How could Vinny Murphy <VincentMurphy@mediaone.net>
  GJ> say such a terrible thing:
  >> Just use
  >> 
  >> $str='101,blablabla,blablabla
  >> 105,blablabla,blablabla
  >> 103,blablabla,blablabla
  >> 104,blablabla,blablabla
  >> 100,blablabla,blablabla
  >> ';
  >> 
  >> perldoc -q sort
  >> perldoc -f map
  >> perldoc -f sort
  >> 
  >> BTW, if you have a lot of sorting you should use something like the
  >> Rosler-Guttman pack sort or is it called the packed default sort?

  GJ> Yeah, it's called the Guttman-Rosler transform. It goes like this (with
  GJ> the users data):

  GJ> @sorted = sort split /\n/, $str;

that is not a GRT. that is a straight alpha sort on the 3 digit
prefix. if any of the lines had a different digit count it would fail.

a GRT is similar to the ST in that it uses a map/sort/map but the main
difference is that the first map generates a sortable string which has
the keys in front and the record at the end. so it doesn't have a sort
callback function which is where its speedup comes from.

for the whole story, read:

http://www.sysarch.com/perl/sort_paper.html

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 21 Mar 2001 09:11:41 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::Select sel->add and array references
Message-Id: <x74rwn4hbn.fsf@home.sysarch.com>

>>>>> "MK" == Mathias Koerber <mathias@koerber.org> writes:

  MK> Each handle can be an `IO::Handle' object, an 
  MK> integer or an array reference where the first element is a
  MK> `IO::Handle' or an integer.

  MK> So how do I hand an array reference to $sel->add. Like this?

  MK> while (..) {
  MK> # function returns (socket, name, time) in one array
  MK> my (@INFO) = function(...);

don't use all caps for perl vars. 

  MK> $sel->add(\*INFO);

that is a ref to a typeglob, not an array ref. the ref you want is:

	$sel->add(\@INFO);

or maybe better is to have the function return:

	[ $handle, $more_info, $much_more_info ]

and pass that to $sel->add() 

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 21 Mar 2001 09:45:16 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: perl Online/Offline status indicator needed
Message-Id: <slrn9bgu1c.mng.abigail@tsathoggua.rlyeh.net>

dbe_odinson@yahoo.com (dbe_odinson@yahoo.com) wrote on MMDCCLIX September
MCMXCIII in <URL:news:ua5gbtod7662hvmu2n0fmd0qgm3e8hliea@4ax.com>:
^^ I have a requirement to put an online/offline status on a web-page
^^ that tells the visitors when the admin is online or not (displays an
^^ online/offline message). It is acceptable if the admin has to execute
^^ a manual process (he executes a script or whatever), to turn this flag
^^ on/off. But the visitors to the site need to see whether he is online
^^ or offline.
^^ 
^^ If you could let me know about both sides of the question (the visitor
^^ side & admin side) that would be perfect.


Let the admin execute the following when he goes online:

    perl -wi -pe 's/offline/online/g'  admin_status.html

and when he goes offline, the admin does:

    perl -wi -pe 's/online/offline/g'  admin_status.html

All you need to do is make the webpage and do it in such a way
that it contains the word offline.


Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: Wed, 21 Mar 2001 02:42:25 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Print "tar" Success or Failure
Message-Id: <19367-3AB86971-1@storefull-242.iap.bryant.webtv.net>

Thanks for everyone's time and help. I still haven't figured it out, but
I can understand  your choosing not to continue this discussion.

Regards,
--Dennis



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

Date: Wed, 21 Mar 2001 10:09:47 +0100
From: "Jonas Nilsson" <jonni@ifm.liu.se>
Subject: Re: small question - reading/writing data structures to/from file?
Message-Id: <999r06$cvi$1@newsy.ifm.liu.se>

open(OUTPUT, ">file.dat") or die "Can't open file";
print OUTPUT join("\n",$name,$lname,$int1,$int2,$int3,$int4,$int5);
close(OUTPUT);

open(INPUT, "<file.dat") or die "Can't open file";
for (($name,$lname,$int1,$int2,$int3,$int4,$int5)=<INPUT>) {chomp};
close(INPUT);

Will work if the vars doesn't contain any newlines. Just a simple example.
/jN


--
_______________________________
"Stan" <none@none.com> wrote in message
news:7sWt6.54359$zV3.4509921@news1.frmt1.sfba.home.com...
> Can anyone please give me a little example of how to read a data structure
> from a file, and also write this structure to the file. I mean a basic
> example.
>
> This can be the example structure:
> firstname (string)
> lastname (string)
> interests:
>    1 (yes/no)
>    2 (yes/no)
>    3 (yes/no)
>    4 (yes/no)
>    5 (yes/no)
>
> for the interest part, its really five parts, each one is like a boolean
(or
> int).
> I hope I"m not asking too much. I really am just learning this. I am
coming
> from a c background.
>
> Thanks so much for any help.
> -Stan
>
>
>
>
>




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

Date: Wed, 21 Mar 2001 03:08:37 -0500
From: "David Sarno" <david.sarno@yale.edu>
Subject: SOAP::Lite Server Error--?
Message-Id: <hiZt6.4391$GD.2497192@typhoon.snet.net>

I've got a problem with the following ultra simple SOAP server.  It seems to
work in practice, because when I make a call to it from a client I get the
correct output, so I know the RPC is working.  But when I perl the server
itself (hibye.cgi), I get the 405 error.  Any ideas where it's coming from?
Thanks.

[xyz@carter ]$ cat hibye.cgi
#!/usr/bin/perl -w

 use SOAP::Transport::HTTP;

 SOAP::Transport::HTTP::CGI
    -> dispatch_to('Demo')  #in same directory
    -> handle;

[dxyz@carter ]$ perl hibye.cgi      <--- Here's the error call.
Status: 405 Method Not Allowed
 ..
[dxyz@carter ]$ cat Demo.pm
###Demo.pm###
  package Demo;
  sub hi {
    return "hello, world";
  }
  sub bye {
    return "goodbye, cruel world";
  }

1;

yet the client, when invoked, still prints "hello, world".  This is the
client:

###CLIENT###
#!/usr/bin/perl -w

  use SOAP::Lite;
  $s =SOAP::Lite
    -> uri('Demo')
    -> proxy('http://irref.mine.nu/user/das56/soap/v0/hibye.cgi')
    -> hi();

print $s->result();









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

Date: Wed, 21 Mar 2001 09:52:30 GMT
From: tp601553@cia.gov (Tweetie Pooh)
Subject: Re: time calculation
Message-Id: <Xns906B64750156ETweetiePooh@62.253.162.109>

ebonyxman@aol.com (Ebonyxman) honoured comp.lang.perl.misc on Wed 21 Mar
2001 03:21:20a with <20010320222120.27536.00000129@ng-mj1.aol.com>: 

>Can anyone point me in the right direction? I need to calculate the number
>of minutes between two date/time fields in the form "03/20/01 12:30 PM". 
>Does PERL have any help in this area?
>
>Thanks for any help anyone can provide....

I have used Date::Manip for exactly this sort of purpose

There is probably a better (another) way to do this

use Date::Manip;

 ...

# $date1 and $date2 are extracted from Oracle as dd Month yyyy hh24:mi:ss
$d1 = ParseDate($date1);
$d2 = ParseDate($date2);
($tyear,$tx,$tweek,$tday,$thour,$tmin,$tsec) = split /:/,
&DateCalc($d1,$d2); $timemin = ($tweek * 7 * 24 * 60)+($tday *24 *60) +
($thour *60) + $tmin; 

 ...




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

Date: Wed, 21 Mar 2001 14:50:13 +0100
From: "Jørgen Gusgaard" <gusgaard@ementa.net>
Subject: Trouble compiling modules from CPAN
Message-Id: <Vf2u6.3021$mh4.198580@news3.oke.nextra.no>

Hello.
I am trying to compile modules from cpan on my windows 2000.
When dooing this the nmake.exe (v1.5)  complains that it can't find the
program cl.exe
What do I need to fix this problem ?

Regards Jorgen
OUTPUT::
------------------
C:\work\bin\test\DBI-1.14>c:\perl\bin\nmake\nmake.exe

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.





    cl.exe -c  -Od -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -Od -MD -DNDE
BUG     -DVERSION=\"1.14\"  -DXS_VERSION=\"1.14\"  -IC:\Oracle\Ora9i\Apache\
perl
\5.00503\lib\MSWin32-x86\CORE -DDBI_NO_THREADS Perl.c
The system cannot execute the specified program.
NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x1'
Stop.
-------------------






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

Date: Wed, 21 Mar 2001 10:38:03 +0300
From: "Ukolov Ilya" <ilya@is.sochi.ru>
Subject: Re: usernames & passwords - how to ???
Message-Id: <999lr2$s7m$1@news.sochi.ru>

You may need to use .htaccess & .htpasswd.

Best regards Ilya Ukolov
http://is.sochi.ru


Francois Richard <richard@science.uottawa.ca> ïèøåò â
ñîîáùåíèè:997t3t$99k3@mercury.cc.uottawa.ca...
> (sorry for cross-posting, but I'm really shooting in the dark: I have no
> idea where to start with this!)
>
> Can someone please point me in the right direction (FAQ, web resources,
> etc.)?
>
> I want to create a simple web page that allows guests to the web site to
> enter a userid and password, and store these with their names in a text
> or database file on our server.
>
> What is the best way to do this? Does it involve JavaScript alone, or a
> combination with other tools (CGI, Perl, Java, etc.)?
>
> I have looked for info on the internet, but so far this is proving to be
> a very frustrating experience... I would greatly appreciate any
> pointers/advice you may have.
>
> Cheers,
> _________________________________________________
> François Richard  -  Earth Sciences
> University of Ottawa (Canada)
>
>
>




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

Date: Wed, 21 Mar 2001 08:49:53 -0000
From: "crg" <craig.gould@*REMOVE.THIS*bt.com>
Subject: Re: usernames & passwords - how to ???
Message-Id: <999q96$djm$1@pheidippides.axion.bt.co.uk>

Or JSP/Servlets/Beans!

"Long" <yhaili@21cn.com> wrote in message news:9996gv$d7f$2@mail.cn99.com...
> You may need to use ASP. Javascript can't do it alone!
>
> Best regards from China!
> Francois Richard <richard@science.uottawa.ca> wrote in message
> news:997t3t$99k3@mercury.cc.uottawa.ca...
> > (sorry for cross-posting, but I'm really shooting in the dark: I have no
> > idea where to start with this!)
>
>
>
>
>




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

Date: Wed, 21 Mar 2001 08:33:23 GMT
From: Rich Daley <daley@cs.man.ac.uk>
Subject: Re: Very new to Perl - desperate for help!
Message-Id: <1103_985163603@owlsound>

On Tue, 20 Mar 2001 14:15:04 -0600, Michael Carman <mjcarman@home.com> wrote:
> Try replacing this line with these two:
> 
> use FindBin;
> use lib "$FindBin::Bin/../perl-lib";
> 
> Your problem, presumably, is that perl isn't finding your library. '..'
> isn't the parent directory of the where the script is located, it's the
> parent directory of where the script is *run*.
> 
> -mjc

Thanks, but '..' is actually the parent directory of the library file, in this situation - and I got a different error message "Can't locate LWP/Simple in @INC" 
before adding this line.

I've been told, by someone by email, that this is a proxy problem - although I have no idea how to fix a proxy problem in Perl.

Is there another LWP command I can execute which will tell the 'get' command to go through a proxy server when trying to retrieve data from the web?

And does anyone know a proxy server I can use for f2s.com ?

Thanks,
Rich.



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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