[24563] in Perl-Users-Digest
Perl-Users Digest, Issue: 6741 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 28 18:05:56 2004
Date: Mon, 28 Jun 2004 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 28 Jun 2004 Volume: 10 Number: 6741
Today's topics:
Re: Does Perl combine multiple REs into a single automa (Anno Siegel)
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: get variables? <mritty@gmail.com>
Re: get variables? <jgibson@mail.arc.nasa.gov>
Re: get variables? (Stefano Russo)
Help with threading and returning results (Sean)
How to use 2 DIFFERENT VERSIONS of the SAME MODULE in t <yxp118@psu.edu>
Incorrect file download problem. (Sphinx)
Re: Killfile - what they had in mind (krakle)
Modules and different paths <Mark.Seger@hp.com>
Re: Modules and different paths <1usa@llenroc.ude>
Re: Modules and different paths <Mark.Seger@hp.com>
Re: Modules and different paths <1usa@llenroc.ude>
Re: monitoring changing web pages (krakle)
Re: monitoring changing web pages <spamtrap@dot-app.org>
Re: objects and code references <usenet@morrow.me.uk>
Re: objects and code references <tassilo.parseval@rwth-aachen.de>
Re: Problem with Gtk2 and POE <iron@ironiq.hu>
Re: Regexp for ls -l listing <david@tvis.co.uk>
Re: Why is $ENV{COLUMNS} undefined inside the Perl prog <usenet@morrow.me.uk>
Re: Why is $ENV{COLUMNS} undefined inside the Perl prog (Malcolm Dew-Jones)
Re: Why is $ENV{COLUMNS} undefined inside the Perl prog (Anno Siegel)
Re: Why is $ENV{COLUMNS} undefined inside the Perl prog <a24061@yahoo.munged>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Jun 2004 19:13:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Does Perl combine multiple REs into a single automaton?
Message-Id: <cbpqk5$i3p$1@mamenchi.zrz.TU-Berlin.DE>
Clint Olsen <clint@0lsen.net> wrote in comp.lang.perl.misc:
> Hi:
>
> I posted earlier about how to speed up writing lexical analyzers in Perl.
> With that effort in mind, I was curious to know if Perl combines multiple
> patterns like:
>
> if (/pat/) {
> } elsif (/pat1/) {
> ...
> } elsif (/pat2/) {
> ...
> ...
> ...
> } else {
> }
>
> so that pat[\d]+ are in a sense combined via alternation with each branch
> working like embedded action code?
That sounds extremely unlikely.
> The reason why I ask is that someone suggested I try to do this manually in
> order to help speed up the pattern matching process (presumably using the
> "(?{ code })" feature documented in perlre. Is it really faster to do it
> this way?
Only benchmarks can answer that. Out of interest, I made up an example
along the lines you sketched up there. The straight if/elsif/else came
out 50% faster than a regex with embedded code.
Anno
------------------------------
Date: 28 Jun 2004 18:44:12 GMT
From: <jari.aalto <AT> poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1088448081@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto A T poboxes com
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Unix Windows port (for Unix die-hards):
install http://www.cygwin.com/ which includes native Emacs 21.x.
and XEmacs port
o Pure Native Windows port
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/ => Emacs resource page
Emacs Perl Modules
Cperl -- Perl programming mode
http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
http://math.berkeley.edu/~ilya/software/emacs/
by Ilya Zakharevich
CPerl is major mode for editing perl files. Forget the default
`perl-mode' that comes with Emacs, this is much better. Comes
standard in newest Emacs.
TinyPerl -- Perl related utilities
http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Grep through all Perl manpages (.pod)
o Follow POD references e.g. [perlre] to next pod with RETURN
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o Update `$VERSION' variable with YYYY.MMDD on save.
o Load source code into Emacs, like Devel::DProf.pm
o Prepare script (version numbering) and Upload it to PAUSE
o Generate autoload STUBS (Devel::SelfStubber) for you
Perl Module (.pm)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in Tiny Tools Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up dattabases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to to do the search, You can adjust
recursive grep options, set search case sensitivity, add user grep
options etc.
You can find latest `igrep.el' module at
<http://groups.google.com/groups?group=gnu.emacs.sources> The
maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.
TinyCompile -- To Browse grep results in Emacs *compile* buffer
TinyCompile is a minor mode for *compile* buffer from where
you can collapse unwanted lines or shorten file URLs:
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: Mon, 28 Jun 2004 14:10:53 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: get variables?
Message-Id: <20040628140619.T2559@dishwasher.cs.rpi.edu>
On Mon, 28 Jun 2004, Ste (Stefano Russo) wrote:
> Hi, i would like to know if is possible to recall a variable passed via
> get trought a url.
>
> example:
>
> www.terra32.net/perl/ping.pl?url=www.google.it
>
> How can i recall the variable "url" in the script?
>
> Thanks a lot, excuseme for my bad english..
There are two main ways. One is to manually parse the Query String
environment variable. In your example above, your script would have a
variable
$ENV{'QUERY_STRING'} = 'url=www.google.it';
You could manually parse this variable and set the values you need. This
is generally considered a bad idea by most people. The preferred
alternative is to use the ever popular (and standard) CGI module:
use CGI qw/:standard/;
my $site = param('url');
That will automatically parse the query string and set the variable $site
to whatever value the 'url' GET parameter had.
For more information, read the documentation on CGI.pm:
perldoc CGI
Hope this helps,
Paul Lalli
------------------------------
Date: Mon, 28 Jun 2004 11:21:03 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: get variables?
Message-Id: <280620041121038696%jgibson@mail.arc.nasa.gov>
In article <EZYDc.390155$hc5.16842498@news3.tin.it>, Stefano Russo
<ste9986@tin.nospam.it> wrote:
> Hi, i would like to know if is possible to recall a variable passed via
> get trought a url.
>
> example:
>
> www.terra32.net/perl/ping.pl?url=www.google.it
>
> How can i recall the variable "url" in the script?
>
> Thanks a lot, excuseme for my bad english..
The server places everything after the first '?' in the URL in the
environment variable QUERY_STRING, from which you can retrieve it. This
is true regardless of the language.
There are Perl modules to help you parse your URL.
Checkout 'perldoc CGI'.
Also look at http://hoohoo.ncsa.uiuc.edu/cgi/primer.html
------------------------------
Date: Mon, 28 Jun 2004 21:06:16 GMT
From: "Ste (Stefano Russo)" <ste9986@tin.nospam.it>
Subject: Re: get variables?
Message-Id: <cL%Dc.391016$hc5.16881871@news3.tin.it>
Thanks a lot guys!!!
Excuseme if i don't quote, but ill'need to quote all the replies.. :-)
--
|||
(0.0)
|-------------o00----00o-----------------------------|
|Stefano Alberto Russo - Liceo Oberdan - Trieste |
|www.terra32.net - webmaster @ www.acquariofilia.biz |
|----------------------------------------------------|
------------------------------
Date: 28 Jun 2004 14:38:55 -0700
From: aether8203@yahoo.com (Sean)
Subject: Help with threading and returning results
Message-Id: <9f0ea455.0406281338.12c7f1f4@posting.google.com>
Here is the scenario:
Unix system, 100 machines in the "pool": one server, 99 clients. Main
program resides on the "server". On each of the 99 clients, there is
a daemon listening on a TCP port. In the main program (on the
server), it sends a signal out to the clients and waits for their
responses. The clients might take mili-seconds, MANY seconds, or
worst-case scenario lock up forever.
What is the best approach for the main program to wait a total of X
seconds for each of the clients responses (storing the string based
response in a hash array??) and then continuing on with the program so
as not to wait "forever" for the clients to respond?
If I "fork" them (or whatever it is I do), how do I make sure to get
their result?
Thanks for your help and any pointers,
Sean
------------------------------
Date: Mon, 28 Jun 2004 14:15:19 -0400
From: "Yves Petinot" <yxp118@psu.edu>
Subject: How to use 2 DIFFERENT VERSIONS of the SAME MODULE in the same perl program ?
Message-Id: <cbpn9p$loc$1@f04n12.cac.psu.edu>
Hi guys,
hopefully somebody will have a clue on how to solve this in a NICE
way.
Here goes :
I have 2 versions of the same perl module. Now what that module
exactly does is somewhat irrelevant to my question, but if u must know
this module is a DBM module. Ok so you got it: i basically have a
database in one format and i want to switch to the upgraded format.
Unfortunately the module which handles that new format is the next
version of the module that handles the old format ... talk of a
headache !
Now my problem is that - obviously ??? - i cannot get perl to load the
same module twice in a single interpreter. Renaming the old or new
module is NOT an option since i have a whole set of libraries which
depend on that one module. Of course i can use a third - intermediary
+ standard - database format to move from my old format to my new
format in a 2 steps (export then import) fashion.
But i wish i could find a way of dealing with 2 versions of the same
module in the same perl program :-P
Any help on this would be very much appreciated ...
------------------------------
Date: 28 Jun 2004 14:56:18 -0700
From: qakamran@yahoo.com (Sphinx)
Subject: Incorrect file download problem.
Message-Id: <b3647d8b.0406281356.4e40b634@posting.google.com>
Hi,
On my website, I am trying to use following perl script to download an
.exe file from server. This script downloads a smaller file then the
original one, (leaving nearly 100 bytes). I tried to compare the
contents (binary) of both files and they are same.
I am not sure why the size changed but there is no content change. The
exe file is a program installable and I am unable to install it after
download.
Even I tried to download a zip file with mime application/zip, that is
also invalid with 57 bytes missing and winzip doesn't read that. Text
file download works file.
I think I am using correct mime type; anyone has any idea, what could
be the problem?
Here is the script.
my $fileName="myfile.exe";
open(OUTFILE, $fileName) || die "Unable to open file..\n";
print "Content-type: application/octet-stream \n";
print "Content-disposition: filename=\"$fileName\"\n";
print "Content-Description: my exe file \n\n";
while(<OUTFILE>) {
print $_;
}
close(OUTFILE);
}
Thanks
-Kamran
------------------------------
Date: 28 Jun 2004 12:49:53 -0700
From: krakle@visto.com (krakle)
Subject: Re: Killfile - what they had in mind
Message-Id: <237aaff8.0406281149.37692b4b@posting.google.com>
norfernuman <norfernuman@yahoo.com> wrote in message news:<T3YCc.1171$7i1.503@newssvr27.news.prodigy.com>...
> Ahh... to open c.l.p.m with no Puke gurl stupidity showing up.
> A quick glance at the filter log shows it's time to scrub that bowl!
Cool. Now we get to read your offtopic posts about you not being able
to read her offtopic posts... This was such a good idea of yours to
clean clpm.
------------------------------
Date: Mon, 28 Jun 2004 16:14:33 -0400
From: Mark Seger <Mark.Seger@hp.com>
Subject: Modules and different paths
Message-Id: <40e07ed7@usenet01.boi.hp.com>
I'm trying to use Compress::Zlib in a script I'm trying to run on a
number of platforms. Depending on which version of Compress and perl
are being used, more often than not it seems Zlib gets installed in a
direction not in the current @INC - the most common being ending up in a
5.6 directory on a 5.8 system or visa-versa and it's driving me and the
users of the script crazy.
The thought I had was in the initialization section to look in specific
known locations to figure out where Zlib ended up and then add that
location to @INC. right? I thought I'd try to be clever and use the
lib module to set INC but to do that at run vs compile time I have to do
it in a require. No problem, or so I thought, but if I can't figure out
the syntax! My thought was since the syntax for 'use' is
use lib 'path';
I could say
require "lib 'path'";
but that doesn't seem to do it. So I guess my multipart question is:
- is this a reasonable way to deal with rpms that install into multiple
locations?
- is the correct way to set my path dynamically to 'require lib' and if
so what is the correct syntax?
- is there a way to get an rpm to install in a directory I want it to
rather than the ones it wants to?
-mark
------------------------------
Date: 28 Jun 2004 20:21:03 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Modules and different paths
Message-Id: <Xns9516A656450E6asu1cornelledu@132.236.56.8>
Mark Seger <Mark.Seger@hp.com> wrote in
news:40e07ed7@usenet01.boi.hp.com:
> I'm trying to use Compress::Zlib in a script I'm trying to run on a
> number of platforms. Depending on which version of Compress and perl
> are being used, more often than not it seems Zlib gets installed in a
> direction not in the current @INC - the most common being ending up in
> a 5.6 directory on a 5.8 system or visa-versa and it's driving me and
> the users of the script crazy.
>
> The thought I had was in the initialization section to look in
> specific known locations to figure out where Zlib ended up and then
> add that location to @INC. right? I thought I'd try to be clever and
> use the lib module to set INC but to do that at run vs compile time I
> have to do it in a require. No problem, or so I thought, but if I
> can't figure out the syntax! My thought was since the syntax for
> 'use' is
>
> use lib 'path';
>
> I could say
>
> require "lib 'path'";
Did you check:
perldoc -q lib
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Mon, 28 Jun 2004 16:58:03 -0400
From: Mark Seger <Mark.Seger@hp.com>
Subject: Re: Modules and different paths
Message-Id: <40e08909$1@usenet01.boi.hp.com>
A. Sinan Unur wrote:
> Mark Seger <Mark.Seger@hp.com> wrote in
> news:40e07ed7@usenet01.boi.hp.com:
>
>
>>I'm trying to use Compress::Zlib in a script I'm trying to run on a
>>number of platforms. Depending on which version of Compress and perl
>>are being used, more often than not it seems Zlib gets installed in a
>>direction not in the current @INC - the most common being ending up in
>>a 5.6 directory on a 5.8 system or visa-versa and it's driving me and
>>the users of the script crazy.
>>
>>The thought I had was in the initialization section to look in
>>specific known locations to figure out where Zlib ended up and then
>>add that location to @INC. right? I thought I'd try to be clever and
>>use the lib module to set INC but to do that at run vs compile time I
>>have to do it in a require. No problem, or so I thought, but if I
>>can't figure out the syntax! My thought was since the syntax for
>>'use' is
>>
>>use lib 'path';
>>
>>I could say
>>
>>require "lib 'path'";
>
>
> Did you check:
>
> perldoc -q lib
>
>
no I didn't 8-( and it is very informative, but only if you're
building from source. I probably should have been clearer that I'm
trying to have people simply install prebuilt rpms and it's those very
rpms that have specific places they stash their code in.
-mark
------------------------------
Date: 28 Jun 2004 22:01:38 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Modules and different paths
Message-Id: <Xns9516B7634D2BCasu1cornelledu@132.236.56.8>
Mark Seger <Mark.Seger@hp.com> wrote in news:40e08909$1
@usenet01.boi.hp.com:
> A. Sinan Unur wrote:
>> Mark Seger <Mark.Seger@hp.com> wrote in
>> news:40e07ed7@usenet01.boi.hp.com:
...
>>> I can't figure out the syntax! My thought was since the syntax
>>> for 'use' is
>>>
>>>use lib 'path';
>>>
>>>I could say
>>>
>>>require "lib 'path'";
>>
>>
>> Did you check:
>>
>> perldoc -q lib
>>
>>
>
> no I didn't 8-( and it is very informative, but only if you're
> building from source. I probably should have been clearer that I'm
> trying to have people simply install prebuilt rpms and it's those very
> rpms that have specific places they stash their code in.
I might be misunderstanding something here, but:
use strict;
use warnings;
use File::Spec::Functions qw(catfile);
BEGIN {
sub find_my_lib {
catfile($ENV{TEMP}, 'lib');
}
}
use lib find_my_lib();
use MyClass;
my $t = MyClass->new('Hello World!');
use Data::Dumper;
print Dumper $t;
__END__
C:\Home> t
$VAR1 = bless( do{\(my $o = 'Hello World!')}, 'MyClass' );
Does this help?
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: 28 Jun 2004 12:45:07 -0700
From: krakle@visto.com (krakle)
Subject: Re: monitoring changing web pages
Message-Id: <237aaff8.0406281145.4f631845@posting.google.com>
Sherm Pendley <spamtrap@dot-app.org> wrote in message news:<15qdnZJz8qpUmUPdRVn-uw@adelphia.com>...
> krakle wrote:
>
> > You don't need a module to do so..
>
> You don't precisely *need* a module, true, but there are certainly modules
> that will help make parts of it much easier.
True. But remember this is a pretty simple task...
>
> As you say, cron is the way to schedule a periodic job, assuming a *nix
> platform. Anacron might also be useful, if the machine running the script
> sleeps and/or powers down occasionally.
Bottom line, set the script on a scheduler.
>
> > Have the script check the file modification time/date on that specific
> > page once a day.
>
> LWP.
Why would you bother using LWP to fetch the modification date of a
LOCAL file? Just using "-M" would require less coding then LWP. Perl
is great because there are many ways to perform a task but I find it
pointless to use LWP in this case.
>
> > If it changes, have the script email the group of people.
>
> Quite a few modules to choose from here - search CPAN for "Mailer", "SMTP",
> and "MIME".
Well i'm not going to suggest SMTP since the poster never mentioned
anything about it. To email a group of people why not have perl open
the mail program... Again, another pointless reason to use a module.
------------------------------
Date: Mon, 28 Jun 2004 16:21:47 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: monitoring changing web pages
Message-Id: <ccSdnVwZTbpB4H3dRVn-uw@adelphia.com>
krakle wrote:
> Why would you bother using LWP to fetch the modification date of a
> LOCAL file?
Who said anything about local files? The OP said he wanted to monitor "a
specific page".
> Well i'm not going to suggest SMTP since the poster never mentioned
> anything about it. To email a group of people why not have perl open
> the mail program...
That might be easier in the short term, but it's harder to maintain over
time. If you start using a different mail program, or someone else wants to
use your script, you wind up having to rewrite it.
Also, a large majority of desktop machines (i.e. Windows) don't have a mail
program that Perl can call, but they often do have access to an SMTP
server.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Mon, 28 Jun 2004 19:01:49 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: objects and code references
Message-Id: <d136r1-hh5.ln1@mauzo.dyndns.org>
Quoth tassilo.parseval@post.rwth-aachen.de:
> Also sprach Jeff Thies:
>
> > I've created an object with a method like this:
> >
> > use File::Find;
> >
> > sub someSub{
> > my $self=shift;
> > find(\&wanted,'some_directory');
> > ...
> > }
> >
> > I need for the wanted sub to read some of the object properties. I'm unsure
> > how to do this.
> >
> > I can't do this:
> > find(\&$self->wanted,...)
> >
> > and I can't do this:
> > find(\&wanted($self->{some_property}),...
> >
> > So, what do I do?
>
> Create an additional sub-wrapper around File::Find's first argument:
>
> sub someSub {
> my $self = shift;
> find( sub { wanted($self) }, 'directory' );
find sub { $self->wanted }, 'directory';
so it's a proper method call and will do inheritance.
Ben
--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. ben@morrow.me.uk
------------------------------
Date: Mon, 28 Jun 2004 23:04:36 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: objects and code references
Message-Id: <2kbff6Fco4aU1@uni-berlin.de>
Also sprach Ben Morrow:
> Quoth tassilo.parseval@post.rwth-aachen.de:
>> Also sprach Jeff Thies:
>>
>> > I've created an object with a method like this:
>> >
>> > use File::Find;
>> >
>> > sub someSub{
>> > my $self=shift;
>> > find(\&wanted,'some_directory');
>> > ...
>> > }
>> >
>> > I need for the wanted sub to read some of the object properties. I'm unsure
>> > how to do this.
>> >
>> > I can't do this:
>> > find(\&$self->wanted,...)
>> >
>> > and I can't do this:
>> > find(\&wanted($self->{some_property}),...
>> >
>> > So, what do I do?
>>
>> Create an additional sub-wrapper around File::Find's first argument:
>>
>> sub someSub {
>> my $self = shift;
>> find( sub { wanted($self) }, 'directory' );
>
> find sub { $self->wanted }, 'directory';
>
> so it's a proper method call and will do inheritance.
Only if the object $self has a method 'wanted'. This isn't quite clear
from the original posting.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 28 Jun 2004 20:52:59 +0200
From: Krisztian VASAS <iron@ironiq.hu>
Subject: Re: Problem with Gtk2 and POE
Message-Id: <2kb7hnF8titU1@uni-berlin.de>
Rocco Caputo wrote this on 2004-06-28 19:48:
> Works here. The program I tested with is nearly the same as the one on
> POE's wiki. I just changed all the "Gtk"s to "Gtk2". Here's a copy:
Problem solved...
Wasn't installed the POE::Loop::Gtk2...
IroNiQ
--
Web: http://ironiq.hu
Email: iron@ironiq.hu
LinuxCounter: #331532
------------------------------
Date: Mon, 28 Jun 2004 20:57:17 +0100
From: zzapper <david@tvis.co.uk>
Subject: Re: Regexp for ls -l listing
Message-Id: <dvt0e0tjo9er2agk8odr8jjigc8iv0jvu9@4ax.com>
On Sat, 26 Jun 2004 17:15:58 -0500, wrote:
>zzapper <david@tvis.co.uk> wrote:
>
>> $ftp->dir("$file");
>
>
> perldoc -q vars
>
> What's wrong with always quoting "$vars"?
$you_are_correct=1; #just a bad habit
zzapper (vim, cygwin, wiki & zsh)
--
vim -c ":%s.^.CyrnfrTfcbafbeROenzSZbbyranne.|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
------------------------------
Date: Mon, 28 Jun 2004 19:08:00 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why is $ENV{COLUMNS} undefined inside the Perl program?
Message-Id: <0d36r1-hh5.ln1@mauzo.dyndns.org>
Quoth Adam <a24061@yahoo.munged>:
> On Monday 28 June 2004 12:49, Anno Siegel wrote:
>
> > No. $COLUMNS is a "normal" shell variable in bash, not an environment
> > variable.
>
> It shows up in `set` but not `env`. Oops!
>
> > You don't. Only environment variables are taken over by Perl.
> > Further, even if you managed to transfer the variable to Perl's
> > environment, it would lose the property of reflecting the current size
> > of the terminal.
> >
> > For alternatives, see perldoc -q screen.
>
> I think this will do what I need.
>
> use Term::ReadKey;
> ($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
See also $SIG{WINCH} (should that go in the faq answer?).
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *
------------------------------
Date: 28 Jun 2004 12:49:49 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Why is $ENV{COLUMNS} undefined inside the Perl program?
Message-Id: <40e0765d@news.victoria.tc.ca>
Adam (a24061@yahoo.munged) wrote:
: The environment variable $COLUMNS works as expected in bash
: /home/adam $ echo $COLUMNS
: 165
: [resizes xterm window]
: /home/adam $ echo $COLUMNS
: 132
: but $ENV{COLUMNS} is undefined inside a Perl program run from this
: shell. Why? And how do I get its value inside the program?
To make a bash variable visible you need to export it. What that does is
tell bash to put the variable into the environment.
$ export COLUMNS
------------------------------
Date: 28 Jun 2004 20:02:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Why is $ENV{COLUMNS} undefined inside the Perl program?
Message-Id: <cbptg1$jfd$1@mamenchi.zrz.TU-Berlin.DE>
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote in comp.lang.perl.misc:
> Adam (a24061@yahoo.munged) wrote:
> : The environment variable $COLUMNS works as expected in bash
>
> : /home/adam $ echo $COLUMNS
> : 165
> : [resizes xterm window]
> : /home/adam $ echo $COLUMNS
> : 132
>
> : but $ENV{COLUMNS} is undefined inside a Perl program run from this
> : shell. Why? And how do I get its value inside the program?
>
> To make a bash variable visible you need to export it. What that does is
> tell bash to put the variable into the environment.
>
> $ export COLUMNS
Yes, but Perl's $ENV{COLUMNS} would freeze the value on invocation. It
wouldn't follow re-sizings like the bash variable does in the OP's example.
Anno
------------------------------
Date: Mon, 28 Jun 2004 20:28:09 GMT
From: Adam <a24061@yahoo.munged>
Subject: Re: Why is $ENV{COLUMNS} undefined inside the Perl program?
Message-Id: <tb%Dc.5372$E03.56821997@news-text.cableinet.net>
On Monday 28 June 2004 21:02, Anno Siegel wrote:
> Yes, but Perl's $ENV{COLUMNS} would freeze the value on invocation.
> It wouldn't follow re-sizings like the bash variable does in the OP's
> example.
I didn't expect that to happen *inside* the running Perl program. I
(stupidly?) expected the program to inherit the value from the shell
that called it, but I had forgotten that environment variables are a
subset of shell variables.
The Perl program, which works now, uses GetTerminalSize() from
Term::ReadKey once at the beginning of the program to fix the width of
the output, so it's frozen anyway. The program just reads a log file
and prints sorted excerpts to the console.
--
Thanks,
Adam
------------------------------
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 6741
***************************************