[18671] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 839 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 5 21:05:51 2001

Date: Sat, 5 May 2001 18:05:11 -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: <989111111-v10-i839@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 5 May 2001     Volume: 10 Number: 839

Today's topics:
        Command not found when opening "-|" <Hans.de.Bruin@chello.nl>
    Re: cookie expiry <andras@mortgagestats.com>
    Re: Doc about sockets <djmarcus@ex-pressnet.com>
    Re: Doc about sockets <bart.lateur@skynet.be>
        DOS Perl convering LF to CR/LF <dbmartin5@home.com>
    Re: foreach in a deep hash <godzilla@stomp.stomp.tokyo>
    Re: HELP - Please <vbook@americasm01.nt.com>
    Re: HELP - Please (Abigail)
        Help on optimization wanted <michael@stroeck.com>
    Re: Help on optimization wanted (Charlie Reiss)
    Re: Help on optimization wanted (Gwyn Judd)
        Help slim down Perl code (Falc2199)
    Re: How to execute a perl script from a perl script? -  <admin@nospam.m2n.co.uk>
    Re: How to execute a perl script from a perl script? -  <bastionex@hotmail.com>
    Re: How to execute a perl script from a perl script? -  <bastionex@hotmail.com>
    Re: How to execute a perl script from a perl script? -  <godzilla@stomp.stomp.tokyo>
    Re: How to execute a perl script from a perl script? -  <admin@nospam.m2n.co.uk>
    Re: How to execute a perl script from a perl script? -  <godzilla@stomp.stomp.tokyo>
        I remember someone made a perl parser. <bop@mypad.com>
    Re: I remember someone made a perl parser. <bart.lateur@skynet.be>
    Re: I remember someone made a perl parser. <bop@mypad.com>
        Java args <korvin@kki.net.pl>
    Re: Java args (Alan Barclay)
    Re: leftover Close Wait sockets <skilchen@swissonline.ch>
    Re: leftover Close Wait sockets (Spork Boy)
        Passing references via recursion <temp133@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 05 May 2001 15:23:59 GMT
From: "Hans de Bruin" <Hans.de.Bruin@chello.nl>
Subject: Command not found when opening "-|"
Message-Id: <jWUI6.130242$eL4.32513239@Flipper>


When I try to open "-|" or "|-" my os responses that "-" is not a command or
batch file which it can run. Is there a solution to this, or an other sane
way to let two processes talk to one another?

Hans

(WinNT4SP6 / ActivePerl 5.6.1)




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

Date: Sat, 05 May 2001 13:39:47 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: cookie expiry
Message-Id: <3AF43AE3.3258DE9A@mortgagestats.com>



Troy Boy wrote:

> Hi there,
>             I have troubles resetting cookie expiry time in IE and some
> versions of Netscape on Linux.
>
> The code i use is as follows
>
> $the_cookie = cookie(-name=>'sid',
>                          -value=>$session_id,
>                          -expires=>'+2m',
>                          -domain=>'.vicnet.net.au',
>                          -path=>'/');
>
> print header(-cookie=>$the_cookie);
>
> Time passes..........The user hits on a log out button and the same code is
> called..but the expires variable gets reset to '1s' .My problem is...that it
> doesn't take this into account..and keeps the cookie active till the 2
> minutes have passed.
>
> Has anyone come across this problem..?
>
> --
> ----------------------------------------------------------------
> Troy Rasiah
> Melbourne, Aus

Check out this resource:
http://support.microsoft.com/support/kb/articles/q189/8/54.asp?LN=EN-US&SD=gn&FR=0&qry=cookie&rnk=15&src=DHCS_MSPSS_gn_SRCH&SPR=IE

"Microsoft has confirmed this to be a problem in Microsoft Internet Explorer
4.01. "




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

Date: Sat, 5 May 2001 12:57:15 -0400
From: "David J. Marcus" <djmarcus@ex-pressnet.com>
Subject: Re: Doc about sockets
Message-Id: <tf8c6vpaahb6c0@corp.supernews.com>

Hi

I had the same problem.

I found a good write-up in the book:
    Professional Perl Programming
    - Peter Wainright, WROX Publishers, isbn: 1-861004-49-4

Chapter 23 has a good discussion on sockets and network programming.

The material you are looking for is pages 972-973.

The only symbol I could not find the definition for is SOL_SOCKET which when
used for the 'LEVEL' parameters means that the request applies to the socket
itself.

I hope this helps

-Regards
David

"Evelio Martinez" <evelio.martinez@testanet.com> wrote in message
news:3AF2F3D0.ED993E70@testanet.com...
>
> Where can I find doc about the distinct values por socket parameters
> functions ?
>
> ,LEVEL,OPTNAME,OPTVAL etc
>
> --
> Evelio Martínez
>




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

Date: Sat, 05 May 2001 21:48:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Doc about sockets
Message-Id: <ees8ft8gepb0idbakq1q6utfk7t4tgr9g8@4ax.com>

Evelio Martinez wrote:

>Where can I find doc about the distinct values por socket parameters
>functions ?
>
>,LEVEL,OPTNAME,OPTVAL etc

Lincoln Steins book, "Network Programming with Perl", is really great.

	<http://www.modperl.com/perl_networking/>

Then, there's that classic, so they say, by W. Richard Stevens: "UNIX
Network Programming":

	<http://www.kohala.com/start/unpv22e/unpv22e.html>

-- 
	Bart.


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

Date: Sat, 05 May 2001 23:03:18 GMT
From: David <dbmartin5@home.com>
Subject: DOS Perl convering LF to CR/LF
Message-Id: <md19ft8no5d7r69vhu8rqig9odu2fqjkps@4ax.com>

I am reading a Unix file on a DOS machines which contains lines ending
in a LF.  The program reads in the line, but when I reprint them to
another file, the LF is now a CR/LF!  Is there a way to prevent perl
from this conversion or do I need to cop off the end and print ending
with a LF?

Also, what is the control char(s) for LF only, eg. like the "\n" for
CRLF?

Thanks



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

Date: Sat, 05 May 2001 09:33:58 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: foreach in a deep hash
Message-Id: <3AF42B76.668E811E@stomp.stomp.tokyo>

kb wrote:

(snippage)

> i cannot figure out how to use the foreach function
> when i have a hash with more then 2 dimensions.
 
> here is my hash

> this is the structure:
> $Person{$Name}
> $Person{$Name}{$CarBrand}{Color}
> $Person{$Name}{$CarBrand}{Type}
> $Person{$Name}{$BikeBrand}{NoOfGears}
> $Person{$Name}{$BikeBrand}{Type}


I've followed this thread for a period of time
and have enjoyed a moderate amount of humor.

Your approach to database management is less
than logical and introduces wasteful complexiety.

Strictly confining my remarks to your stated
parameters, it would be more logical to create
two databases, both flat and intended for a
split into variables to manipulate.

car.dat

$person_name:$brand:$type:$color

bike.dat

$person_name:$brand:$type:$gears

There ya go. Databases which can be quickly
and efficiently accessed via a while loop.
This affords easy criteria indexing based
on four parameters.


Godzilla!


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

Date: Sat, 05 May 2001 11:26:53 -0400
From: "Methods, Verification [SKY:1G20:EXCH]" <vbook@americasm01.nt.com>
Subject: Re: HELP - Please
Message-Id: <3AF41BBD.426EDE7@americasm01.nt.com>

Jfreeman wrote:

>
>
> > Hello Perl wizards...
>
>
> Script compiles but I havent bothered running it.
>
> James

Thank's a lot James, this has been of much help to me.



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

Date: Sat, 5 May 2001 18:27:58 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: HELP - Please
Message-Id: <slrn9f8hhe.j3h.abigail@tsathoggua.rlyeh.net>

Jfreeman (jfreeman@tassie.net.au) wrote on MMDCCCIV September MCMXCIII in
<URL:news:3AF404C9.96C49A52@tassie.net.au>:
[]  
[] > open(SRCFILE, "$srcdir/$src.txt");              # Open source file
[]  
[]  forgotten <

So, here it's a mistake to leave off something that is not needed...

[] > @contents = <SRCFILE>;
[] > close(SRCFILE);
[]  
[]  don't need (  )

And here it's a mistake to have something that might be left off?

What kind of rules do you live by?



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


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

Date: Sun, 6 May 2001 00:46:55 +0200
From: "Michael Ströck" <michael@stroeck.com>
Subject: Help on optimization wanted
Message-Id: <3af482be$1@e-post.inode.at>

Hi to all !

One of our CS teachers at school told me to write a
script that finds all primes from 1 - n.

Writing that script was easy, but as I'm very new to
Perl, I'd really appreciate any comments on how to
make the following script run faster.

What I've done so far:
- I only divide by known primes.
- I increase $number_to_test by 2 at each pass, so
I don't iterate over even numbers (with starting at 1
and pushing 2 onto the array by hand).
- I tried to minimize the loop to the smallest number
of instructions.

Any comments on style and speed are highly appreciated.

===================================
#! put shebang here
use strict;
use warnings;

my @primes;
my $current_number=1;
my $numbers_to_test=100000;

push (@primes, 2);

LOOP:
while ($current_number <= $numbers_to_test) {
    $current_number+=2;
    foreach (@primes) {
        next LOOP if ($current_number % $_ == 0);
    }
    push (@primes, $current_number);
}

open (OUTPUT, ">primes.txt")
    or die "ERROR: Can't create output-file: $!";
foreach (@primes) {
    print OUTPUT "$_\n";
}
close OUTPUT
    or die "ERROR: Can't close output-file; $!";
===================================

Michael Ströck




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

Date: Sun, 6 May 2001 00:02:53 +0000 (UTC)
From: car@fred.cs.brown.edu (Charlie Reiss)
Subject: Re: Help on optimization wanted
Message-Id: <9d24bd$lgb$1@saturn.services.brown.edu>

In article <3af482be$1@e-post.inode.at>, Michael Ströck wrote:
>Hi to all !
>
>One of our CS teachers at school told me to write a
>script that finds all primes from 1 - n.
>
>Writing that script was easy, but as I'm very new to
>Perl, I'd really appreciate any comments on how to
>make the following script run faster.
>
>What I've done so far:
>- I only divide by known primes.

You don't need to check all known primes, even. See below.

>- I increase $number_to_test by 2 at each pass, so
>I don't iterate over even numbers (with starting at 1
>and pushing 2 onto the array by hand).

Prehaps you want to start with $current_number = 3,
and increment it by two in a continue block. I think that
would be more clear, since $current_number would actually
start with the first current value.

>- I tried to minimize the loop to the smallest number
>of instructions.
>
>Any comments on style and speed are highly appreciated.
>
>===================================
>#! put shebang here
>use strict;
>use warnings;
>
>my @primes;
>my $current_number=1;
>my $numbers_to_test=100000;
my $cur_sqrt = 1;
>
>push (@primes, 2);
>
>LOOP:
>while ($current_number <= $numbers_to_test) {
>    $current_number+=2;
     $cur_sqrt = int(sqrt($current_number))
>    foreach (@primes) {
>        next LOOP if ($current_number % $_ == 0);
# if a number is factorable into x*y, then
# either x and y must equal sqrt(the number)
# or one must be greater, and one lesser.
# Proof is simple. As a result of this,
# you only need to check for the prime factor
# less then the sqrt() of the number in question. 
         last if ($cur_sqrt <= $_);
>    }
>    push (@primes, $current_number);
>}
>
>open (OUTPUT, ">primes.txt")
>    or die "ERROR: Can't create output-file: $!";
>foreach (@primes) {
>    print OUTPUT "$_\n";
>}
>close OUTPUT
>    or die "ERROR: Can't close output-file; $!";
As long as you are going to be outputing this, why not output
it while you are finding the prime numbers?

-- 


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

Date: Sun, 06 May 2001 00:40:50 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Help on optimization wanted
Message-Id: <slrn9f97cg.l6k.tjla@thislove.dyndns.org>

"mein Luftkissenfahrzeug ist voll von den Aalen"
said Michael Ströck (michael@stroeck.com) in 
<3af482be$1@e-post.inode.at>:
>#! put shebang here
>use strict;
>use warnings;
 use integer;
>
>my @primes;
>my $current_number=1;
>my $numbers_to_test=100000;
>
>push (@primes, 2);
>
>LOOP:
>while ($current_number <= $numbers_to_test) {
>    $current_number+=2;
     PRIME:
>    foreach (@primes) {
>        next LOOP if ($current_number % $_ == 0);
         last PRIME if $_ ** 2 >= $current_number;
>    }
>    push (@primes, $current_number);
>}

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
You know it's Monday when you wake up and it's Tuesday.
		-- Garfield


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

Date: 05 May 2001 23:16:21 GMT
From: falc2199@aol.comNOJUNK (Falc2199)
Subject: Help slim down Perl code
Message-Id: <20010505191621.15352.00002168@ng-xc1.aol.com>

I have here a lot of reduntant code. I need a way to slim it down. It bascially
does the same thing over and over, open and a file and read the contents into
an array....

$lChoiceFile = 'lChoice.txt';

open (LCHOICE,"<$lChoiceFile");
@lCarray=<LCHOICE>;
close (lCHOICE);

$oChoiceFile = 'oChoice.txt';


open (OCHOICE,"<$oChoiceFile");
@oCarray=<OCHOICE>;
close (OCHOICE);

$bChoiceFile = 'bChoice.txt';

open (BCHOICE,"<$bChoiceFile");
@bCarray=<BCHOICE>;
close (BCHOICE);

It works fine but as you can see I am repeating it often. I think arrays/for
loops or an openFile function might be a good way to cut it down but niether
seem to work. 

You see I need each of those arrays @lCarry and @tCarry later on in the code.
If I use arrays/ for loops then I need mulit-dimensional arrays and if I use a
function then I think I have to pass these arrays by reference so the function
can modify them. I an not sure Perl can do either of this.

Do you any suggestions on how to make this code less repetitive?

Thanks in advance for any help,
Jehan


To e-mail, remove NOJUNK


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

Date: Sat, 05 May 2001 21:11:54 +0100
From: HCCO admin <admin@nospam.m2n.co.uk>
Subject: Re: How to execute a perl script from a perl script? - nearly got it   right !
Message-Id: <shn8ft0cjf52tvrsg4vv576jbhfj0srjv8@4ax.com>

On Sat, 05 May 2001 11:59:57 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

>HCCO admin wrote:
> 
>> Godzilla! wrote:
>> >HCCO admin wrote:
>
>(snipped)
>
>> So I refer you back to the original question.
>
>In turn, I will refer you back to my advice and
>politely suggest you read for comprehension.
>
>Godzilla!

Yeah, erm, thanks, I've done that - what I want to do isn't possible
with a SSI from the script in it's present location.
So can anyone else help ?


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

Date: Sat, 5 May 2001 20:40:37 -0400
From: "BastionEX" <bastionex@hotmail.com>
Subject: Re: How to execute a perl script from a perl script? - nearly got it   right !
Message-Id: <bX0J6.19211$nC6.2535529@news20.bellglobal.com>

You can recompile apache to use the supercgi module.

http://wss.hypermart.net/source/apache/mod_scgi.c.gz


http://wss.hypermart.net/source/apache/



I think that is what you want.


"HCCO admin" <admin@nospam.m2n.co.uk> wrote in message
news:shn8ft0cjf52tvrsg4vv576jbhfj0srjv8@4ax.com...
> On Sat, 05 May 2001 11:59:57 -0700, "Godzilla!"
> <godzilla@stomp.stomp.tokyo> wrote:
>
> >HCCO admin wrote:
> >
> >> Godzilla! wrote:
> >> >HCCO admin wrote:
> >
> >(snipped)
> >
> >> So I refer you back to the original question.
> >
> >In turn, I will refer you back to my advice and
> >politely suggest you read for comprehension.
> >
> >Godzilla!
>
> Yeah, erm, thanks, I've done that - what I want to do isn't possible
> with a SSI from the script in it's present location.
> So can anyone else help ?




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

Date: Sat, 5 May 2001 20:42:59 -0400
From: "BastionEX" <bastionex@hotmail.com>
Subject: Re: How to execute a perl script from a perl script? - nearly got it   right !
Message-Id: <rZ0J6.19213$nC6.2535913@news20.bellglobal.com>

oh yeah,

email if you need help.
bop@mypad.com (im on a relatives computer and they dont know anything)
 not bastionex@hotmail.com

"BastionEX" <bastionex@hotmail.com> wrote in message
news:bX0J6.19211$nC6.2535529@news20.bellglobal.com...
> You can recompile apache to use the supercgi module.
>
> http://wss.hypermart.net/source/apache/mod_scgi.c.gz
>
>
> http://wss.hypermart.net/source/apache/
>
>
>
> I think that is what you want.
>
>
> "HCCO admin" <admin@nospam.m2n.co.uk> wrote in message
> news:shn8ft0cjf52tvrsg4vv576jbhfj0srjv8@4ax.com...
> > On Sat, 05 May 2001 11:59:57 -0700, "Godzilla!"
> > <godzilla@stomp.stomp.tokyo> wrote:
> >
> > >HCCO admin wrote:
> > >
> > >> Godzilla! wrote:
> > >> >HCCO admin wrote:
> > >
> > >(snipped)
> > >
> > >> So I refer you back to the original question.
> > >
> > >In turn, I will refer you back to my advice and
> > >politely suggest you read for comprehension.
> > >
> > >Godzilla!
> >
> > Yeah, erm, thanks, I've done that - what I want to do isn't possible
> > with a SSI from the script in it's present location.
> > So can anyone else help ?
>
>




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

Date: Sat, 05 May 2001 11:59:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How to execute a perl script from a perl script? - nearly got it   right !
Message-Id: <3AF44DAD.45CECC92@stomp.stomp.tokyo>

HCCO admin wrote:
 
> Godzilla! wrote:
> >HCCO admin wrote:

(snipped)

> So I refer you back to the original question.

In turn, I will refer you back to my advice and
politely suggest you read for comprehension.

Godzilla!


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

Date: Sat, 05 May 2001 19:08:41 +0100
From: HCCO admin <admin@nospam.m2n.co.uk>
Subject: Re: How to execute a perl script from a perl script? - nearly got it  right !
Message-Id: <7vf8fts1t9qah1sfou6jqu58s0chn3j6i3@4ax.com>

On Sat, 05 May 2001 10:11:53 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

>HCCO admin wrote:
>
>(snipped)
>
>> I'm running a bulletin voard and I want to run a function
>> within the BB from a page on the same server, but 
>> different website.
>
>> <!--#include virtual="/cgi-bin/ultimatebb.cgi?ubb=whos_online_ssi'"-->
>
>> which works on the same site, won't work from the required site.
> 
>> The only thing I could think of was calling the BB script from an
>> intermediate perl script.
>
>> <!--#include virtual="/cgi-bin/show_whosonline.pl"-->
> 
>> then show_whosonline.pl looks like this :
> 
>> #!/usr/bin/perl
>> exec '/home/sites/site2/web/cgi-bin/ultimatebb.cgi',
>> 'ubb=whos_online_ssi';
>
>
>Read and research about use of,
>
><!--#exec cgi="path/to/your/script" -->
>
>type of syntax methodology for including script
>results via a server side includes call. Doing
>so will help you to better understand various
>methods of server side includes calls.
>
>For most server side includes calls to a script,
>you need to print your returned results to your
>page making a server side includes call, a print
>which includes a content type.
>
>print "Content-type: text/plain\n\n";
>print $your_exec_returned_results;
>
>A content type can be safely omitted however this will
>generate an error log entry pertaining to premature
>end of headers, on many operating systems. This type
>of error log entry is unwarranted clutter.
>
>Experimentation will yield what methodology would
>be best to use for your server as server brand and
>server configuration are important externalities.
>
>Spend a bit of time learning about server side includes.
>There are many methods, one of which will be most
>appropriate for your task.
>
>
>Godzilla!


Yes, thanks, I know about server side includes and use them at least
twice on every web page.
And as far as I know you can't include a script somewhere else on a
server aside from beneath the local domain.
So
<!--#include
virtual="home/sites/site2/cgi-bin/ultimatebb.cgi?ubb=whos_online_ssi"-->
in a web page would not work.
The best you can do is
<!--#include virtual="/cgi-bin/ultimatebb.cgi?ubb=whos_online_ssi"-->

Which is pointless since the ultimatebb.cgi script is not in the
'local' cgi folder.

Which is why I'm looking to do it using perl scripts.
So I refer you back to the original question.



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

Date: Sat, 05 May 2001 10:11:53 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How to execute a perl script from a perl script? - nearly got it  right !
Message-Id: <3AF43459.EB4CCA63@stomp.stomp.tokyo>

HCCO admin wrote:

(snipped)

> I'm running a bulletin voard and I want to run a function
> within the BB from a page on the same server, but 
> different website.

> <!--#include virtual="/cgi-bin/ultimatebb.cgi?ubb=whos_online_ssi'"-->

> which works on the same site, won't work from the required site.
 
> The only thing I could think of was calling the BB script from an
> intermediate perl script.

> <!--#include virtual="/cgi-bin/show_whosonline.pl"-->
 
> then show_whosonline.pl looks like this :
 
> #!/usr/bin/perl
> exec '/home/sites/site2/web/cgi-bin/ultimatebb.cgi',
> 'ubb=whos_online_ssi';


Read and research about use of,

<!--#exec cgi="path/to/your/script" -->

type of syntax methodology for including script
results via a server side includes call. Doing
so will help you to better understand various
methods of server side includes calls.

For most server side includes calls to a script,
you need to print your returned results to your
page making a server side includes call, a print
which includes a content type.

print "Content-type: text/plain\n\n";
print $your_exec_returned_results;

A content type can be safely omitted however this will
generate an error log entry pertaining to premature
end of headers, on many operating systems. This type
of error log entry is unwarranted clutter.

Experimentation will yield what methodology would
be best to use for your server as server brand and
server configuration are important externalities.

Spend a bit of time learning about server side includes.
There are many methods, one of which will be most
appropriate for your task.


Godzilla!


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

Date: Sat, 05 May 2001 15:51:54 GMT
From: "flash" <bop@mypad.com>
Subject: I remember someone made a perl parser.
Message-Id: <ukVI6.17499$_f3.335507@news20.bellglobal.com>

Does anyone know where i can get it.

(and i dont mean perl. (www.perl.com)

I mean a seperate perl parser.

--


______
##########################
#    http://www.floodbox.com     #
#       Webhosting only 9.95       #
#    200 MB, Perl, PHP, mysql  #
##########################





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

Date: Sat, 05 May 2001 21:53:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: I remember someone made a perl parser.
Message-Id: <qdt8ftssoik8pquv1t35khe4tuobq456oc@4ax.com>

flash wrote:

>Does anyone know where i can get it.
>
>(and i dont mean perl. (www.perl.com)
>
>I mean a seperate perl parser.

cperl-mode (for Emacs)? perltidy?

Once you know the name, they're easy to find.

-- 
	Bart.


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

Date: Sat, 05 May 2001 22:12:47 GMT
From: "flash" <bop@mypad.com>
Subject: Re: I remember someone made a perl parser.
Message-Id: <zV_I6.19$Kg5.3692@news20.bellglobal.com>

What im doing is i have a program which takes a filename as an argument.

then it will open filename.data
and read the file and do stuff then it will
run the file

system(perl /path/to/file.pl);

Im guessing that is what i can do.

btw how can i get arguments over the command line.
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:qdt8ftssoik8pquv1t35khe4tuobq456oc@4ax.com...
> flash wrote:
>
> >Does anyone know where i can get it.
> >
> >(and i dont mean perl. (www.perl.com)
> >
> >I mean a seperate perl parser.
>
> cperl-mode (for Emacs)? perltidy?
>
> Once you know the name, they're easy to find.
>
> --
> Bart.




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

Date: Sat, 05 May 2001 18:30:06 -0000
From: korvin <korvin@kki.net.pl>
Subject: Java args
Message-Id: <tf8hlehadt0j90@corp.supernews.com>

I start to write programs in Java and try to get the args' value of main 
class. How can I do it?
I've wrote as following:

package second;
import java.util.*;

public class Application2 {

  public static void main(String[] args ) {
  String b = args.toString();
  System.out.println(b);
  }
}

and what I've got is:

[Ljava.lang.String;@310d42

PLEASE HELP!!!

--
Posted via CNET Help.com
http://www.help.com/


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

Date: 5 May 2001 22:07:48 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Java args
Message-Id: <989100392.674806@elaine.furryape.com>

In article <tf8hlehadt0j90@corp.supernews.com>,
korvin  <korvin@kki.net.pl> wrote:
>I start to write programs in Java and try to get the args' value of main 
>class. How can I do it?

Newsgroups: comp.lang.perl.misc

Go pester someone in comp.lang.java.*


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

Date: Sat, 5 May 2001 18:18:22 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: leftover Close Wait sockets
Message-Id: <9d19ct$g2uva$1@ID-13368.news.dfncis.de>

"Spork Boy" <sporkboy@Spork.na> schrieb im Newsbeitrag
news:slrn9f7b0i.sro.sporkboy@Spork.na...
>
> The linux end shows FIN_WAIT2, but those don't take long to go away.
> The Close Wait sockets on the windows machine linger and cause
> problems.

The WinampRC server doesn't seem to call close on the client socket.

What happens if you try something like this as a replacement of
"close(SOCKET)":

shutdown(SOCKET, 1) || die "shutdown write: $!";
while (<SOCKET> {
  print;
}
shutdown(SOCKET, 0) || die "shutdown read: $!";

Maybe the WinampRC server refuses to close the socket until it has
delivered all data it has queued to send to the Linux client.

What happens if you use a simple telnet session to connect to the
WinampRC server? Dou you still get sockets in CLOSE_WAIT state on
the windows machine after closing the telnet session?






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

Date: Sat, 05 May 2001 23:03:56 GMT
From: sporkboy@Spork.na (Spork Boy)
Subject: Re: leftover Close Wait sockets
Message-Id: <slrn9f91mq.u4i.sporkboy@Spork.na>

In article <9d19ct$g2uva$1@ID-13368.news.dfncis.de>, Samuel Kilchenmann wrote:
> "Spork Boy" <sporkboy@Spork.na> schrieb im Newsbeitrag
> news:slrn9f7b0i.sro.sporkboy@Spork.na...
>>
>> The linux end shows FIN_WAIT2, but those don't take long to go away.
>> The Close Wait sockets on the windows machine linger and cause
>> problems.
> 
> The WinampRC server doesn't seem to call close on the client socket.
> 
> What happens if you try something like this as a replacement of
> "close(SOCKET)":
> 
> shutdown(SOCKET, 1) || die "shutdown write: $!";
> while (<SOCKET> {
>   print;
> }
> shutdown(SOCKET, 0) || die "shutdown read: $!";

It says there's an error near }

> 
> Maybe the WinampRC server refuses to close the socket until it has
> delivered all data it has queued to send to the Linux client.

The commands I'm sending don't get any feedback, they just execute commands
on the server side. For the ones that do, I'm taking measures to make it
wait until it's done recieving data.

> 
> What happens if you use a simple telnet session to connect to the
> WinampRC server? Dou you still get sockets in CLOSE_WAIT state on
> the windows machine after closing the telnet session?

yes
Perl does, telnet does, the windows client doesn't.

-- 
+---------------+
|     Spork Boy |
| AIM: Sporkite | If the world didn't suck, we'd all fall off.
|   ICQ: 859886 |
+---------------+


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

Date: Sat, 5 May 2001 17:23:31 -0700
From: "Arvin Portlock" <temp133@hotmail.com>
Subject: Passing references via recursion
Message-Id: <9d25ie$ait$1@agate.berkeley.edu>

I'm using recursion on a tree to append data to a variable.
I want to try and do it without using global variables. I can't
seem to do it.

Here's what I have tried (among various other things):

sub print_locations {
   my $locations;
   recurse ($root, \&append_location, \$locations);
   print $locations;
}

sub recurse {
   my ($node, $subref, $param) = @_;
   if ($node) {
      $subref->($node, $param);
      recurse ($node->{sub}, $subref, $param);
      recurse ($node->{next}, $subref, $param);
   }
}

sub append_location {
   my ($node, $locations) = @_;
   $$locations .= $node->{place};
}

I can get this to print the *first* location only. I can get this
to work easily if I use global variables. Is there a standard
method to doing this kind of thing (I'm still not too comfortable
with this sort of recursion). I know how to do static variables
in perl. Would that be the way to go?

recurse must be reusable. It's used multiple times throughout
the program for a variety of tasks.






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

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.  

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


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