[27921] in Perl-Users-Digest
Perl-Users Digest, Issue: 9285 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 12 09:05:56 2006
Date: Mon, 12 Jun 2006 06:05:04 -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, 12 Jun 2006 Volume: 10 Number: 9285
Today's topics:
Re: [Fwd: Gtk and Glib::Timeout] <yg_blah_@this_domain.bla>
Re: best method to perform operations on word lists <bart@nijlen.com>
Re: Determining lvalue context <bol@adv.magwien.gv.at>
Re: Determining lvalue context <bol@adv.magwien.gv.at>
Re: how to spider part of the content of a webpage ? <bart@nijlen.com>
Re: I received eBay Star Developer Award <puonegf+hfrarg@tznvy.pbz>
Re: Merging potentially undefined hashes <leegee@gmail.com>
Non-blocking Sockets with PerlScript on Win XP <Tresh909@gmail.com>
Re: Non-blocking Sockets with PerlScript on Win XP <mol10metal@hotmail.com>
Re: Non-blocking Sockets with PerlScript on Win XP <Tresh909@gmail.com>
Question: Inline::C module packaging? <leegee@gmail.com>
Re: Question: Inline::C module packaging? <benmorrow@tiscali.co.uk>
Re: Question: Inline::C module packaging? <leegee@gmail.com>
Re: Question: Inline::C module packaging? <benmorrow@tiscali.co.uk>
Re: Question: Inline::C module packaging? <siegel@zrz.tu-berlin.de>
script to find the files with very long names (pui ming Wong)
Re: script to find the files with very long names <peace.is.our.profession@gmx.de>
Re: script to find the files with very long names <peace.is.our.profession@gmx.de>
Re: script to find the files with very long names <mol10metal@hotmail.com>
Re: script to find the files with very long names <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 12 Jun 2006 13:38:06 +0200
From: "Y.G." <yg_blah_@this_domain.bla>
Subject: Re: [Fwd: Gtk and Glib::Timeout]
Message-Id: <e6jjmu$hke$1@info.science.uva.nl>
zentara wrote:
> On Thu, 08 Jun 2006 18:47:17 +0200, "Y.G." <yg_blah_@this_domain.bla>
> wrote:
>
>> I am writing a program in perl which invokes a small window. This window
>> should time out after some time. For the window I use Gtk2. For the
>> timeout I use Glib::Timeout
>>
>> The code looks something like this:
>>
>> my $dialog = new Gtk2::Dialog( );
>>
>> (creating some buttons and all)
>>
>> my $timer = Glib::Timeout->add( $interval, \&some_func));
>>
>> Gtk2->main;
>>
>>
>> This returns Not a CODE reference at /program_path line line_number
>
> That seems to say that the sub some_func isn't declared yet.
>
>> Should I use Glib (and how?) or is there any other function I should use.
>
> All you need to do is return FALSE from the sub after the timeout
> period. Timers keep running as long as they return TRUE from the
> code reference.
>
> $id = Glib::Timeout->add ($milliseconds, \&timeout_handler);
>
> sub timeout_handler {
> do_cool_stuff ();
> return $keep_running_or_not;
> }
>
>
> but since it's a 1 shot timer, it can all be in one line,
> for a 10 second timeout
>
> my $id = Glib::Timeout->add (10000, sub{ return 0 } );
>
>
> are you trying to make the dialog only stay up 10 seconds?
> Only moderately tested code follows....................
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> use Glib qw(TRUE FALSE);
> use Gtk2 '-init';
>
> my $dialog = Gtk2::Dialog->new ('Confirmation Dialog', undef, 'modal',
> 'gtk-ok' => 'ok', # response ids may be one of the built-in enums...
> '_Cancel' => 2, # or any positive integer.
> );
>
> # put an hbox with a label and entry into the dialog's vbox area.
> my $hbox = Gtk2::HBox->new (FALSE, 6);
> $hbox->pack_start (Gtk2::Label->new ('Continue Real Transfer? '), TRUE,
> TRUE, 0);
> $hbox->show_all;
>
> $dialog->vbox->pack_start ($hbox, TRUE, TRUE, 0);
>
> # Set which response is the default:
> $dialog->set_default_response ('ok');
>
> # connect a signal to the dialog's response signal.
> $dialog->signal_connect (response => sub {
> # get our params
> shift; # we don't need the dialog
> my $response = shift; # the clicked button
>
> print "The user clicked: $response\n";
>
> if ($response eq 'ok')
> {
> Gtk2->main_quit;
> }
> elsif ($response eq 'delete-event')
> {
> $response = 2;
> }
> elsif ($response == 2)
> {
>
> }
> });
>
> # show the dialog
> $dialog->show;
>
> my $id = Glib::Timeout->add (5000, sub{
> print "timeded out\n";
> $dialog->destroy;
> return FALSE;
> });
>
> Gtk2->main;
> __END__
>
>
Seems to work. Thanks
------------------------------
Date: 12 Jun 2006 01:27:14 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: best method to perform operations on word lists
Message-Id: <1150100834.278620.274990@c74g2000cwc.googlegroups.com>
Francois Massion wrote:
> [...]
> > #!perl
> > use strict; use warnings;
> > my $list =3D
> > "=FCberzeugt
> > =FCberzeugt,
> > =FCberzogen
> > =FCberzogen,
> > =FCberzogen.
> > =FCblich
> > =FCbliche
> > =FCblichen
> > =FCblicherweise";
> > my @terms =3D split /\n/, $list;
> > my $prev =3D 'nonesuch584685542256RANOM58544';
>
> This didn't modify the list.
I didn't mean to modify $list; the new content is in @terms. If you
want $list to contain the new words, you can use something like this at
the end of the program.
$list =3D join "\n", @terms;
> Maybe the reason is the $prev definition.
$prev has no direct importance here, it's only required that it should
not be present in @terms, because it is used to delete double entries
from @terms.
> > s/(\.|,|e|en|e,|en,|e\.|en\.)$// for @terms;
> I also tried Dr. Ruud's regex but it would have to be rewritten for
> each language.
That is correct, hence my thoughts about language files. My code is a
very brute algorithm - it only strips out the following from the end of
each line:
. , e en e en, e. en.
If you are planning to use this for different languages, you would
obviously need to modify those patterns each time.
--=20
Bart
------------------------------
Date: Mon, 12 Jun 2006 10:10:16 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Determining lvalue context
Message-Id: <1150099817.333812@proxy.dienste.wien.at>
Xho:
> Why not $docid->next_vtx_page()?
Because the object $docid does not provide methods. When a said
"object", I meant just a hash reference with some internal values used
by the VTX system. next_vtx_page() isn't a method, it's just a normal
function.
> You have to return something magical. If the magical thing you return
gets
> assigned to, you were called in a lvalue context. Otherwise, you weren't.
What do you mean with "something magical"?
>> Does someone have already experience with lvalue
>> subroutines like this one?
>
> Yes, but not good ones.
Why not?
Greetings, Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: Mon, 12 Jun 2006 10:20:06 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Determining lvalue context
Message-Id: <1150100406.667593@proxy.dienste.wien.at>
Ben Morrow:
>> next_vtx_page($docid) = $new_index;
>
> This is probably bad design. You would be better with separate get/set
> functions.
Do you think that Perl's "keys" function is badly designed? It works the
same way as I hope to get my next_vtx_page() function working: when
used on the right-hand side, it returns somewhat; on the left side; it sets
somewhat. Where is the bad design here?
> The only way I know of is to return a tied scalar that does a get in
> FETCH and a set in STORE.
This would be a way, too. Someone pointed me to the "Want" module
which is able to return this kind of information. So I'll look there.
Anyway, many thanks for your suggestion and kind greetings,
Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: 12 Jun 2006 01:35:05 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: how to spider part of the content of a webpage ?
Message-Id: <1150101305.870508.4570@f6g2000cwb.googlegroups.com>
jiehuang001@hotmail.com wrote:
> This page http://www.dpgn.com/resultDetail.cfm?resultID=1 has data on
> physican networks. ("jieACS" is the username and password). When I
> change the resumtID on the URL to a different number such as 2, a
> different record will show up.
>
> Now I need to write a program, say, to collect all the records into a
> single file, from resultID=1 to resultID=10000.
That is very poor system design, it's totally insecure.
> Can someone please tell me how to write such a perl program. Of course,
> I don't need the content on the left and bottom of the webpage.
Why don't you just ask the datafile from sysadmin ?
--
Bart
------------------------------
Date: Mon, 12 Jun 2006 04:20:02 -0600
From: Chris Barts <puonegf+hfrarg@tznvy.pbz>
Subject: Re: I received eBay Star Developer Award
Message-Id: <pan.2006.06.12.10.20.00.291611@tznvy.pbz>
On Sun, 11 Jun 2006 10:30:00 -0700, caroball wrote:
>
> Chris Barts wrote:
>> On Sat, 10 Jun 2006 17:09:21 -0700, caroball wrote:
>>
>> >
>> > Congrats from a long long ago COBAL programmer
>>
>> That must have been frustrating: Hacking away at COBAL code while the
>> COBOL programmers got all the glory. ;)
>>
>> --
> MAYBE that's why my stuff always got kicked out with 9000 error
> messages - I did some FORTRAIN & AUTOMOBILECODDER too
Ha! Those are some good ones. :)
--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: 12 Jun 2006 04:49:07 -0700
From: "Lee" <leegee@gmail.com>
Subject: Re: Merging potentially undefined hashes
Message-Id: <1150112947.506337.179400@h76g2000cwa.googlegroups.com>
Derek Basch wrote:
> $hash_ref = $dbh->selectrow_hashref($statement);
A very quick scan of the thread didn't show a reference to Hash::Merge,
whose source you may find helpful, even if the whole is too cumersome
for you:
http://search.cpan.org/~mneylon/Hash-Merge-0.07/
lee
------------------------------
Date: 12 Jun 2006 02:21:38 -0700
From: "Tresh" <Tresh909@gmail.com>
Subject: Non-blocking Sockets with PerlScript on Win XP
Message-Id: <1150104098.828790.147640@i40g2000cwc.googlegroups.com>
Hello !
I'm developping an application for testing purpose which is based on a
HTML page with perlScript.
This application communicates thru sockets (i'm coding both client and
server version of the application)
Basically, it waits for some message and do some actions when the
correct message has been received.
these actions include a reply to the received message.
perlScript is used here to create powerful scenarios, which can be made
by the users of the application.
The main problem here comes from the blocking read of the socket. For
example, a scenario is launched from the HTML interface. This scenario
connects the client socket to a server and then waits for a message
from this socket. When perl executes this, while waiting, the HTML
interface freezes, so we can't click on the "stop button" of the
scenario.
That's the problem.
I'm giving a part of the code :
function testSocket which checks during 100ms if there is some data to
read on the socket.
function waitMsg which calls testSocket and handles a timeout
sub testSocket()
{
# timeout 100 ms
my $timeout = 0.1;
@ready = $sel->can_read($timeout);
if (@ready > 0)
{
foreach $fh (@ready)
{
if ($fh == $sock)
{
return 1; #data ok : will read it
}
else
{
# Maybe we have finished with the socket
$sel->remove($fh);
$fh->close;
}
}
}
return 0;
}
sub waitMsg(;$)
{
#timeout in ms (now must be a multiple of 100)
my $timeout = shift;
my $res = testSocket();
if ($res == 1)
{
return getMsg();
}
else
{
if ($timeout eq "")
{
# no timeout, infinite wait
return waitMsg();
}
else
{
if ($timeout == 0)
{
#timeout !!!
return (-1, "");
}
#recursive call
return waitMsg($timeout - 100);
}
}
The scenario must NOT continue until we have received a message or
until we reach the timeout. But the HTML-page must also NOT freeze so
that we can use the buttons on the page
Any Idea ?
Thanks !
Tresh
------------------------------
Date: 12 Jun 2006 02:39:34 -0700
From: "Nick of course" <mol10metal@hotmail.com>
Subject: Re: Non-blocking Sockets with PerlScript on Win XP
Message-Id: <1150105174.805963.238300@i40g2000cwc.googlegroups.com>
Tresh wrote:
> Hello !
>
> I'm developping an application for testing purpose which is based on a
> HTML page with perlScript.
> This application communicates thru sockets (i'm coding both client and
> server version of the application)
>
> Basically, it waits for some message and do some actions when the
> correct message has been received.
> these actions include a reply to the received message.
> perlScript is used here to create powerful scenarios, which can be made
> by the users of the application.
>
> The main problem here comes from the blocking read of the socket. For
> example, a scenario is launched from the HTML interface. This scenario
> connects the client socket to a server and then waits for a message
> from this socket. When perl executes this, while waiting, the HTML
> interface freezes, so we can't click on the "stop button" of the
> scenario.
> That's the problem.
>
> I'm giving a part of the code :
> function testSocket which checks during 100ms if there is some data to
> read on the socket.
> function waitMsg which calls testSocket and handles a timeout
>
> sub testSocket()
> {
> # timeout 100 ms
> my $timeout = 0.1;
> @ready = $sel->can_read($timeout);
> if (@ready > 0)
> {
> foreach $fh (@ready)
> {
> if ($fh == $sock)
> {
> return 1; #data ok : will read it
> }
> else
> {
> # Maybe we have finished with the socket
> $sel->remove($fh);
> $fh->close;
> }
> }
> }
> return 0;
> }
>
>
> sub waitMsg(;$)
> {
> #timeout in ms (now must be a multiple of 100)
> my $timeout = shift;
> my $res = testSocket();
> if ($res == 1)
> {
> return getMsg();
> }
> else
> {
> if ($timeout eq "")
> {
> # no timeout, infinite wait
> return waitMsg();
> }
> else
> {
> if ($timeout == 0)
> {
> #timeout !!!
> return (-1, "");
> }
> #recursive call
> return waitMsg($timeout - 100);
> }
> }
>
>
> The scenario must NOT continue until we have received a message or
> until we reach the timeout. But the HTML-page must also NOT freeze so
> that we can use the buttons on the page
>
> Any Idea ?
>
> Thanks !
>
> Tresh
You're using recursion where iteration would be more appropriate. If
can_read() never returns true you'll eventually get a stack overflow.
------------------------------
Date: 12 Jun 2006 03:12:37 -0700
From: "Tresh" <Tresh909@gmail.com>
Subject: Re: Non-blocking Sockets with PerlScript on Win XP
Message-Id: <1150107157.926759.154490@g10g2000cwb.googlegroups.com>
> You're using recursion where iteration would be more appropriate. If
> can_read() never returns true you'll eventually get a stack overflow.
That's right, I'll fix that. But the problem is about the freeze.
The user script defines a method "playScenario" which is in fact the
scenario itself. I thought i could use threads to execute this method
in a thread detached from the Mmi, but it doesn't work well (I got an
internal error when doing that)
------------------------------
Date: 12 Jun 2006 03:14:42 -0700
From: "Lee" <leegee@gmail.com>
Subject: Question: Inline::C module packaging?
Message-Id: <1150107282.845066.263690@j55g2000cwa.googlegroups.com>
Is there a preferred method of packaging an Inline::C module, perhaps
one that would compile the C in the correct place during the
installation, rather than on first run?
Thanks in anticipation
Lee
------------------------------
Date: Mon, 12 Jun 2006 12:07:55 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Question: Inline::C module packaging?
Message-Id: <bhuvl3-v24.ln1@osiris.mauzo.dyndns.org>
Quoth "Lee" <leegee@gmail.com>:
> Is there a preferred method of packaging an Inline::C module, perhaps
> one that would compile the C in the correct place during the
> installation, rather than on first run?
Read the docs for Inline.
Ben
--
We do not stop playing because we grow old;
we grow old because we stop playing.
benmorrow@tiscali.co.uk
------------------------------
Date: 12 Jun 2006 04:44:34 -0700
From: "Lee" <leegee@gmail.com>
Subject: Re: Question: Inline::C module packaging?
Message-Id: <1150112674.310783.52260@j55g2000cwa.googlegroups.com>
Ben Morrow wrote:
> Quoth "Lee" <leegee@gmail.com>:
> > Is there a preferred method of packaging an Inline::C module, perhaps
> > one that would compile the C in the correct place during the
> > installation, rather than on first run?
>
> Read the docs for Inline.
Me too, but it says:
Finally, you need to modify the Makefile.PL. Simply change:
use ExtUtils::MakeMaker;
to
use Inline::MakeMaker;
Won't that upset machines and users that don't have Inline installed?
Neither did the Iline docs help me solve errors along the lines of "No
rule to make target ... needed by `pure_all'," for which I copied
something from
http://search.cpan.org/src/FXN/Algorithm-Combinatorics-0.10/Makefile.PL.
And then there's the whole business of supplying NAME/VERSION and
having to disable one to run make test, which is not something I would
like to pass on to my end-users.
I don't always find the "RTFM" response helpful, or even worth typing.
lee
------------------------------
Date: Mon, 12 Jun 2006 13:07:22 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Question: Inline::C module packaging?
Message-Id: <q020m3-5f4.ln1@osiris.mauzo.dyndns.org>
Quoth "Lee" <leegee@gmail.com>:
> Ben Morrow wrote:
> > Quoth "Lee" <leegee@gmail.com>:
> > > Is there a preferred method of packaging an Inline::C module, perhaps
> > > one that would compile the C in the correct place during the
> > > installation, rather than on first run?
> >
> > Read the docs for Inline.
>
> Me too, but it says:
>
> Finally, you need to modify the Makefile.PL. Simply change:
> use ExtUtils::MakeMaker;
> to
> use Inline::MakeMaker;
>
> Won't that upset machines and users that don't have Inline installed?
Yes. Maybe... You can package Inline::MakeMaker with your dist, and put
a use lib line in your Makefile.PL to find it. Or you could use
Module::Install, which claims to handle Inline stuff; I've never used
it, though.
> Neither did the Iline docs help me solve errors along the lines of "No
> rule to make target ... needed by `pure_all'," for which I copied
> something from
> http://search.cpan.org/src/FXN/Algorithm-Combinatorics-0.10/Makefile.PL.
Ah yes, I remember... This was one of the main reasons I gave up on
Inline::C and just learned XS. It's really not that hard, once you've
got enough of a grasp of perl internals to write anything useful. The
other Inline:: modules, OTOH, I could see could be useful.
> And then there's the whole business of supplying NAME/VERSION and
> having to disable one to run make test, which is not something I would
> like to pass on to my end-users.
My recommendation would be to file a bug or bugs with the maintainers of
Inline. The fact that these issues still haven't been fixed since I last
used it about two years ago suggest they don't take these things
seriously enough, though...
> I don't always find the "RTFM" response helpful, or even worth typing.
...which is why you should have written something more along the lines
of 'I have read the Inline docs, but the suggestion to <foo> fails for
me because...'. Then you have a much better chance of getting the help
you need without wasting time.
Ben
--
#!/bin/sh
quine="echo 'eval \$quine' >> \$0; echo quined"
eval $quine
# [benmorrow@tiscali.co.uk]
------------------------------
Date: Mon, 12 Jun 2006 14:40:14 +0200
From: Anno Siegel <siegel@zrz.tu-berlin.de>
Subject: Re: Question: Inline::C module packaging?
Message-Id: <4f55p4F1h6mnrU1@news.dfncis.de>
Lee wrote:
> Ben Morrow wrote:
>> Quoth "Lee" <leegee@gmail.com>:
>> > Is there a preferred method of packaging an Inline::C module, perhaps
>> > one that would compile the C in the correct place during the
>> > installation, rather than on first run?
>>
>> Read the docs for Inline.
>
> Me too, but it says:
You say you have read the doc but you must have missed the second
paragraph that says:
Code
that is Inlined into distributed modules (like on the CPAN) will get
compiled when the module is installed, ...
> Finally, you need to modify the Makefile.PL. Simply change:
> use ExtUtils::MakeMaker;
> to
> use Inline::MakeMaker;
>
> Won't that upset machines and users that don't have Inline installed?
Yes, you have a module dependency. Nothing unusual. What did you
expect?
> Neither did the Iline docs help me solve errors along the lines of "No
> rule to make target ... needed by `pure_all'," for which I copied
> something from
> http://search.cpan.org/src/FXN/Algorithm-Combinatorics-0.10/Makefile.PL.
You didn't ask about that. How should replies answer questions you
haven't asked?
> And then there's the whole business of supplying NAME/VERSION and
> having to disable one to run make test, which is not something I would
> like to pass on to my end-users.
I'm not sure what you mean here, but you didn't ask about that either.
> I don't always find the "RTFM" response helpful, or even worth typing.
Then don't give the impression that you haven't even looked at it.
Anno
------------------------------
Date: 12 Jun 2006 07:34:44 GMT
From: s11976@net2.hkbu.edu.hk (pui ming Wong)
Subject: script to find the files with very long names
Message-Id: <e6j5ek$128u$1@net44p.hkbu.edu.hk>
My objective is to go down the current directory
and have the system tells me which files have their names
longer than say 26 characters
i think mixing the unix find command
with some other commands might do it.
But a perl script might do it more tidily and faster ?
------------------------------
Date: Mon, 12 Jun 2006 10:22:31 +0200
From: Mirco Wahab <peace.is.our.profession@gmx.de>
Subject: Re: script to find the files with very long names
Message-Id: <e6j8f3$l93$1@mlucom4.urz.uni-halle.de>
Thus spoke pui ming Wong (on 2006-06-12 09:34):
> My objective is to go down the current directory
> and have the system tells me which files have their names
> longer than say 26 characters
You could use modules for that:
...
use File::Find;
my $directory = '.';
find
sub {
print "$_ =>", length, " ($File::Find::name)\n" if -f;
},
$directory;
...
In the sub-block provided to find,
the actual path is given in $_,
so its just a matter of asking
'length' for that.
Regards
Mirco
------------------------------
Date: Mon, 12 Jun 2006 10:23:48 +0200
From: Mirco Wahab <peace.is.our.profession@gmx.de>
Subject: Re: script to find the files with very long names
Message-Id: <e6j8hf$l93$2@mlucom4.urz.uni-halle.de>
Thus spoke Mirco Wahab (on 2006-06-12 10:22):
> In the sub-block provided to find,
> the actual path is given in $_,
s/path/filename
Sorry
M.
------------------------------
Date: 12 Jun 2006 01:28:26 -0700
From: "Nick of course" <mol10metal@hotmail.com>
Subject: Re: script to find the files with very long names
Message-Id: <1150100906.166126.276590@g10g2000cwb.googlegroups.com>
pui ming Wong wrote:
> My objective is to go down the current directory
> and have the system tells me which files have their names
> longer than say 26 characters
>
> i think mixing the unix find command
> with some other commands might do it.
> But a perl script might do it more tidily and faster ?
perl -le 'length > 26 and print for <*>'
------------------------------
Date: Mon, 12 Jun 2006 10:53:19 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: script to find the files with very long names
Message-Id: <e6jhb1.1b8.1@news.isolution.nl>
pui ming Wong schreef:
> My objective is to go down the current directory
> and have the system tells me which files have their names
> longer than say 26 characters
>
> i think mixing the unix find command
> with some other commands might do it.
> But a perl script might do it more tidily and faster ?
For the current directory only:
perl -wle 'while(<*>){print if length()>26}'
Files only:
perl -wle 'while(<*>){-f and length()>26 and print}'
Current directory and below:
find -E . -type f -regex ".*/[^/]{26,}"
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
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 9285
***************************************