[15658] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3071 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 17 00:07:22 2000

Date: Tue, 16 May 2000 21:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <958536309-v9-i3071@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 16 May 2000     Volume: 9 Number: 3071

Today's topics:
        *Beginner help with HASHES neysa@nycap.rr.com
        *Please Help.New to Perl and CGI* (SaintJAVA)
        Accessing C++ data objects from PERL <rpyne@micron.net>
    Re: Camel T-Shirt (brian d foy)
        catching eval warnings and preventing them mda@discerning.com
    Re: catching eval warnings and preventing them <datm@uswest.net>
        Error install module using MCPAN <koff@mimos.my>
    Re: If slices are so great... <quantum_mechanic@my-deja.com>
    Re: If slices are so great... <quantum_mechanic@my-deja.com>
    Re: integer ops: mod, etc: WHERE? (David Combs)
    Re: Is my Perl 5.005_03 Compiler broken? <webqueen@my-deja.com>
        MS Documents to text---help <jgoss@goss-com.com>
    Re: MS Documents to text---help <killbeck@pointecom.net>
        NDBM_File- the mysterious DBM? <webqueen@my-deja.com>
    Re: NDBM_File- the mysterious DBM? <phill@modulus.com.au>
        Net::IRC module and PING? (SnuggleB)
    Re: Protecting Source Code? <jgoss@goss-com.com>
    Re: Reading and Writing to a file <bmb@dataserv.libs.uga.edu>
    Re: Reading/searching file problem <hawkwynd@pce.net>
        Socket problem <a_backsjo@hotmail.com>
    Re: Socket problem <a_backsjo@hotmail.com>
    Re: string starts with? <phill@modulus.com.au>
    Re: Time with a finer granularity <zigouras@mail.med.upenn.edu>
    Re: What's this line which Perl added to AUTOEXEC.BAT? <waldo700NOwaSPAM@aol.com.invalid>
        win32 file version (SKoch71)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 17 May 2000 02:53:09 GMT
From: neysa@nycap.rr.com
Subject: *Beginner help with HASHES
Message-Id: <39220AC3.916F26A3@nycap.rr.com>

Hi,

I have a report that prints out a list of users and what groups they are
assigned to.  The original report was very simple and it looked similar
to this:

OPRID     NAME        GROUPS
-------------------------------
123       TEST123     GROUP1, GROUP3
ABC       DUMMYA      GROUP2
XYZ       TESTX       GROUP1, GROUP4


This data was contained in a hash keyed on OPRID with the values of name
and groups.



Now I need to change the report and replace the heading GROUPS with all
the unique group names and then below list the operators with X to
represent the groups they are in

Example:
OPRID       NAME          GROUP1   GROUP2   GROUP3   GROUP4
-----------------------------------------------------------
123         TEST123       X                  X
ABC         DUMMYA                   X
XYZ         TESTX         X                          X


I have all the groups stored in another hash and can get the heading to
print out.

But, I need help on handling the groups for each operator id, or if I
stick with the way I originally have the report recording the groups how
to get the printout look like above.

In my hash, do I need to have the key be oprid and all the possible
groups and then as I retrieve the data from the database with the groups
they belong to set the value to X?
If that is a better way, how do I do that with hash?


Thanks in advance for the help

Pam



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

Date: 17 May 2000 02:37:43 GMT
From: saintjava@aol.com (SaintJAVA)
Subject: *Please Help.New to Perl and CGI*
Message-Id: <20000516223743.24289.00003525@ng-cd1.aol.com>

Hello,

I have recently began learning Perl with the purpose of using it to write CGI
scripts. I think I can grasp the Perl language, but I've found difficulty
testing my scripts in a Web environment.  

I've installed the Microsoft Personal Web Server that comes with Windows 98
hoping that its built in CGI bin would work out.  It hasn't. Whenever I call a
perl script in my cgi-bin directory I get a HTTP 500 - Internal server error
message. 

Could anyone tell me:
How can I configure my Windows server to excecute the perl scripts in my
cgi-bin when I call them from a web page form?  

Is there an online resource that you know for a fact tells how to set up your
webserver to process CGI requests?

I've searched www.perl.org, the books "Using Perl 5" by Que and "The CGI Manual
of Style" for the answers but I've come up with zilch. Anf after two afternoons
at Barnes and Noble looking through their webserver books I've almost given up.

I am running:
Windows 98 SE
ActivePerl 5.6
Microsoft Personal Web Server (that comes with Windows 98)

An simple test script that I've tried using is:

print "Content-type: text/html\n\n";
print "<h1>hello world</h1>";


Thanks in advance!
~e


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

Date: Tue, 16 May 2000 21:37:41 -0600
From: Richard Pyne <rpyne@micron.net>
Subject: Accessing C++ data objects from PERL
Message-Id: <39221405.391E3A95@micron.net>

Can anyone please direct me to a good source of information on how to
access C++ data objects from PERL?

Thanks in advance,

--Richard


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

Date: Tue, 16 May 2000 22:56:51 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Camel T-Shirt
Message-Id: <brian-1605002256520001@1cust103.tnt3.durham.nc.da.uu.net>

In article <3921B4D1.447E83F6@attglobal.net>, care227@attglobal.net wrote:

>brian d foy wrote:
>
>> if you don't mind wearing a Perl Mongers shirt, we sell them through
>> www.geekstuff.com, Camel and all.  to get an O'Reilly shirt, you
>> probably have to go to the Perl Conference. :)
>
>From Websters:  
>
>monger \Mon"ger\, v. t. To deal in; to make merchandise of; to 
>traffic in; -- used chiefly of discreditable traffic. 

hoepfully you don't think trafficking in Perl is discreditable ;)

-- 
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ 
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



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

Date: Wed, 17 May 2000 01:43:08 GMT
From: mda@discerning.com
Subject: catching eval warnings and preventing them
Message-Id: <8fstf8$ks7$1@nnrp1.deja.com>

for reasons i'd be hard put to justify coherently, i've got
some code similar to this:

   use strict;
   my $expr = 'sub {return $whatever}';
   my $closure = eval $expr;
   die "closure making failed on $expr: $@" if $@;
   die "eval didn't make a sub" unless $closure && ref($closure)
eq 'CODE';

running this i get:
Global symbol "$whatever" requires explicit package name at (eval 1)
line 1.
eval didn't make a sub at test.pl line 6.

Problem 1:
Of course $whatever is not defined. But why is it printing this,
rather than raising an exception? I don't want random console
output. The first die is not executed, but the second one is.
I *want* the warnings; i don't want to simply do no strict.
No, it doesn't help to say: eval {eval $substring};

Problem 2:
Suppose I know what symbols I might use in these expressions,
but they'll get their values after creation of the closures but
before running of the closures. So I can generate a really
long "use vars qw($whatever ...)" line and eval that too.
That would work, but it seems a little baroque. Feeling brave,
i examined vars.pm in the distribution, to see if i do that
directly. it appears to do things by this:
    *{"${callpack}::$sym"} = \$ {"${callpack}::$sym"};
for symbols starting with '$'. Dare I ask what is really doing,
so as to prevent the warning?

Thanks.

-mda


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 16 May 2000 19:30:19 -0700
From: "Dan Brown" <datm@uswest.net>
Subject: Re: catching eval warnings and preventing them
Message-Id: <NvnU4.385$mi6.11594@news.uswest.net>

Problem 1:
------------
I may be off here but as I understand $@, it returns the SYNTAX error of =
the last eval.  The eval in your code is syntactically correct.  As such =
$@ is null and the first die isn't executed.

The message

    Global symbol "$whatever" requires explicit package name at (eval 1) =
line 1.

message is the compiler telling you that since you used strict and =
$whatever was not declared via my (by the way, you can solve this my =
inserting my before $whateverr).  When you get this message, Perl is =
compiling the code and the program hasn't actually run yet.

This code does execute the first die because the eval string is not =
syntactically correct:

    #!/usr/bin/perl

    use strict;

    my $expr =3D 'sub {return $whatever}[]';

    my $closure =3D eval $expr;

    die "closure making failed on $expr: $@" if $@;

    die "eval didn't make a sub" unless $closure && ref($closure) eq =
'CODE';

Which, when run gives
    Global symbol "$whatever" requires explicit package name at (eval 1) =
line 1.
    closure making failed on sub {return $whatever}[]: syntax error at =
(eval 1) line 1, near "[]"

Changing the line to

    my $expr =3D 'sub {return my $whatever}[]';

will give you only the second line.  Removing the [] from that line =
gives you no errors.

I am sorry I am not able to address your second problem.

<mda@discerning.com> wrote in message =
news:8fstf8$ks7$1@nnrp1.deja.com...
> for reasons i'd be hard put to justify coherently, i've got
> some code similar to this:
>=20
>    use strict;
>    my $expr =3D 'sub {return $whatever}';
>    my $closure =3D eval $expr;
>    die "closure making failed on $expr: $@" if $@;
>    die "eval didn't make a sub" unless $closure && ref($closure)
> eq 'CODE';
>=20
> running this i get:
> Global symbol "$whatever" requires explicit package name at (eval 1)
> line 1.
> eval didn't make a sub at test.pl line 6.
>=20
> Problem 1:
> Of course $whatever is not defined. But why is it printing this,
> rather than raising an exception? I don't want random console
> output. The first die is not executed, but the second one is.
> I *want* the warnings; i don't want to simply do no strict.
> No, it doesn't help to say: eval {eval $substring};
>=20
> Problem 2:
> Suppose I know what symbols I might use in these expressions,
> but they'll get their values after creation of the closures but
> before running of the closures. So I can generate a really
> long "use vars qw($whatever ...)" line and eval that too.
> That would work, but it seems a little baroque. Feeling brave,
> i examined vars.pm in the distribution, to see if i do that
> directly. it appears to do things by this:
>     *{"${callpack}::$sym"} =3D \$ {"${callpack}::$sym"};
> for symbols starting with '$'. Dare I ask what is really doing,
> so as to prevent the warning?
>=20
> Thanks.
>=20
> -mda
>=20
>=20
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: Wed, 17 May 2000 10:27:20 +0800
From: "linn smux" <koff@mimos.my>
Subject: Error install module using MCPAN
Message-Id: <8fsvos$heo$1@news5.jaring.my>

Hi,

I've a problem installing any module using perl -MCPAN -e shell . It prompt
me with this message

Error reading from /root/.cpan/sources/authors/01mailrc.txt

I used perl 5.005_03

Thanks in advance.

--koff




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

Date: Wed, 17 May 2000 02:16:07 GMT
From: Quantum Mechanic <quantum_mechanic@my-deja.com>
Subject: Re: If slices are so great...
Message-Id: <8fsvcp$mtl$1@nnrp1.deja.com>

  andrew-johnson@home.com wrote:
>     @keep = (split /,/, $string)[^0,1];

I like your thinking here, though I don't think this will make it into
the language :(

QM
--
Quantum Mechanics: The dreams stuff is made of.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 02:23:29 GMT
From: Quantum Mechanic <quantum_mechanic@my-deja.com>
Subject: Re: If slices are so great...
Message-Id: <8fsvqi$ng0$1@nnrp1.deja.com>

In article <pc766swfsed.fsf@panix6.panix.com>,
  Lewis Perin <perin@panix.com> wrote:
> Quantum Mechanic <quantum_mechanic@my-deja.com> writes:
>
> > If slices are so great, why aren't there more references to them in
> > the indices of the basic Perl books?
> > [...]
> > I wanted something like:
> >
> >    @keep = split( /,/, $string )[2..-1]
> >
> > but this of course doesn't DWYW. Is there another way besides a
> > temporary variable?
>
> A list slice does appear to work if you rearrange the parentheses
> *and* forgo the -1 locution:
>
>   bash-2.03$ perl -le '$s = "a,b,c,d";@k = (split /,/, $s)[1..2];print
@k'

Yes, but I want everything except the first 2 elements from the split,
see the original post in the thread. [Sorry if someone else has said
this, I'm reading in thread order, after a long time away.]

--
Quantum Mechanics: The dreams stuff is made of.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 17 May 2000 02:19:15 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: integer ops: mod, etc: WHERE?
Message-Id: <8fsvj3$d07$1@slb7.atl.mindspring.net>

In article <8frqus$cr1$1@nnrp1.deja.com>,
Andreas Kahari  <andkaha@my-deja.com> wrote:
>
>You mean "modulo", as in
>
>if ($i % 2) { print "$i is even\n" }
>
>Use '%' as in C and C++, see the perlop manual.
>

Thanks to all you guys; do I feel foolish.

(I don't use C, but rather mainsail, which uses mod.)

I will add a suggestion for the faqs: where modulus
is discussed, also add the greppable single-word "mod"
(maybe in quotes, like that, with an "eg" before it).

Likewise with the perlop.pod file.

And maybe in book-revisions, add "mod" to the index.

(I don't think I've used or seen the word "modulus"
(much) since high school, talking about logs -- at least
I think the term was used there?  Or was that "mantissa"?
In the math books, you always see "mod" -- at least in
math books related to c.s.).

Thanks for the wake-up!

David



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

Date: Wed, 17 May 2000 02:01:27 GMT
From: webqueen, queen of the web <webqueen@my-deja.com>
Subject: Re: Is my Perl 5.005_03 Compiler broken?
Message-Id: <8fsuhe$m59$1@nnrp1.deja.com>

Thanks guys, I'll look into patches and also a Perl upgrade to a newer
version. I thought about that earlier but those sort of ambitions
usually start with arguments with the server admin so I make them last
resorts ;) I was particularly glad to hear that someone else has seen
similar behaviors.


HUG,
WQ

In article <8fqcqe$q62$1@nnrp1.deja.com>,
  webqueen, queen of the web <webqueen@my-deja.com> wrote:
>
>
> I had a bug in my code:
>
>    if defined ($s{$_})
>     {print "<tr><td><input type=checkbox name=$_
checked>$sta{id}</td>".
>            "<td>$sta{name}</td></tr>"}
>
> where I'd left the ()'s from around the
>
>     if (expression).
>
>   *********************************************************
>     perl -cw mysource
>
> said no problem- syntax OK (huh???)
>
> running on the command-line with
>
>     perl -w
>
> on the same source produced an output (it didn't get to this line
> before it exited normally) with no error messages or warnings.
>
> Running the program through cgi, and even with:
>
>     use CGI::Carp qw(carpout);
>     open(LOG, ">./cgi.log") || msg::SayError('cgi log', $!);
>     carpout(*LOG);
>
> it left the cgi.log file empty (yes it's write-enabled, and it works
on
> other errors).
>
> Here's where it get's weird- checking the apache log after running
this
> script, it says:
>
>   [Tue Apr  4 18:31:59 2000] [warn] [client 24.27.206.68]handler
> "cgi-wrapper" not found for: /home/sites/web/cgibin/testdev/pat.cgi
>   [Tue Apr  4 18:32:00 2000] [error] [client 24.27.206.68] malformed
> header from script. Bad header=syntax error at /home/sites/si:
> /usr/cgiwrap/cgiwrap
>
> How can the missing ()'s cause a malformed header, and cause the
> cgi-wrapper to "not be found"?
>
>  *******************************************************************
>
> Putting the () around the
>
>   if ()
>
> expression fixes everything; the script runs fine with no warnings and
> no errors.
>
> Do I need to tell this client that he has serious server issues, or is
> this all logical and congruent?
>
> Colour me confused!
>
> WQ
>
> --
> Time is nature's way of preventing everything from happening at once.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Time is nature's way of preventing everything from happening at once.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 02:28:36 GMT
From: "JB Goss" <jgoss@goss-com.com>
Subject: MS Documents to text---help
Message-Id: <otnU4.38$e4.2000@news1.rdc1.ne.home.com>

I am looking for something simple to strip the crud out of MS documents and
just leave the text... any ideas?

Thanks,
JB




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

Date: Tue, 16 May 2000 21:35:12 -0500
From: Lynn Killingbeck <killbeck@pointecom.net>
Subject: Re: MS Documents to text---help
Message-Id: <39220560.7A65@pointecom.net>

JB Goss wrote:
> 
> I am looking for something simple to strip the crud out of MS documents and
> just leave the text... any ideas?
> 
> Thanks,
> JB

"SaveAs" a *.txt file. (Via File - SaveAs menus).

Lynn Killingbeck

P.S. That 'crud' is a lot of formatting, so make sure that you really do
want to get down to a plain-vanilla ASCII (or MSDOS) format!


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

Date: Wed, 17 May 2000 02:12:11 GMT
From: webqueen, queen of the web <webqueen@my-deja.com>
Subject: NDBM_File- the mysterious DBM?
Message-Id: <8fsv5e$mqj$1@nnrp1.deja.com>

This is actually an offshoot of trying to install

  HTTPD-User-Manage-1.54

which seems to want NDBM_File as it's DB of choice.

My system says there is no NDBM_File in the path if I try to use it.
Camel Book (pp 378) doesn't delve deeply into it, but it does say
"..NDBM_File for compatibility with earlier versions of Perl.". This
leads me to conclude that this DBM may be deprecated. Also I see no
offering of NDBM_File on CPAN.

So can someone please explain this mystery DB? And is anyone aware of an

 HTTPD-User-Manage-x.xx

that uses an xDBM that is available? Or maybe HTTPD-User-Manage is
deprecated as well?

Thanks & Hugs,
WQ

--
Time is nature's way of preventing everything from happening at once.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 12:25:29 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: NDBM_File- the mysterious DBM?
Message-Id: <39220319.D40@modulus.com.au>

webqueen, queen of the web wrote:
[snip]
> My system says there is no NDBM_File in the path if I try to use it.
> Camel Book (pp 378) doesn't delve deeply into it, but it does say
> "..NDBM_File for compatibility with earlier versions of Perl.". This
> leads me to conclude that this DBM may be deprecated. Also I see no
> offering of NDBM_File on CPAN.
> 
> So can someone please explain this mystery DB? And is anyone aware of an

The pod documentation to AnyDBM_File (which is part of the std.
distribution) helps explain the various flavours of DBMs.

hth

[snip]


-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Wed, 17 May 2000 03:42:56 GMT
From: snuggleb@mavus.myip.org (SnuggleB)
Subject: Net::IRC module and PING?
Message-Id: <392214ef.145261090@news.kih.net>

Hi all. I've got a little question about Net::IRC

I've been all through the manual, and the source code, but I can't
find *ANYTHING* that will let me do a PING on another user. 

cping and crping won't do it, those are triggers for receiving PINGs.

Any ideas?

Thanks!

SnuggleB
snuggleb@myTalk.com
#Mavus on irc.dal.net


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

Date: Wed, 17 May 2000 02:16:30 GMT
From: "JB Goss" <jgoss@goss-com.com>
Subject: Re: Protecting Source Code?
Message-Id: <2inU4.36$e4.2115@news1.rdc1.ne.home.com>


"James" <spectralmedia@home.com> wrote in message
news:24hU4.66606$fF5.2310884@news1.rdc1.il.home.com...
> Anyone know any good techniques for protecting your perl code?
>
>

The new version has a Perl compiler... that does perty good for protection.




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

Date: Tue, 16 May 2000 22:42:29 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: Reading and Writing to a file
Message-Id: <Pine.GSO.4.21.0005162241140.26871-100000@dataserv.libs.uga.edu>

On Tue, 16 May 2000, Jerome O'Neil wrote:
> I have a hunch we have discovered yet another voice in the Trolls head...

The photo on his web site is a bit different.

-- 
Brad



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

Date: Tue, 16 May 2000 23:46:28 -0400
From: "scott" <hawkwynd@pce.net>
Subject: Re: Reading/searching file problem
Message-Id: <3922096c@news.wnysurf.net>


$pattern = "$KIN213";
    open (FILE, $input) or die "Couldn't open input $input: $!; aborting";
    while (<FILE>) {
        print if /\Q$pattern\E/;
    }
    close FILE;

close($file);


See also perfaq 6 in the documentation.




Jimmy Lantz <webmaster@ostas.lu.se> wrote in message
news:391E844B.509D31DC@ostas.lu.se...
> Hi, I have the following problem:
> I need to read a file and search for a match according to the following
criterias:
>
>
> $match = KIN213:;
>
> open(IN, "$file");
>
> How do I match the line in the file ???? And set the text to var $titel ?
>
> close(IN);
> }
>
> Below are some samples of lines in the file(the jidderish is supposed to
> be random text and that's the text I need to set to the variabel $titel:
>
> OSH435: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
> KIN213: jfjfdshfjhsd this is a match jdhf
> JAP346: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
> THA212: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
> KAN234: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
> KIN244: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
> KIN262: jfjfdshfjhsdfkjhsdjfhdjhfdjhfjdhf
>
> Pls. someone help me.
> Your sincerely
> Jimmy Lantz




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

Date: Wed, 17 May 2000 03:30:17 +0200
From: "Andreas Backsjö" <a_backsjo@hotmail.com>
Subject: Socket problem
Message-Id: <8fsscg$nj6$1@zingo.tninet.se>

Hi,

I'm writing an app in Perl that sends and gets XML documents to/from a
server. It first works fine but when I get a specific document from the
server something gets wrong. When I try to left the last while loop it takes
4 min before it really leaves. I have used some printf debuging and which
way I try to use (last; return, close socket) it always runs fast to the
line I use to left the loop and then it stops for 4 minutes. Then it's
working normal again...

I'm pretty new to use Perl so the code is probably not the most efficient
one...

sub sendXML {
    my $host   = shift;
    my $port   = shift;
    my (@data) = @_;

    my $proto = getprotobyname ('tcp');
    my $iaddr = gethostbyname ($host);
    my $saddr = sockaddr_in ($port, $iaddr);

    socket (CLIENT, PF_INET, SOCK_STREAM, $proto) || die "Unable to open
socket: $!\n";
    connect (CLIENT, $saddr) || die "Unable to connect: $!\n";

    select ((select (CLIENT), $|++)[0]);

    for my $row (@data){
        print CLIENT $row;
    }

    my (@Ret);
    my $i = "3456";
    my $t= "9";

#Here some while's follows because the server has a timeout (30sec)
#before it close the socket. This way I can quit reading when I have got
everything

    while (<CLIENT>) {   #goes throw the html header to find length
        printf ("Got: \"%s\"\n", $_);
        $i = $1 if /^Content-Length: (.*)/;
        push @Ret, $_;

        if ($i!="3456"){
            last;
        }
    }
    while (<CLIENT>) {   #reads the rest of header befor the XML
        printf ("Got2: \"%s\"\n", $_);
        $t = $1 if /^<(.*)x/;
        push @Ret, $_;
        if ($t!="9"){
            $i-=length;  #has already read the first XML line
            last;
        }
    }
    while(<CLIENT>) {
        printf ("Got3: \"%s\"\n", $_); #Reads the rest of XML
        push @Ret, $_;
        if ($i<=length ($_)){
            last;            #Here it waits for 4 minutes
        }
    $i-=length;
    }

 close (CLIENT);    #After 4 minutes it closes the CLIENT...
 return (@Ret);
}


I have also tried to rewrite the the code and use recv insted. Then it takes
1 min instead from "last...\n" to
"left while" prints on the screen.

        while($PipeID
"){  
                recv(CLIENT, $tmp, 444, 0);        #444: I gets all the data I want.
                printf("Recv:%s\n",$tmp);
                $DialogID = $1 if $tmp =~ /<DialogID>(.*)<\/DialogID>/;
                $PipeID = $1 if $tmp =~ /<PipeID>(.*)<\/PipeID>/;
                printf("DialogID:%s PipeID:%s\n",$DialogID, $PipeID);
                if($PipeID!="0"){            #now I have got all the data
                        printf("Shuting down\n");
                        shutdown(CLIENT,2);
                         printf("last...\n");
                        last;
                }
        }
        printf("left while");


Best Regards
Andreas





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

Date: Wed, 17 May 2000 03:48:13 +0200
From: "Andreas Backsjö" <a_backsjo@hotmail.com>
Subject: Re: Socket problem
Message-Id: <8fste4$p9p$1@zingo.tninet.se>

Hi, here is the XML file that I get from the server:

HTTP/1.1 200 OK
Server: JavaWebServer/2.0
Content-Type: text/xml
Content-Length: 482
Connection: Keep-Alive
Date: Tue, 16 May 2000 12:56:35 GMT

<?xml version="1.0" encoding="ISO-8859-1"?>
<Response Code="0">
    <Dialog_v1.1>

<open>dialog-ic-sp1958843656747<DialogID>dialog-ic-sp1958481796747</DialogID
>

<PipeID>000000000000001a49444c3a736572766963652f4469616c6f675f76313a312e3000
00000000000
10000000000000054000102000000000e3139375e3136352e38362e3532009e0f00000034005
64201000000
1c2f6469616c6f672d69632d7370312f5472616e7369656e74504f394827000004000038c700
00000000000
00000000000:</PipeID>
        </open>
    </Dialog_v1.1>
</Response>

Best Regards
Andreas





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

Date: Wed, 17 May 2000 11:25:51 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: string starts with?
Message-Id: <3921F51F.10F@modulus.com.au>

Ilja wrote:
> 
> In article <3921164C.6313@modulus.com.au>,
>   phill@modulus.com.au wrote:
> > Henjo wrote:
> > >
> > > How can I check if a string starts with another string?
> > > For example:
> > >
> > > I want to check if the string "iamareallycoolstring" starts with "iamnot"
> >
> > 1. Using regexs
> > $_ = 'iamareallycoolstring';
> > /^iamnot.*/ && print "starts with iamnot\n";
> 
> /^iamnot/ && print "starts with iamnot\n";
> 
> Ilja.
Well caught! I need to think more like a machine...
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Tue, 16 May 2000 21:09:09 -0400
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
To: reedjd@bitsmart.com
Subject: Re: Time with a finer granularity
Message-Id: <Pine.OSF.4.21.0005162108550.25154-100000@mail.med.upenn.edu>

There is a module on CPAN: Time::Hires, I think.


On Wed, 17 May 2000 reedjd@bitsmart.com wrote:

> Date: Wed, 17 May 2000 00:18:23 GMT
> From: reedjd@bitsmart.com
> Newsgroups: comp.lang.perl.misc
> Subject: Time with a finer granularity
> 
> I'm currently use the time() method to time an operation, but this
> method only goes down to the second.  Is there a perl module out there
> where I could get time information to a smaller degree?
> 
> -Jordan Reed
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 



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

Date: Tue, 16 May 2000 19:49:20 -0700
From: bjanko <waldo700NOwaSPAM@aol.com.invalid>
Subject: Re: What's this line which Perl added to AUTOEXEC.BAT?
Message-Id: <173e8bff.2d0804e0@usw-ex0106-047.remarq.com>

Thanks to those of you who have shown understanding and provided
useful information.

For the record, I actually know what the PATH setting is for.  I
just didn't know what the command "SET" did.

I also have to differ to those of you who refer me to a Windows
group.  Since this happened with an installation of Perl, and
the autoexec.bat was modified by the Perl installation, then
this is obviously the place to ask the question.  I'm sure some
Windows folks could tell me all about PATH and SET, but they
wouldn't know the peculiarities of installing Perl or ActivePerl
on Windows; only you Perl folks would know that.

Thanks again for your help. : )

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: 17 May 2000 01:47:59 GMT
From: skoch71@aol.com (SKoch71)
Subject: win32 file version
Message-Id: <20000516214759.15462.00000108@ng-xg1.aol.com>

Is there anything within any of the Win32 modules that will allow me to
determine the version of a Windows file, e.g. File -> Properties -> Version.  I
poked around the Win32 and Win32API modules in the documentation, but couldn't
find anything that looked like it could do what I was looking for.  The closest
thing I found was, Win32::File::GetAttributes(filename, returnedAttributes) but
that looks like it only returns the standard 'attrib' file attributes.  Any
suggestions would be appreciated.  Thanks.

Steve



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

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 V9 Issue 3071
**************************************


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