[30016] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1259 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 6 16:09:50 2008

Date: Wed, 6 Feb 2008 13:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 6 Feb 2008     Volume: 11 Number: 1259

Today's topics:
        Connecting to a Server on a Server <deadpickle@gmail.com>
    Re: Connecting to a Server on a Server xhoster@gmail.com
    Re: Connecting to a Server on a Server <deadpickle@gmail.com>
    Re: Connecting to a Server on a Server <ben@morrow.me.uk>
    Re: Connecting to a Server on a Server <deadpickle@gmail.com>
    Re: CPerl mode problem: syntax highlighting stumbles ov <nospam-abuse@ilyaz.org>
        eval EXPR with maximum execution time? alx__21@hotmail.com
    Re: eval EXPR with maximum execution time? <joost@zeekat.nl>
    Re: eval EXPR with maximum execution time? <joost@zeekat.nl>
        getting fieldname of excel sheet <rajendra.prasad@in.bosch.com>
    Re: getting fieldname of excel sheet <jimsgibson@gmail.com>
    Re: Handling user input and program busy <tzz@lifelogs.com>
    Re: How to move perl from one PC to another PC (windows <1usa@llenroc.ude.invalid>
    Re: How to move perl from one PC to another PC (windows <stoupa@practisoft.cz>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 6 Feb 2008 07:55:18 -0800 (PST)
From: deadpickle <deadpickle@gmail.com>
Subject: Connecting to a Server on a Server
Message-Id: <3a6dcd21-8ea4-452a-84ca-9f5ad5e7230f@e4g2000hsg.googlegroups.com>

I have a chat client that needs to connect to a chat server in order
to function. This is for research use so I have access to an academic
server named Updraft. For this research, Updraft acts as a central
point where all data is accumulated. It would be real nice if I could
have all the chat client connect to the chat server that resides on
Updraft. I problem I see here is that Updraft uses SSH and the chat
clients use IO::Socket::INET. That means that first a user would have
to login to Updraft using SSH then the client program creates a socket
using IO::Socket::INET. That seems a bit strange. I'm looking for
ideas on how to resolve this issue. Is it even possible for this to
work?


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

Date: 06 Feb 2008 17:55:25 GMT
From: xhoster@gmail.com
Subject: Re: Connecting to a Server on a Server
Message-Id: <20080206125527.300$CH@newsreader.com>

deadpickle <deadpickle@gmail.com> wrote:
> I have a chat client that needs to connect to a chat server in order
> to function. This is for research use so I have access to an academic
> server named Updraft. For this research, Updraft acts as a central
> point where all data is accumulated. It would be real nice if I could
> have all the chat client connect to the chat server that resides on
> Updraft. I problem I see here is that Updraft uses SSH

Updraft probably uses hundreds of things, one of which is SSH.  Just
because the server has an sshd running, doesn't mean you have to use SSH
for your task.

> and the chat
> clients use IO::Socket::INET. That means that first a user would have
> to login to Updraft using SSH then the client program creates a socket
> using IO::Socket::INET.

Why can't they just use IO::Socket::INET to connect to Updraft from where
ever they happen to be logged in already?  That is what INET is for, so you
don't have to be logged into the same machine.  I do this all the time.
Many server-machines won't let me do a system-level login using anything
other than SSH, but they are happy to let me make ordinary (non-login)
connections with IO::Socket::INET.

> That seems a bit strange. I'm looking for
> ideas on how to resolve this issue. Is it even possible for this to
> work?

I'm not sure what the issue even is, or what the "this" is that may or may
not work.  If you want to use IO::Socket::INET, use it.  If once you try to
use it, it fails, then we would need to know why it fails--what kind of
errors you are getting.  When describing a problem, "Doesn't work" doesn't
work.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Wed, 6 Feb 2008 10:58:38 -0800 (PST)
From: deadpickle <deadpickle@gmail.com>
Subject: Re: Connecting to a Server on a Server
Message-Id: <aa856752-2641-471d-b080-d2d1633f1f30@j20g2000hsi.googlegroups.com>

I ran a simple test and it did seem to connect to the server since it
returned a value for the socket instead of an undefined value. I found
out what the public port is for the Updraft server and that let me
through (I think). But now I have ran into another issue with the chat
server that is ran from inside Updraft. When I change the port to 80,
the same public port, I get the error "Can't call method "accept" on
undefined variable" that comes from the created socket that is
listening to the public port. When I change the port value to another
port, say 12345, it works just fine. I'm not familiar with how servers
work, and was wondering if forwarding another port on Updraft,
specifically for the chat server, would resolve this and make it so
that only the chat server with listen on this specific port  for chat
clients?


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

Date: Wed, 6 Feb 2008 19:18:32 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Connecting to a Server on a Server
Message-Id: <8pdp75-0fe1.ln1@osiris.mauzo.dyndns.org>


Quoth deadpickle <deadpickle@gmail.com>:
> I have a chat client that needs to connect to a chat server in order
> to function. This is for research use so I have access to an academic
> server named Updraft. For this research, Updraft acts as a central
> point where all data is accumulated. It would be real nice if I could
> have all the chat client connect to the chat server that resides on
> Updraft. I problem I see here is that Updraft uses SSH and the chat
> clients use IO::Socket::INET. That means that first a user would have
> to login to Updraft using SSH then the client program creates a socket
> using IO::Socket::INET. That seems a bit strange. I'm looking for
> ideas on how to resolve this issue. Is it even possible for this to
> work?

If what you mean is that updraft is firewalled, and the only way in is
via a ssh tunnel, then you may be able to use Net::SSH2 to create a
tunneled connection. See the ->tcpip method of Net::SSH2. Note that this
requires that updraft supports ssh2, and also requires libssh2 installed
on the client.

Net::SSH2 has a lot of FAIL reports from CPAN testers, but most of these
seem to be because libssh2 isn't installed. They should really be NA
reports: unfortunately, getting a Makefile.PL to produce an NA report is
not terribly well documented, so lots of people seem to get it wrong.

Ben



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

Date: Wed, 6 Feb 2008 12:35:46 -0800 (PST)
From: deadpickle <deadpickle@gmail.com>
Subject: Re: Connecting to a Server on a Server
Message-Id: <a4318b9b-326f-4373-9256-7f35412cb4a0@m34g2000hsf.googlegroups.com>

On Feb 6, 1:18 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth deadpickle <deadpic...@gmail.com>:
>
> > I have a chat client that needs to connect to a chat server in order
> > to function. This is for research use so I have access to an academic
> > server named Updraft. For this research, Updraft acts as a central
> > point where all data is accumulated. It would be real nice if I could
> > have all the chat client connect to the chat server that resides on
> > Updraft. I problem I see here is that Updraft uses SSH and the chat
> > clients use IO::Socket::INET. That means that first a user would have
> > to login to Updraft using SSH then the client program creates a socket
> > using IO::Socket::INET. That seems a bit strange. I'm looking for
> > ideas on how to resolve this issue. Is it even possible for this to
> > work?
>
> If what you mean is that updraft is firewalled, and the only way in is
> via a ssh tunnel, then you may be able to use Net::SSH2 to create a
> tunneled connection. See the ->tcpip method of Net::SSH2. Note that this
> requires that updraft supports ssh2, and also requires libssh2 installed
> on the client.
>
> Net::SSH2 has a lot of FAIL reports from CPAN testers, but most of these
> seem to be because libssh2 isn't installed. They should really be NA
> reports: unfortunately, getting a Makefile.PL to produce an NA report is
> not terribly well documented, so lots of people seem to get it wrong.
>
> Ben

So then if this works do I still need to create a socket using
IO::Socket::INET on the client as well as the server or can I proceed
in the script without creating the IO::Socket:INET?


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

Date: Wed, 6 Feb 2008 21:04:36 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: CPerl mode problem: syntax highlighting stumbles over  my $old_z=3;  my $old_y=4;
Message-Id: <fod7d4$1o7l$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
shul 
<meshulum@gmail.com>], who wrote in article <45f2e581-b4e8-4d50-b9f1-0dd72d84088b@p69g2000hsa.googlegroups.com>:
> my $old_z=3;
> my $old_y =  4;
> 
> ...
> some more lines of code
> ...
> 
> the second line shows the 4 in a funny color

RMS Emacs comes with a modified version of CPerl which is, more or
less, unusable.

Hope this helps,
Ilya


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

Date: Wed, 6 Feb 2008 12:40:03 -0800 (PST)
From: alx__21@hotmail.com
Subject: eval EXPR with maximum execution time?
Message-Id: <42d2fa30-557b-4bfe-a3ce-0a27b501a236@q39g2000hsf.googlegroups.com>

Hi,

I'm looking for something that is like eval in that it can compile and
run code from strings, but will quit after a maximum given time.

The benchmark module tool "timethis" is very close, but it can only
ever specify a minimum time to iterate the given code.  What I want is
code that iterates ONCE, breaking at a maximum time that I can specify
(if it runs that long).

If anybody knows of a function to do this I would appreciate it.  I
would rather not have to start digging around in the source for
timethis to create my own.

Thanks.


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

Date: Wed, 06 Feb 2008 21:47:26 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <87bq6tke1t.fsf@zeekat.nl>

alx__21@hotmail.com writes:

> Hi,
>
> I'm looking for something that is like eval in that it can compile and
> run code from strings, but will quit after a maximum given time.
>
> The benchmark module tool "timethis" is very close, but it can only
> ever specify a minimum time to iterate the given code.  What I want is
> code that iterates ONCE, breaking at a maximum time that I can specify
> (if it runs that long).
>
> If anybody knows of a function to do this I would appreciate it.  I
> would rather not have to start digging around in the source for
> timethis to create my own.
>
> Thanks.

See perldoc -f alarm, but note that your code may still block on IO, as
far as I know, if your perl was build with "safe signals" - the default
for a few years now.

Joost.



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

Date: Wed, 06 Feb 2008 21:50:12 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <877ihhkdx7.fsf@zeekat.nl>

Joost Diepenmaat <joost@zeekat.nl> writes:
> See perldoc -f alarm, but note that your code may still block on IO, as
> far as I know, if your perl was build with "safe signals" - the default
> for a few years now.
>
> Joost.

For a possibly more robust (or at least, more certain way of stopping
processing) you could fork() the offending process and kill() it from
the parent if it doesn't stop after a sleep().

If you want to get any useful data back from the fork()ed child process,
you need some kind of IPC. See the perlopen and perlipc man pages.

Joost.


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

Date: Wed, 6 Feb 2008 15:06:57 +0530
From: "rajendra" <rajendra.prasad@in.bosch.com>
Subject: getting fieldname of excel sheet
Message-Id: <fobv3r$8md$1@news4.fe.internet.bosch.com>

Hello All,

I have a excel sheet. I want to access the content of a cell using its
fieldname. Is this possible through perl scripting....If yes, please let me
know how?...





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

Date: Wed, 06 Feb 2008 09:28:36 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: getting fieldname of excel sheet
Message-Id: <060220080928367404%jimsgibson@gmail.com>

In article <fobv3r$8md$1@news4.fe.internet.bosch.com>, rajendra
<rajendra.prasad@in.bosch.com> wrote:

> Hello All,
> 
> I have a excel sheet. I want to access the content of a cell using its
> fieldname. Is this possible through perl scripting....If yes, please let me
> know how?...

Yes. Fetch and install the Spreadsheet::ParseExcel module from CPAN:

<http://search.cpan.org/~szabgab/Spreadsheet-ParseExcel-0.32/lib/Spreads
heet/ParseExcel.pm>

Then read the documentation: perldoc Spreadsheet::ParseExcel.

If you have any problems, post a short program demonstrating the
problem here.

-- 
Jim Gibson

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: Wed, 06 Feb 2008 09:04:50 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Handling user input and program busy
Message-Id: <864pcmp1m5.fsf@lifelogs.com>

On 05 Feb 2008 23:57:11 GMT xhoster@gmail.com wrote: 

x> smallpond <smallpond@juno.com> wrote:
>> #!/usr/bin/perl
>> use warnings;
>> 
>> use threads;
>> use threads::shared;
>> my ($done, $thr);
>> share $done;
>> 
>> # Show dots at 1-second intervals while sub executes
>> sub pdots {
>> while (! $done) {
>> sleep 1;
>> print ".";
>> };
>> }

x> Ugh.  That just tells me that time has not ceased to exist as far as the
x> computer is concerned.  That is not a problem I've ever run into.  I
x> want a progress meter to tell me that progress is actually occurring on
x> the relevant task, not that the arrow of time is still in place and
x> functioning.

It is useful, however, to separate progress indications from the actual
worker thread.  Then the progress thread can show the worker thread is
blocked, for instance (and even do something about it).  I usually put
counters in shared memory; that way I can also access them for graphical
display in Cacti and I don't need threads.  The Tie::ShareLite CPAN
module makes it all trivial.

Ted


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

Date: Wed, 06 Feb 2008 11:51:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to move perl from one PC to another PC (windows XP)
Message-Id: <Xns9A3C45D31D177asu1cornelledu@127.0.0.1>

SC <Shiao.li.chang@gmail.com> wrote in news:421ca1f6-a5b6-4b8f-ac39-14a146b8dd3c@i29g2000prf.googlegroups.com:

> We have a PC/Windows XP running some Perl scripts for daily routine.
> I'd like to copy them to another PC/ windows xp, for running same perl
> scripts. What should I do to the new PC set a path or ??

Install PAR::Packer using ppm.

perldoc pp gives you the documentation for pp, the packager script. 
There is also gpp but I have not tried it: 

http://search.cpan.org/src/SMUELLER/PAR-Packer-0.977/contrib/gui_pp/gpp_readme.txt

This will allow you to pack the script along with all libraries and
other runtime files and create an .exe that can be run on another 
Windows computer without installing Perl or dependencies on that 
computer.

Sinan

PS: Apparently, both bribes and uwinnipeg ppm repositories have 
more recent versions of PAR than ActiveState.

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.rehabitation.com/clpmisc.shtml>



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

Date: Wed, 6 Feb 2008 15:49:10 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: How to move perl from one PC to another PC (windows XP)
Message-Id: <fochjg$2829$2@ns.felk.cvut.cz>

SC wrote:
> We have a PC/Windows XP running some Perl scripts for daily routine.
> I'd like to copy them to another PC/ windows xp, for running same perl
> scripts. What should I do to the new PC set a path or ??
If you can do it manually then check on 1st PC
1) where Perl is installed
2) find all ".pl" key in windows registry an export these to files (*.reg).

On 2nd PC copy whole Perl directory from 1st PC to the same directory on 2nd 
PC, add path to Perl into Path system variable and import all registry keys 
from files (*.reg). Restart PC and will be happy ;-)

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>



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

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 V11 Issue 1259
***************************************


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