[28594] in Perl-Users-Digest
Perl-Users Digest, Issue: 9958 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 12 18:06:09 2006
Date: Sun, 12 Nov 2006 15:05:06 -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 Sun, 12 Nov 2006 Volume: 10 Number: 9958
Today's topics:
[OT] Windows Shortcuts (was: Re: Creating Windows Short <rvtol+news@isolution.nl>
Re: Creating Windows Shortcuts Programmatically <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Creating Windows Shortcuts Programmatically <mark.clementsREMOVETHIS@wanadoo.fr>
Does-it exist any hosting directory which indicates Per <ynl@nsparks.net>
Re: Does-it exist any hosting directory which indicates usenet@DavidFilmer.com
Re: Does-it exist any hosting directory which indicates <ynl@nsparks.net>
Re: How to check ? <betterdie@gmail.com>
Re: How to check ? <wahab@chemie.uni-halle.de>
Re: How to check ? <jurgenex@hotmail.com>
Re: How to check ? <wahab@chemie.uni-halle.de>
Re: How to check ? <tadmc@augustmail.com>
open and STDERR <cdalten@gmail.com>
Re: open and STDERR anno4000@radom.zrz.tu-berlin.de
Re: perl threading; ->join; best method? <jdhedden@1979.usna.com>
Re: perl threading; ->join; best method? <nospam-abuse@ilyaz.org>
Returning values from a parsed file (design issue) <spam.meplease@ntlworld.com>
Re: Returning values from a parsed file (design issue) <bik.mido@tiscalinet.it>
rewrite a printed line shay.rozen@gmail.com
Re: rewrite a printed line <m@remove.this.part.rtij.nl>
Re: rewrite a printed line <nic@nowhere.com>
Re: rewrite a printed line <bik.mido@tiscalinet.it>
Threads and sockets <m@remove.this.part.rtij.nl>
Re: Win32::Internet fetch url question <hoffmanamps@citcom.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 12 Nov 2006 12:06:58 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: [OT] Windows Shortcuts (was: Re: Creating Windows Shortcuts Programmatically)
Message-Id: <ej72r1.jg.1@news.isolution.nl>
Joe Smith schreef:
> Mark Clements:
>> Try Win32::Shortcut
>> search.cpan.org is your friend.
>
> Interesting. That module was not found when I tried
> http://search.cpan.org/search?query=Win32::Shortcut
> http://search.cpan.org/search?query=Win32%3A%3AShortcut
>
> Google found a module from 1997 that creates executable shortcuts
> (ones that run a particular program in a specified directory with
> given arguments). Not what I expected for a file shortcut.
> http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/docs/index.html
A Windows Shortcut *is* an executable, but a Shortcut can be to a
program, as well as to a data file.
For example, when you start a Shortcut to an rtf file, the Agent for the
Class of the rtf file is started, and that Agent then opens the rtf
file. That would also work if you would start the data file directly,
but the Shortcut provides several extras, such as changing the working
directory, and having the Shortcuts in one place (like on the Desktop)
and the data files in several places.
See also "Start / Documents", where Shortcuts to recently touched
documents are managed.
See also:
ftype | find /i "rtf"
assoc .rtf
assoc | find /i "rtf"
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sun, 12 Nov 2006 12:29:17 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Creating Windows Shortcuts Programmatically
Message-Id: <45570582$0$27386$ba4acef3@news.orange.fr>
Joe Smith wrote:
> Mark Clements wrote:
>> Don wrote:
>>>
>>> can anyone point me to some documentation that indicates how I can
>>> create a file shortcut please. I need to be able to programmatically
>>> create shortcuts under windows xp. I have the original file name,
>>> directory name that the shortcut is to reside in, and the shortcut
>>> name, but I haven't been able to determine how to actually create the
>>> shortcut in Perl.
>>>
>>
>> Try Win32::Shortcut
>>
>> search.cpan.org is your friend.
>
> Interesting. That module was not found when I tried
> http://search.cpan.org/search?query=Win32::Shortcut
> http://search.cpan.org/search?query=Win32%3A%3AShortcut
That is odd: the cpan shell finds it easily enough.
cpan[1]> m /Win32::Shortcut/
CPAN: Storable loaded ok
Going to read /home/mark/.cpan/Metadata
Database was generated on Sun, 12 Nov 2006 08:24:13 GMT
Module id = Win32::Shortcut
DESCRIPTION Manipulate Windows Shortcut files
CPAN_USERID ACALPINI (Aldo Calpini <dada@perl.it>)
CPAN_VERSION 0.04
CPAN_FILE J/JD/JDB/libwin32-0.26.tar.gz
UPLOAD_DATE 2005-09-17
DSLIP_STATUS Rd+Op
(released,developer,C++,object-oriented,Standard-Perl)
INST_FILE (not installed)
> Google found a module from 1997 that creates executable shortcuts
> (ones that run a particular program in a specified directory with
> given arguments). Not what I expected for a file shortcut.
> http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/docs/index.html
It looks like the html documentation in libwin32 hasn't been kept up to
date with the code.
http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/Changes
shows a last modification date of September 2005, version 0.04,
whereas
http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/docs/index.html
has a last modification date of April 1997, version 0.03.
I'll file a bug (if one doesn't exist already).
Mark
------------------------------
Date: Sun, 12 Nov 2006 14:01:25 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Creating Windows Shortcuts Programmatically
Message-Id: <45571b1a$0$27407$ba4acef3@news.orange.fr>
Joe Smith wrote:
> Mark Clements wrote:
>> Don wrote:
>>>
>>> can anyone point me to some documentation that indicates how I can
>>> create a file shortcut please. I need to be able to programmatically
>>> create shortcuts under windows xp. I have the original file name,
>>> directory name that the shortcut is to reside in, and the shortcut
>>> name, but I haven't been able to determine how to actually create the
>>> shortcut in Perl.
>>>
>>
>> Try Win32::Shortcut
>>
>> search.cpan.org is your friend.
>
> Interesting. That module was not found when I tried
> http://search.cpan.org/search?query=Win32::Shortcut
> http://search.cpan.org/search?query=Win32%3A%3AShortcut
>
> Google found a module from 1997 that creates executable shortcuts
> (ones that run a particular program in a specified directory with
> given arguments). Not what I expected for a file shortcut.
> http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/docs/index.html
>
Maybe you *are* looking for symlinks (which only work with NTFS).
http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
In which case Win32::Symlink (and possibly Win32::Hardlink) are worth a
look.
Incidentally, it's trivial to write something that uses Win32::OLE to
create a WScript.Shell object that creates Windows shortcuts (I've just
done it as an exercise), although am not sure if this gains anything
over the libwin32 approach.
Mark
------------------------------
Date: Sun, 12 Nov 2006 12:10:35 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Does-it exist any hosting directory which indicates Perl version ?
Message-Id: <MPG.1fc11f9b645b26fc989907@news.tiscali.fr>
Do you know a site which indicate the Perl version of the hosters ?
Of course, knowing that not any list can list *all* hosters... But the
fact is that all the lists I've seen until now, just say "cgi" as if it
automatically implies the presence of a Perl interpreter ; and always
without any indication about version, knowing there still some with
quite old interpreter (like <5.6) on which a lot of Perl CGI scripts
don't work.
Even if there's not any Perl code question here, it's a real Perl
question, just because it sounds like nobody seems to be concerned by
Perl unless the developers who use Perl themselves ; I've already tried
to ask this kind of question in some hosting-oriented forum and it
doesn't interest anybody (every one is just crazy with PHP, nothing
more)... So, maybe here I'll get real info, real opinion and maybe some
URL about some hosting diretories which take care of Perl info.
------------------------------
Date: 12 Nov 2006 04:26:27 -0800
From: usenet@DavidFilmer.com
Subject: Re: Does-it exist any hosting directory which indicates Perl version ?
Message-Id: <1163334387.223118.316930@f16g2000cwb.googlegroups.com>
Yohan N Leder wrote:
> Do you know a site which indicate the Perl version of the hosters ?
There is no database or website with that information, if that's what
you're asking. Most hosting providers provide the Perl version that
shipped with the particular version of the operating system that is
installed on the server. It is possible that a host provider may have
different user accounts on different servers with different versions of
Perl. Providers may upgrade or reconfigure their servers at any time.
If you are interested in a particular provider, ask them what version
of Perl they offer.
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Sun, 12 Nov 2006 20:47:04 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: Does-it exist any hosting directory which indicates Perl version ?
Message-Id: <MPG.1fc198a4bdac812989908@news.tiscali.fr>
In article <1163334387.223118.316930@f16g2000cwb.googlegroups.com>,
usenet@DavidFilmer.com says...
> If you are interested in a particular provider, ask them what version
> of Perl they offer.
>
We agree, the fact is that we have to ask, rather than just read on a
displayed description. Also, a lot don't upgrade (and don't want to)
from time to time (we use ten hosting company for different things at
this time and one use Perl 5.5, five 5.6 and just the rest 5.8).
However it exists a lot of directories and comparaison pages about
hosting companies, but not any with Perl version information.
------------------------------
Date: 12 Nov 2006 05:15:21 -0800
From: "paul" <betterdie@gmail.com>
Subject: Re: How to check ?
Message-Id: <1163337321.151624.249330@i42g2000cwa.googlegroups.com>
Register check may help, you need to write Perl code to check register
in windows...It will tell you whether IIS is install or not...
John W. Krahn wrote:
> Rakesh wrote:
> > Any body know perl program for Check wether IIS is installed or not ?
>
> perl -e"print q[Is IIS installed? ]; <STDIN>"
>
>
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you can special-order
> certain sorts of tools at low cost and in short order. -- Larry Wall
------------------------------
Date: Sun, 12 Nov 2006 17:15:08 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: How to check ?
Message-Id: <ej7hke$rdg$1@mlucom4.urz.uni-halle.de>
Thus spoke Rakesh (on 2006-11-12 09:46):
> Any body know perl program for Check wether IIS is installed or not ?
You could simply ask a HEAD-request to a server
installed on the local ip and read the response,
like:
use LWP::Simple;
my $ip = '192.168.0.1'; # <== insert your ip of interest here
print head('http://'.$ip)->headers->{server}; # prints Apache or IIS or whatever
Regards
M.
------------------------------
Date: Sun, 12 Nov 2006 16:50:25 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to check ?
Message-Id: <lhI5h.800$xD.607@trndny08>
Mirco Wahab wrote:
> Thus spoke Rakesh (on 2006-11-12 09:46):
>
>> Any body know perl program for Check wether IIS is installed or not ?
>
> You could simply ask a HEAD-request to a server
> installed on the local ip and read the response,
Nice idea, but still leaves two problems:
- If you don't get a response you still don't know if IIS isn't installed or
just not running
- If you get a response from a server other than IIS then you still don't
know if IIS is installed, too
jue
------------------------------
Date: Sun, 12 Nov 2006 20:57:47 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: How to check ?
Message-Id: <ej7ulu$1r4$1@mlucom4.urz.uni-halle.de>
Thus spoke Jürgen Exner (on 2006-11-12 17:50):
> Mirco Wahab wrote:
>> Thus spoke Rakesh (on 2006-11-12 09:46):
>>> Any body know perl program for Check wether IIS is installed or not ?
>>
>> You could simply ask a HEAD-request to a server
>> installed on the local ip and read the response,
>
> Nice idea, but still leaves two problems:
OK,
> - If you don't get a response you still don't know if
> IIS isn't installed or just not running
Before I answered, I *interpreted* the OP's question
as beeing something like:
"how do you check if IIS is *available* somehow locally"
If it's not installed or not running --> it isn't available.
> - If you get a response from a server other than
> IIS then you still don't know if IIS is installed, too
Yes, but its surely not available on the port one asked for ...
BTW, one could start a daemon perl script on port 80 which
sends HTTP headers out with "Microsoft IIS" in it, but from
the above interpretation I guessed that there wouldn't be
such a problem here ;-)
Regards
Mirco
------------------------------
Date: Sun, 12 Nov 2006 15:22:52 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to check ?
Message-Id: <slrnelf45c.607.tadmc@tadmc30.august.net>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> Mirco Wahab wrote:
>> Thus spoke Rakesh (on 2006-11-12 09:46):
>>
>>> Any body know perl program for Check wether IIS is installed or not ?
>>
>> You could simply ask a HEAD-request to a server
>> installed on the local ip and read the response,
>
> Nice idea, but still leaves two problems:
> - If you don't get a response you still don't know if IIS isn't installed or
> just not running
or if IIS _is_ installed and is running, but is configured to not
respond to HEAD requests.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 12 Nov 2006 14:24:48 -0800
From: "grocery_stocker" <cdalten@gmail.com>
Subject: open and STDERR
Message-Id: <1163370288.443528.3220@f16g2000cwb.googlegroups.com>
"Found in /usr/lib/perl5/5.8.3/pod/perlfaq8.pod
How can I capture STDERR from an external command?
There are three basic ways of running external commands:
system $cmd; # using system()
$output =3D =E2=80=98$cmd=E2=80=98; # using backticks =
(=E2=80=98=E2=80=98)
open (PIPE, "cmd =E2=94=82"); # using open()
With system(), both STDOUT and STDERR will go the same
place as the script=E2=80=99s STDOUT and STDERR, unless the sys=C2=
=AD
tem() command redirects them. Backticks and open() read
only the STDOUT of your command."
If open() reads only to STDOUT, Then how when I do something like the
following:
#!/usr/bin/perl -w
open(STDERR, "whore.txt") or die "Cant: $! \n";
I get:
miss_xtc@linux:~/perl> ./op.pl
Cant: No such file or directory
Wouldn't this be writing to STDERR in this case?
------------------------------
Date: 12 Nov 2006 22:42:07 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: open and STDERR
Message-Id: <4rpm9vFsgqlsU1@mid.dfncis.de>
grocery_stocker <cdalten@gmail.com> wrote in comp.lang.perl.misc:
> "Found in /usr/lib/perl5/5.8.3/pod/perlfaq8.pod
> How can I capture STDERR from an external command?
>
> There are three basic ways of running external commands:
>
> system $cmd; # using system()
> $output = ‘$cmd‘; # using backticks (‘‘)
> open (PIPE, "cmd │"); # using open()
>
> With system(), both STDOUT and STDERR will go the same
> place as the script’s STDOUT and STDERR, unless the sysÂ
> tem() command redirects them. Backticks and open() read
> only the STDOUT of your command."
>
> If open() reads only to STDOUT, Then how when I do something like the
> following:
>
> #!/usr/bin/perl -w
>
> open(STDERR, "whore.txt") or die "Cant: $! \n";
That tries to open "whore.txt" for reading, which fails unless the
file already exists.
> I get:
> miss_xtc@linux:~/perl> ./op.pl
> Cant: No such file or directory
>
> Wouldn't this be writing to STDERR in this case?
Why should it? You have to open the file for writing:
open STDERR, '>', 'whore.txt' or die "Can't create 'whore.txt': $!";
Anno
------------------------------
Date: 12 Nov 2006 05:56:33 -0800
From: "jdhedden" <jdhedden@1979.usna.com>
Subject: Re: perl threading; ->join; best method?
Message-Id: <1163339793.798856.264430@b28g2000cwb.googlegroups.com>
Ilya Zakharevich wrote:
> Badly designed API; with a better API it should have been
> something like
> 1 while threads->join_a_thread();
Jerry D. Hedden remarked:
> The problem I see with this is that it provides no
> mechanism for identifying which thread was joined.
Ilya Zakharevich replied:
> Same as for the initial code. If you need this info, just
> inspect the return value of join_a_thread(). I would
> think that something as
>
> if (my ($thread_id_was, @retVal) = threads->join_a_thread()) {
> } else { # Nothing joinable
> }
>
> would be sufficient...
This is not consistent with your original idea in the
'while' loop. You need to block until at least one thread
is joined. Otherwise, you end up in a fast loop. However,
your if-else statement above returns if no thread is
joinable.
> P.S. IMO, Any API that encourages using sleep(1) should
> go back to the design board...
I don't disagree that using a sleep call is inefficient, and
if you read my original post you'll see that I stated that:
$_->join() foreach threads->list();
was just fine for the poster's purposes. My example of:
while (threads->list()) {
$_->join() foreach threads->list(threads::joinable);
sleep(1);
}
was not meant to be some sort of improvement. It's not. I
presented it just to illustrate some of the newer 'threads'
module capabilities. The presenter asked about asynchronous
joins. My example does that, but it is not optimal for the
original problem. (Again, it was notional, not definitive.)
I know that the blocking/non-blocking issue for
'join_a_thread' could be worked out using a flag argument,
and I know that using a 'sleep' to prevent a fast loop for
non-blocking calls is inefficient. My point is that your
ideas are only half-baked.
If you really think you can come up with a better API, then
instead of just complaining, you ought to do the work of
writing up the code, the docs and the test cases, and then
either submit the result as a patch to
perl5-porters@perl.org, or if it is incompatible with the
existing API, generate a new module and post it to CPAN.
------------------------------
Date: Sun, 12 Nov 2006 20:16:08 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: perl threading; ->join; best method?
Message-Id: <ej7ve8$2b90$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
jdhedden
<jdhedden@1979.usna.com>], who wrote in article <1163339793.798856.264430@b28g2000cwb.googlegroups.com>:
> > something like
> > 1 while threads->join_a_thread();
> > Same as for the initial code. If you need this info, just
> > inspect the return value of join_a_thread(). I would
> > think that something as
> >
> > if (my ($thread_id_was, @retVal) = threads->join_a_thread()) {
> > } else { # Nothing joinable
> > }
> >
> > would be sufficient...
> This is not consistent with your original idea in the
> 'while' loop.
Why do you think so?
> You need to block until at least one thread
> is joined. Otherwise, you end up in a fast loop. However,
> your if-else statement above returns if no thread is
> joinable.
I think you do not understand what I meant by "joinable". It is not
what is finished; it is what is not "fire-and-forget".
> if you read my original post you'll see that I stated that:
>
> $_->join() foreach threads->list();
This assumes that threads->list() returns only joinable threads, and
that they all return in a suitable order.
> My point is that your ideas are only half-baked.
Thanks. But your ideas about what my ideas are are wrong.
> If you really think you can come up with a better API, then
> instead of just complaining, you ought to do the work of
> writing up the code, the docs and the test cases, and then
Thanks for teaching me what I ought to do. This is really appreciated.
Yours,
Ilya
------------------------------
Date: 12 Nov 2006 05:20:25 -0800
From: "doolittle" <spam.meplease@ntlworld.com>
Subject: Returning values from a parsed file (design issue)
Message-Id: <1163337625.907207.81250@m73g2000cwd.googlegroups.com>
Hi,
I am working on a file parser, and a program that deals with the
ouptput of the parser (i'll call that the user).
I am using Perl, although I think the issues are general.
Now the user wants to get the value of a particular thing in the file.
Currently, this value could be scalar (a string), an array, or
undefined (if the thing was not in the file). Call them type3.
Some things have to be a scalar value, or undefined (or else the parser
reports the file is incorrect). Call them type2.
(other things have to be a scalar value, although i only just realised
that, call them type1. They can be caught by the parser if undef)
(Which type a thing must be is known before the file is parsed.)
I am thinking, why not (in the parser), put everything (not type1 -
well maybe) into an array, so the user just has to deal with two
possibilities (array or undefined). ie force everything of type2 or
type3 into a new type - type2A, which is either an array or undefined.
Is this a good idea?
The other possibility is just force everything of type3 into a new
type, type3A, which is which is either an array or undefined.
Should i try to make things easier for the user, or is it up to them to
deal with the basic types correctly?
dan
------------------------------
Date: Sun, 12 Nov 2006 15:25:13 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Returning values from a parsed file (design issue)
Message-Id: <mhbel2hgh20t5ld7g7negmt40tt2ivo5sh@4ax.com>
On 12 Nov 2006 05:20:25 -0800, "doolittle"
<spam.meplease@ntlworld.com> wrote:
>Now the user wants to get the value of a particular thing in the file.
>
>Currently, this value could be scalar (a string), an array, or
>undefined (if the thing was not in the file). Call them type3.
Despite your being verbose enough I'm not really sure IIUC. IIUC...
don't reivent the wheel, just use some data serialization format for
the output, say xml or yaml, suitable for your situation. Or else... I
don't have the slightest idea.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 12 Nov 2006 07:44:41 -0800
From: shay.rozen@gmail.com
Subject: rewrite a printed line
Message-Id: <1163346281.111326.127270@e3g2000cwe.googlegroups.com>
I have a script which output some icmp results. I print the results
line by line till the list of hosts reaches the end, and then its
repeats from the start by deleting the output screen (I use windows
"cls").
My question is can i go up my output on the screen, like print a line,
and then go with the "curser" back to this line and rewrite it by
another print. Something like "old line" instead of "new line".
------------------------------
Date: Sun, 12 Nov 2006 16:52:16 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: rewrite a printed line
Message-Id: <pan.2006.11.12.15.52.16.711337@remove.this.part.rtij.nl>
On Sun, 12 Nov 2006 07:44:41 -0800, shay.rozen wrote:
> I have a script which output some icmp results. I print the results
> line by line till the list of hosts reaches the end, and then its
> repeats from the start by deleting the output screen (I use windows
> "cls").
> My question is can i go up my output on the screen, like print a line,
> and then go with the "curser" back to this line and rewrite it by
> another print. Something like "old line" instead of "new line".
Try printing a '\r' instead of a '\n'. Works on most OSses/terminals. (As
long as you don't print more than one screen line per line). Remember to
print extra spaces to completely erase the previous line.
M4
--
Redundancy is a great way to introduce more single points of failure.
------------------------------
Date: Sun, 12 Nov 2006 17:53:47 +0200
From: nic <nic@nowhere.com>
Subject: Re: rewrite a printed line
Message-Id: <pan.2006.11.12.15.53.46.263094@nowhere.com>
On Sun, 12 Nov 2006 07:44:41 -0800, shay.rozen wrote:
> I have a script which output some icmp results. I print the results
> line by line till the list of hosts reaches the end, and then its
> repeats from the start by deleting the output screen (I use windows
> "cls").
> My question is can i go up my output on the screen, like print a line,
> and then go with the "curser" back to this line and rewrite it by
> another print. Something like "old line" instead of "new line".
Look at something like Term::Screen
(http://search.cpan.org/~jstowe/Term-Screen-1.03/Screen.pm)
The "at" method give you control (based on row and column) as to where on
the screen you want to print.
Just remember to delete the existing line first ("clreol" method).
I just don't know how well it works in a Windows command box :(
Cheers
------------------------------
Date: Sun, 12 Nov 2006 17:52:38 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: rewrite a printed line
Message-Id: <9akel2ls5ne60s2tjpoure0la2n7kepnjk@4ax.com>
On 12 Nov 2006 07:44:41 -0800, shay.rozen@gmail.com wrote:
>My question is can i go up my output on the screen, like print a line,
>and then go with the "curser" back to this line and rewrite it by
>another print. Something like "old line" instead of "new line".
\r
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 12 Nov 2006 15:48:07 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Threads and sockets
Message-Id: <pan.2006.11.12.14.48.07.554367@remove.this.part.rtij.nl>
Hi,
Sorry, no code. Normally I just code something up and work it out from
there. I want to get a grasp on the basic concepts before starting to code
for this one.
I've written a small server that listens for UDP packets or TCP
connections, computes an answer and returns the result. The trouble is
that computing the answer may be almost instantanious, or may take several
seconds. I want to make the server concurrent by using ithreads, creating
n threads and distributing the requests over the threads using
Threads::Queue. The thread itself should send back the result to the
client.
Now I understand the basics of :shared. I just cannot wrap this around to
sockets.
For TCP: Can I just enqueue a socket and use it in the thread that
dequeues it? Or should the socket be marked shared? Or will this not work
at all? Or depending on the OS (I'm using Linux).
What would be an appropriate model for UDP? I probably can just create a
UDP socket per thread and use that to send the answer, am I on the right
track?
Thanks in advance for any insight anyone can give on this.
M4
--
Redundancy is a great way to introduce more single points of failure.
------------------------------
Date: 12 Nov 2006 09:31:40 -0800
From: "EL34" <hoffmanamps@citcom.net>
Subject: Re: Win32::Internet fetch url question
Message-Id: <1163352700.016171.284760@m73g2000cwd.googlegroups.com>
Just relax and forget about it, I found a lovely forum where people
actually are willing to help a beginner instead of just spewing out,
RTFM.
You can go back to your throne now and rejoice in how wonderful your
are that you understand Perl better than me.
For future refernce, some people learn better by seeing a working
example. Me for one.
Text book formulas without an examples are way more difficult and
impossible in some cases.
All I was asking for was a working example, nothing more.
see ya
Tad McClellan wrote:
> EL34 <hoffmanamps@citcom.net> wrote:
>
> > You are a little too anal.
>
>
> And you are a little too dense.
>
>
> > Please do not reply to messages
>
>
> I think you can probably count on plenty of people not replying
> to your future messages, probably because they will not see them
> in the first place...
>
>
> > if you are not familiar with the module
> > or have no intent on supplying the requested info.
>
>
> There is no obligation for followups to fulfill any request.
>
> We discuss Perl here, whether it provides what you want or
> not is immaterial.
>
>
> > I am an expert on several other
> > fieldss other than Perl
>
>
> I am impressed.
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
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 9958
***************************************