[28307] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9671 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 31 18:05:43 2006

Date: Thu, 31 Aug 2006 15:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 31 Aug 2006     Volume: 10 Number: 9671

Today's topics:
    Re: (Off topic) Cyberwar question <SkybuckTheDestroyer@hotmail.com>
    Re: (Off topic) Cyberwar question <tadmc@augustmail.com>
    Re: (Off topic) Cyberwar question <john@castleamber.com>
    Re: (Off topic) Cyberwar question <uri@stemsystems.com>
        ActiveState Perl configuration - encountering an error frank@rangersnorth.net
    Re: ActiveState Perl configuration - encountering an er <mgarrish@gmail.com>
    Re: ActiveState Perl configuration - encountering an er <news@lawshouse.org>
    Re: ActiveState Perl configuration - encountering an er frank@rangersnorth.net
    Re: Close a Running Sub-Process <mumebuhi@gmail.com>
    Re: Hi Guys ! <justin.0608@purestblue.com>
        how to get the output from: Win32::Process::Create joez3@yahoo.com
    Re: how to get the output from: Win32::Process::Create <mritty@gmail.com>
    Re: how to get the output from: Win32::Process::Create joez3@yahoo.com
    Re: how to get the output from: Win32::Process::Create joez3@yahoo.com
    Re: how to get the output from: Win32::Process::Create <mritty@gmail.com>
    Re: how to get the output from: Win32::Process::Create <mritty@gmail.com>
    Re: imagemagick very slow - is there anything better? <kees@example.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 31 Aug 2006 12:56:44 -0700
From: "Skybuck The Destroyer" <SkybuckTheDestroyer@hotmail.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <1157054204.206518.128630@74g2000cwt.googlegroups.com>


Uri Guttman wrote:
> why does saying it is off topic make it ok to post off topic stuff here?

It seems common practice to mention off topic when appriorate or in
doubt.

It makes it more easy for filters to filter it out.

I thought I also read it somewhere in a posting guideline...

> do you have a perl question?

Yeah,

Do you wanna join my CyberArmy ? So you can write perl scripts so that
users can install it on their websites and stuff like that ?

To block the Evil Tiscali ISP ?!

Going to Cyberwar is a lot of work you know... some many different
scripting languages and things to do. It would help if somebody else
wrote the perl scripts and tested it... 

Bye,
  Skybuck ;)



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

Date: Thu, 31 Aug 2006 15:00:54 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <slrnefefvm.7jm.tadmc@magna.augustmail.com>

Skybuck <skybuck2000@hotmail.com> wrote:


> Subject: (Off topic) Cyberwar question


Making off topic posts is rude.

Labelling an off topic post does not make it any less rude.


> One of my internet providers has blocked my broadband adsl internet


> Bye,


Good!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 31 Aug 2006 20:41:07 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <Xns98309F8EB2336castleamber@130.133.1.4>

Tad McClellan <tadmc@augustmail.com> wrote:

> Skybuck <skybuck2000@hotmail.com> wrote:
> 
> 
>> Subject: (Off topic) Cyberwar question
> 
> 
> Making off topic posts is rude.

Skybuck is a 15 year old kid (?) that has been kicked away by at least one 
ISP for a good reason. A welcome addition to a kill file, but on the other 
hand, he has a short attention span, and might be gone tomorrow.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: Thu, 31 Aug 2006 17:28:52 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <x7odu0ioh7.fsf@mail.sysarch.com>

>>>>> "STD" == Skybuck The Destroyer <SkybuckTheDestroyer@hotmail.com> writes:

  STD> Uri Guttman wrote:
  >> why does saying it is off topic make it ok to post off topic stuff here?

  STD> It seems common practice to mention off topic when appriorate or in
  STD> doubt.

  STD> It makes it more easy for filters to filter it out.

  STD> I thought I also read it somewhere in a posting guideline...

not here. no off topic posts allowed. find an appropriate newsgroup and
post it there.

  >> do you have a perl question?

  STD> Yeah,

  STD> Do you wanna join my CyberArmy ? So you can write perl scripts so that
  STD> users can install it on their websites and stuff like that ?

that is not a perl question. you want to hire perl hackers go to
jobs.perl.org.

  STD> Going to Cyberwar is a lot of work you know... some many different
  STD> scripting languages and things to do. It would help if somebody else
  STD> wrote the perl scripts and tested it... 

not going there. bye bye.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 31 Aug 2006 13:17:45 -0700
From: frank@rangersnorth.net
Subject: ActiveState Perl configuration - encountering an error
Message-Id: <1157055465.000000.63340@m79g2000cwm.googlegroups.com>

My apologies if this isn't the best place to post this question, but
its the best I could find.

I'm trying to install Radiator's Radius server on a Windows XP machine.
 As part of the installation process, ActiveState's ActivePerl must be
installed first.  I've run the MSI and successfully installed the
software.

I am now following the instructions that I have and trying to install
the packages that the setup requires through the PPM (Perl Package
Manager), specifically "install DBI".

However, attempting to do so generates the following error:

"Error: No valid repositories: Error 500: Can't connect to
ppm.ActiveState.com:80 (connect: Unknown error) Error: 500 Can't
connect to ppm.ActiveState.com:80 (connect: Unknown error)"

I'm guessing that this is a result of a setting within my environment
(either the machine or, more likely, my network), but I don't
understand enough about what the "install" command is doing (i.e., is
it trying to ftp a file from the ActiveState website or is it doing
something else) to effectively troubleshoot the problem and put
together a solution.

I started by asking ActiveState's support group but I have not seen a
response from them yet and I'm hoping that someone here might be able
to shed some light on what's going on.

Thanks,

   Frank



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

Date: 31 Aug 2006 13:43:43 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: ActiveState Perl configuration - encountering an error
Message-Id: <1157057023.445933.246320@e3g2000cwe.googlegroups.com>


frank@rangersnorth.net wrote:

> My apologies if this isn't the best place to post this question, but
> its the best I could find.
>
> I'm trying to install Radiator's Radius server on a Windows XP machine.
>  As part of the installation process, ActiveState's ActivePerl must be
> installed first.  I've run the MSI and successfully installed the
> software.
>
> I am now following the instructions that I have and trying to install
> the packages that the setup requires through the PPM (Perl Package
> Manager), specifically "install DBI".
>
> However, attempting to do so generates the following error:
>
> "Error: No valid repositories: Error 500: Can't connect to
> ppm.ActiveState.com:80 (connect: Unknown error) Error: 500 Can't
> connect to ppm.ActiveState.com:80 (connect: Unknown error)"
>

The most likely causes are a firewall, no internet connectivity on the
machine, or that their repositories were offline for whatever reason
when you were trying to connect.

PPM will first search the repository for a matching ppd file, and if
one is found it will use the instructions in the file to download and
install the module for you. If you have internet connectivity on the
box there shouldn't be any problem running the program.

You could always try installing another repository as per the
documentation. Randy Kobe's theoryx5.uwinnipeg.ca repository is usually
much better than ActiveState's anyway.

Matt



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

Date: Thu, 31 Aug 2006 21:47:06 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: ActiveState Perl configuration - encountering an error
Message-Id: <1157057224.4047.0@proxy00.news.clara.net>

frank@rangersnorth.net wrote:
> My apologies if this isn't the best place to post this question, but
> its the best I could find.

Y, strictly that's off topic; this is a Perl _language_ group.

But have you Googled?  I did, on your behalf, using [ "can't connect to 
ppm.ActiveState.com:80" ] as the argument.  Got lots of hits, some of 
them talking about proxies and such.  Suggest you follow that up, 
because your problem is (IMO) to do with your network setup, not Perl.

-- 

Henry Law       <><     Manchester, England


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

Date: 31 Aug 2006 13:53:02 -0700
From: frank@rangersnorth.net
Subject: Re: ActiveState Perl configuration - encountering an error
Message-Id: <1157057582.344571.146700@i42g2000cwa.googlegroups.com>

Matt Garrish wrote:
> The most likely causes are a firewall, no internet connectivity on the
> machine, or that their repositories were offline for whatever reason
> when you were trying to connect.
>
> PPM will first search the repository for a matching ppd file, and if
> one is found it will use the instructions in the file to download and
> install the module for you. If you have internet connectivity on the
> box there shouldn't be any problem running the program.
>
> You could always try installing another repository as per the
> documentation. Randy Kobe's theoryx5.uwinnipeg.ca repository is usually
> much better than ActiveState's anyway.
>
> Matt

As I have internet connectivity, I'm assuming that it's having a
problem with the firewall.  I guess my question then becomes, what
technology is PPM using to access ActivePerl's site?  Is it HTTP or
FTP?

But, regarding your alternative, it seems possible that I can download
what I need from either ActiveState's website or Randy Kobe's site and
then install from there without issue.



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

Date: 31 Aug 2006 14:18:03 -0700
From: "mumebuhi" <mumebuhi@gmail.com>
Subject: Re: Close a Running Sub-Process
Message-Id: <1157059083.166155.123120@e3g2000cwe.googlegroups.com>

> > You capture the pid of the running process (it is the return value of a
> > pipe open), and then you kill it just prior to the close.
> >
> > my $pid=open my $fh, $cmd or die $!;
> > #....
> > kill 1,$pid;
> > close $fh;

This is it. This is the perfect solution for the time being. The
particular remote process, fortunately, does not need to be killed
because it is intended that way. I am with you that this is probably
not a safe if the remote process needs to be cleaned up properly.

Thank you very much, Xho!


Buhi



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

Date: Thu, 31 Aug 2006 20:34:07 -0000
From: Justin C <justin.0608@purestblue.com>
Subject: Re: Hi Guys !
Message-Id: <slrnefehrn.56r.justin.0608@moonlight.purestblue.com>

On 2006-08-31, rock <rajeshmvj@gmail.com> wrote:
> Yes
> i will explain i want to know abt the latest recuitment in perl for 1
> year experienced programmars

AFAIK perl is not an employer TICBW.


	Justin.

-- 
Justin C, by the sea. 


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

Date: 31 Aug 2006 11:58:09 -0700
From: joez3@yahoo.com
Subject: how to get the output from: Win32::Process::Create
Message-Id: <1157050689.570167.105340@b28g2000cwb.googlegroups.com>

Hi all,
This might be more a windows question then perl, but lets see if
someone can help me out. I am using Win32::Process::Create to start up
an exe. I can get exe to start, but I need to get what is put out on
the command prompt.
If i try text.exe > temp.txt I can start the exe and the temp.txt file
gets created, but nothing is in it. The text is put in another command
prompt window. So this rules out using system () to start the exe.
Then I tried:
open (FHCMD, Win32::Process::Create($processObj, $appName,
$commandLine, 1, DETACHED_PROCESS, ".")." |");

while (<FHCMD>) {
	print $_;
}

close (FHCMD);

This start the exe, but nothing is put in FHCMD.
Any ideas on how i get the output?
Thanks,
zim



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

Date: 31 Aug 2006 12:03:46 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: how to get the output from: Win32::Process::Create
Message-Id: <1157051026.858286.286990@m73g2000cwd.googlegroups.com>

joez3@yahoo.com wrote:
> Hi all,
> This might be more a windows question then perl, but lets see if
> someone can help me out. I am using Win32::Process::Create to start up
> an exe. I can get exe to start, but I need to get what is put out on
> the command prompt.
> If i try text.exe > temp.txt I can start the exe and the temp.txt file
> gets created, but nothing is in it. The text is put in another command
> prompt window. So this rules out using system () to start the exe.

Is there any particular reason you're not just using backticks?

perldoc perlop
(search for qx)

Paul Lalli



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

Date: 31 Aug 2006 12:27:33 -0700
From: joez3@yahoo.com
Subject: Re: how to get the output from: Win32::Process::Create
Message-Id: <1157052453.886864.115420@m73g2000cwd.googlegroups.com>


Paul Lalli wrote:
> joez3@yahoo.com wrote:
> > Hi all,
> > This might be more a windows question then perl, but lets see if
> > someone can help me out. I am using Win32::Process::Create to start up
> > an exe. I can get exe to start, but I need to get what is put out on
> > the command prompt.
> > If i try text.exe > temp.txt I can start the exe and the temp.txt file
> > gets created, but nothing is in it. The text is put in another command
> > prompt window. So this rules out using system () to start the exe.
>
> Is there any particular reason you're not just using backticks?
>
> perldoc perlop
> (search for qx)
>
> Paul Lalli

Hi Paul,
I am not sure what the backticks buy me, i can start up the exe with
the Process::Create. Maybe i should have said more about the exe under
test, its a program that will stay up untill I kill it. By using the
Process::Create I can get the pid and use that to kill it. With the
backticks I tried the following:
open (FHCMD, `start test.exe`." | ");
while (<FHCMD>) {
	print $_;
}
This starts the test.exe, but it ends up hanging the perl script and I
can't get the contents of FHCMD.
What should I try next?
Thanks,
zim



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

Date: 31 Aug 2006 12:28:07 -0700
From: joez3@yahoo.com
Subject: Re: how to get the output from: Win32::Process::Create
Message-Id: <1157052487.806834.263840@h48g2000cwc.googlegroups.com>


Paul Lalli wrote:
> joez3@yahoo.com wrote:
> > Hi all,
> > This might be more a windows question then perl, but lets see if
> > someone can help me out. I am using Win32::Process::Create to start up
> > an exe. I can get exe to start, but I need to get what is put out on
> > the command prompt.
> > If i try text.exe > temp.txt I can start the exe and the temp.txt file
> > gets created, but nothing is in it. The text is put in another command
> > prompt window. So this rules out using system () to start the exe.
>
> Is there any particular reason you're not just using backticks?
>
> perldoc perlop
> (search for qx)
>
> Paul Lalli

Hi Paul,
I am not sure what the backticks buy me, i can start up the exe with
the Process::Create. Maybe i should have said more about the exe under
test, its a program that will stay up untill I kill it. By using the
Process::Create I can get the pid and use that to kill it. With the
backticks I tried the following:
open (FHCMD, `start test.exe`." | ");
while (<FHCMD>) {
	print $_;
}
This starts the test.exe, but it ends up hanging the perl script and I
can't get the contents of FHCMD.
What should I try next?
Thanks,
zim



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

Date: 31 Aug 2006 13:05:32 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: how to get the output from: Win32::Process::Create
Message-Id: <1157054732.891009.254580@p79g2000cwp.googlegroups.com>

joez3@yahoo.com wrote:
> Paul Lalli wrote:
> > joez3@yahoo.com wrote:
> > > Hi all,
> > > This might be more a windows question then perl, but lets see if
> > > someone can help me out. I am using Win32::Process::Create to start up
> > > an exe. I can get exe to start, but I need to get what is put out on
> > > the command prompt.
> > > If i try text.exe > temp.txt I can start the exe and the temp.txt file
> > > gets created, but nothing is in it. The text is put in another command
> > > prompt window. So this rules out using system () to start the exe.
> >
> > Is there any particular reason you're not just using backticks?
> >
> > perldoc perlop
> > (search for qx)

> I am not sure what the backticks buy me,

They buy you the ability to get the output of your program, which is
what you said you wanted.

> i can start up the exe with
> the Process::Create. Maybe i should have said more about the exe under
> test, its a program that will stay up untill I kill it. By using the
> Process::Create I can get the pid and use that to kill it. With the
> backticks I tried the following:
> open (FHCMD, `start test.exe`." | ");

This makes just as little sense as your original.
Win32::Process::Create returns either 0 or non-zero depending on
whether or not the program was successfully started.  Backticks return
the output of the command.  You're trying to open a pipe to these
return values, instead of opening a pipe to the actual command.

> while (<FHCMD>) {
> 	print $_;
> }
> This starts the test.exe, but it ends up hanging the perl script and I
> can't get the contents of FHCMD.
> What should I try next?

You should take a step back and think about what it is you're actually
trying to do, and how to go about doing it.  Your last two attempts
have been nonsensical, which is a sure sign that you've reached the
point of frustration and are now throwing things at the wall to see
what sticks.

You apparently have two requirements.  One is that you need to capture
the output of the program.  The other is that you need to get the pid
of the program so you can later kill it.   These two requirements seem,
to me, to be contraditory.  The only way it makes sense is if you don't
want your Perl script to do anything else while this program is
running.  Is that correct?  If so: open a pipe to the process.  Start
reading its output.  Whenever you've decided you want to kill it, exit
the loop and close the handle.  IIRC, that will send a SIGPIPE to the
program, effectively terminating it.

open my $pipe, "test.exe |" or die "Cannot start program: $!";
while (my $line = <$pipe>) {
  #do something with $line
  if (want_to_kill()) {
    last;
  }
}
close $pipe;

Paul Lalli



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

Date: 31 Aug 2006 13:12:09 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: how to get the output from: Win32::Process::Create
Message-Id: <1157055129.443170.56080@e3g2000cwe.googlegroups.com>

Paul Lalli wrote:
> You apparently have two requirements.  One is that you need to capture
> the output of the program.  The other is that you need to get the pid
> of the program so you can later kill it.   These two requirements seem,
> to me, to be contraditory.

I guess the other possibility is to fork your program, and set up the
child to have a signal handler to be notified when the parent wants to
kill it....

[untested]

my $pid = fork();
if ($pid == 0) { #child

  $SIG{INT} = sub { print "Parent told me to die!\n";  exit };

  open my $pipe, "test.exe |" or die "Cannot open pipe: $!";
  while (my $line = <$pipe>) {
    process_line($line);
  }
  print "test.exe ended before parent told me to die!\n";
}
else { #parent
  #do stuff
  # la la la
  if (want_to_kill()) {
     kill ('INT', $pid);
  }
  #do more stuff, la la la
}

Paul Lalli



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

Date: Thu, 31 Aug 2006 21:29:14 +0200
From: Kees <kees@example.net>
Subject: Re: imagemagick very slow - is there anything better?
Message-Id: <44f7388b$0$4519$e4fe514c@news.xs4all.nl>

Peter J. Holzer schreef:
> On 2006-08-30 19:10, Kees <kees@example.net> wrote:
>> Your source image is 4143 x 4728, assuming true color (you mentioned 
>> jpeg, otherwise better go for png), that is about 450 Mb.
>                                                     ^^^^^^^
> Just to clarify, that's 450 Mbits, not 450 Mbytes. Assuming that 24 bits
> of image data are stored in 4 bytes of memory, that translates to about
> 74 Mbytes.

You are correct, and I should have been more clear on this.

Kees


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

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


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