[30193] in Perl-Users-Digest
Perl-Users Digest, Issue: 1436 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 15 14:40:19 2008
Date: Tue, 15 Apr 2008 11:39:39 -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 Tue, 15 Apr 2008 Volume: 11 Number: 1436
Today's topics:
Re: ? about using multi-level menu system using dispatc <syscjm@sumire.gwu.edu>
Re: ? about using multi-level menu system using dispatc <mmccaws@comcast.net>
ANNOUNCE: Text::CSV_XS-0.41 <h.m.brand@xs4all.nl>
anyone has done this kind of perl/CGI? <robertchen117@gmail.com>
Re: anyone has done this kind of perl/CGI? <glex_no-spam@qwest-spam-no.invalid>
Can "perldoc" take input from a pipe? jomarbueyes@hotmail.com
Re: Can "perldoc" take input from a pipe? <devnull4711@web.de>
Re: Can "perldoc" take input from a pipe? jomarbueyes@hotmail.com
Re: Can "perldoc" take input from a pipe? <ben@morrow.me.uk>
Re: Can I iterate through a file on a CGI page? <rich@example.net>
Re: Can I iterate through a file on a CGI page? <glex_no-spam@qwest-spam-no.invalid>
Re: Can I iterate through a file on a CGI page? <rich@example.net>
Re: Can I iterate through a file on a CGI page? <joost@zeekat.nl>
Re: Can I iterate through a file on a CGI page? <glex_no-spam@qwest-spam-no.invalid>
Re: Can I iterate through a file on a CGI page? <1usa@llenroc.ude.invalid>
Re: Can I iterate through a file on a CGI page? <jimsgibson@gmail.com>
Re: Can I iterate through a file on a CGI page? <rich@example.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 09 Apr 2008 14:10:05 -0500
From: Chris Mattern <syscjm@sumire.gwu.edu>
Subject: Re: ? about using multi-level menu system using dispatch method
Message-Id: <slrnfvq54c.814.syscjm@sumire.gwu.edu>
On 2008-04-09, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:
<snip>
>
> AFAIK zombies usually consume minimal resources in terms of memory, etc,
Zombies consume *no* resources. A zombie process is an entry in the
process table with a return code, nothing more. They consume no
resources whatsoever other than the process table entry.
> but occupy slots in the process table such that it if they multiply in
> an unlimited way, the OS may eventually be unable to start any new
> process due to lack of resources (like process table slots). It is a
> long time since I first encountered this so the details may differ in
> current OSs.
This is correct. The only way zombies can actually hurt the system
is if they actually starve it of available process table slots. Note
that this takes a *lot* of zombies.
--
Christopher Mattern
NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities
------------------------------
Date: Wed, 9 Apr 2008 12:42:43 -0700 (PDT)
From: mmccaws2 <mmccaws@comcast.net>
Subject: Re: ? about using multi-level menu system using dispatch method
Message-Id: <f1097816-ef3e-4a2e-aae0-96cb6da547c3@m44g2000hsc.googlegroups.com>
On Apr 9, 12:10=A0pm, Chris Mattern <sys...@sumire.gwu.edu> wrote:
> On 2008-04-09, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo> wrote:
> <snip>
>
>
>
> > AFAIK zombies usually consume minimal resources in terms of memory, etc,=
>
> Zombies consume *no* resources. =A0A zombie process is an entry in the
> process table with a return code, nothing more. =A0They consume no
> resources whatsoever other than the process table entry.
>
> > but occupy slots in the process table such that it if they multiply in
> > an unlimited way, the OS may eventually be unable to start any new
> > process due to lack of resources (like process table slots). It is a
> > long time since I first encountered this so the details may differ in
> > current OSs.
>
> This is correct. =A0The only way zombies can actually hurt the system
> is if they actually starve it of available process table slots. =A0Note
> that this takes a *lot* of zombies.
>
> --
> =A0 =A0 =A0 =A0 =A0 =A0 =A0Christopher Mattern
>
> NOTICE
> Thank you for noticing this new notice
> Your noticing it has been noted
> And will be reported to the authorities
both very clear answers. Thanks
I'm on HPUX. I learn from my system admins what they feel is this
system's best way to assess it's memory usage.
Thanks
Mike
------------------------------
Date: Fri, 11 Apr 2008 10:29:39 GMT
From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
Subject: ANNOUNCE: Text::CSV_XS-0.41
Message-Id: <Jz5wFr.roo@zorch.sf-bay.org>
file: $CPAN/authors/id/H/HM/HMBRAND/Text-CSV_XS-0.41.tgz
size: 85570 bytes
md5: f704fb8ad057a36e7cc0fb892c0f940a
2008-04-11 0.41 - H.Merijn Brand <h.m.brand@xs4all.nl>
* error_diag () subclassable
* typo in bind_columns () docs
* examples/csv2xls now uses getline ()
* better test for getline in t/75_hashref.t (makamata)
* document return value of getline () with bind_columns ()
* add perl version prereq to META.yml
2008-04-07 0.40 - H.Merijn Brand <h.m.brand@xs4all.nl>
* Implemented getline_hr () and column_names () RT 34474
(suggestions accepted from Mark Stosberg)
* Corrected misspelled variable names in XS
* Functions are now =head2 type doc entries (Mark Stosberg)
* Make SetDiag() available to the perl level, so errors can
be centralized and consistent
* Integrate the non-XS errors into XS
* Add t/75_hashref.t
* Testcase for error 2023 (Michael P Randall)
* Completely refactored the XS part of parse/getline, which
is now up to 6% faster. YMMV
* Completed bind_columns. On straight fetches now up to three
times as fast as normal fetches (both using getline ())
2008-03-11 0.37 - H.Merijn Brand <h.m.brand@xs4all.nl>
* Copied GIT repo to public mirror
* Fix leak / make meta info available to getline () + tests
------------------------------
Date: Sun, 13 Apr 2008 19:41:55 -0700 (PDT)
From: "robertchen117@gmail.com" <robertchen117@gmail.com>
Subject: anyone has done this kind of perl/CGI?
Message-Id: <6f1f9ca5-16a3-40c3-8fb8-417f2b616344@k1g2000prb.googlegroups.com>
I want to make a cgi page like this:
there are 5 steps button, click one by one and get the step output.
Cgi should looks like this:
please click on each steps:
Step I button
step I execute output here:
then step II button:
step II output here:
....
the difficult part is the output is just below each steps' button. I
do not how to do it. Please help me.
Robert
------------------------------
Date: Mon, 14 Apr 2008 10:52:42 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: anyone has done this kind of perl/CGI?
Message-Id: <48037dca$0$89399$815e3792@news.qwest.net>
robertchen117@gmail.com wrote:
> I want to make a cgi page like this:
CGI pages don't look like anything, it's the HTML that a CGI might
generate.
>
> there are 5 steps button, click one by one and get the step output.
>
> Cgi should looks like this:
>
> please click on each steps:
>
> Step I button
>
> step I execute output here:
>
> then step II button:
>
> step II output here:
>
> ....
>
> the difficult part is the output is just below each steps' button. I
> do not how to do it. Please help me.
Show us what you have done. Initially it looks like AJAX would
be a possible piece, so that'd be a topic to start reading. A
library like Prototype might handle most of the interface issues
for you. Your CGI could simply take arguments and generate the
output that you'd display after the button.
You could also have your CGI do everything and there are plenty of
CGI tutorials on the Internet.
------------------------------
Date: Tue, 15 Apr 2008 10:05:38 -0700 (PDT)
From: jomarbueyes@hotmail.com
Subject: Can "perldoc" take input from a pipe?
Message-Id: <73486fac-d86e-45d5-8cfe-45b688f0c2aa@u69g2000hse.googlegroups.com>
Dear All,
Is there a way to make perldoc take its input from stdin? I tried the
obvious:
command | perldoc
but it didn't work.
My idea is to embed "pod" documentation in source code written in
Fortran and C++, then write a perl script that will search for the pod
documentation, remove the comment marks, and pipe the resulting output
to something that can format perlpod.
I'm using Perl 5.8.8 under Linix and Mac OS X (10.5 Intel and 10.4
PPC) and Perl 5.004_05 under Irix 6.4.
Thanks in advance for any help,
Jomar
------------------------------
Date: Tue, 15 Apr 2008 19:28:10 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Can "perldoc" take input from a pipe?
Message-Id: <66k6tpF2kl8ufU4@mid.individual.net>
jomarbueyes@hotmail.com wrote:
>
> Is there a way to make perldoc take its input from stdin? I tried the
> obvious:
> command | perldoc
> but it didn't work.
>
> My idea is to embed "pod" documentation in source code written in
> Fortran and C++, then write a perl script that will search for the pod
> documentation, remove the comment marks, and pipe the resulting output
> to something that can format perlpod.
I would use the pod2man-converter which reads from stdin.
$ command | pod2man | less
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Tue, 15 Apr 2008 10:52:38 -0700 (PDT)
From: jomarbueyes@hotmail.com
Subject: Re: Can "perldoc" take input from a pipe?
Message-Id: <5d1e156d-f266-48de-be52-53d8398a5e51@1g2000prg.googlegroups.com>
On Apr 15, 12:28 pm, Frank Seitz <devnull4...@web.de> wrote:
> jomarbue...@hotmail.com wrote:
>
> > Is there a way to make perldoc take its input from stdin? I tried the
> > obvious:
> > command | perldoc
> > but it didn't work.
>
> > My idea is to embed "pod" documentation in source code written in
> > Fortran and C++, then write a perl script that will search for the pod
> > documentation, remove the comment marks, and pipe the resulting output
> > to something that can format perlpod.
>
> I would use the pod2man-converter which reads from stdin.
>
> $ command | pod2man | less
>
> Frank
> --
> Dipl.-Inform. Frank Seitz;http://www.fseitz.de/
> Anwendungen f=FCr Ihr Internet und Intranet
> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
Thanks Frank,
I added a pipe to "nroff -man", i.e
$ command | pod2man | nroff -man | less
and that does what I needed.
Thank you again,
Jomar
------------------------------
Date: Tue, 15 Apr 2008 19:29:22 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Can "perldoc" take input from a pipe?
Message-Id: <2p8fd5-9ub.ln1@osiris.mauzo.dyndns.org>
Quoth jomarbueyes@hotmail.com:
>
> Is there a way to make perldoc take its input from stdin? I tried the
> obvious:
> command | perldoc
> but it didn't work.
>
> My idea is to embed "pod" documentation in source code written in
> Fortran and C++, then write a perl script that will search for the pod
> documentation, remove the comment marks, and pipe the resulting output
> to something that can format perlpod.
perldoc already has that functionality. If I put
#include <stdio.h>
/*
=head1 NAME
fubar - a program for making mistakes
=cut
*/
int
main (int argc, char **argv)
{
return 1;
}
into fubar.c (note that all the blank lines inside the comment are
required, to make it valid POD) then `perldoc fubar.c` quite happily
formats and displays the POD.
The real trick, of course, is to work out how to embed it into the
resulting executable... :)
Ben
------------------------------
Date: Thu, 10 Apr 2008 18:28:20 GMT
From: Rich Grise <rich@example.net>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <pan.2008.04.10.19.27.41.430511@example.net>
On Tue, 08 Apr 2008 16:12:14 -0700, Jim Gibson wrote:
> In article <47fbe8c0$0$33227$815e3792@news.qwest.net>, J. Gleixner
> <glex_no-spam@qwest-spam-no.invalid> wrote:
>> Rich Grise wrote:
>> >
>> > my $line=`ls -l source-links | head -2 | tail -1`;
>> > chomp $line;
>> > my $linkname = substr("$line", 50, 12);
>> > my $targetname = substr("$line", 66);
>> > print("$line\n");
>> > print("name = $linkname, target = $targetname\n");
>>
>> Not very reliable. If the owner or group change to something
>> of different length, it could easily return the wrong data. Using
>> split would be more reliable, but still not very good.
>>
>> Use the correct function: perldoc -f readlink
>
> This should work and doesn't require shelling out to ls:
>
> use strict;
> use warnings;
> use File::Find;
> find(
> sub {
> my $linkname = $_;
> return unless -l $_;
> my $targetname = readlink $linkname;
> print "name = $linkname, target = $targetname\n";
> },
> 'source-links'
> );
OK, I do this, and it shows me _all_ of the links. What have I
missed?
And am I supposed to pass the name of the link I'm looking for? Why
do you initialize $linkname to $_? I want a script that doesn't
have to already know $linkname - it needs to find the next one in
the subdir, whichever one that is.
What am I missing?
Thanks,
Rich
Thanks,
Rich
------------------------------
Date: Thu, 10 Apr 2008 14:41:32 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <47fe6d6d$0$87075$815e3792@news.qwest.net>
Rich Grise wrote:
> On Tue, 08 Apr 2008 16:12:14 -0700, Jim Gibson wrote:
>
>> In article <47fbe8c0$0$33227$815e3792@news.qwest.net>, J. Gleixner
>> <glex_no-spam@qwest-spam-no.invalid> wrote:
>>> Rich Grise wrote:
>
>>>> my $line=`ls -l source-links | head -2 | tail -1`;
>>>> chomp $line;
>>>> my $linkname = substr("$line", 50, 12);
>>>> my $targetname = substr("$line", 66);
>>>> print("$line\n");
>>>> print("name = $linkname, target = $targetname\n");
>>> Not very reliable. If the owner or group change to something
>>> of different length, it could easily return the wrong data. Using
>>> split would be more reliable, but still not very good.
>>>
>>> Use the correct function: perldoc -f readlink
>> This should work and doesn't require shelling out to ls:
>>
>> use strict;
>> use warnings;
>> use File::Find;
>> find(
>> sub {
>> my $linkname = $_;
>> return unless -l $_;
>> my $targetname = readlink $linkname;
>> print "name = $linkname, target = $targetname\n";
>> },
>> 'source-links'
>> );
>
> OK, I do this, and it shows me _all_ of the links. What have I
> missed?
>
> And am I supposed to pass the name of the link I'm looking for? Why
> do you initialize $linkname to $_? I want a script that doesn't
> have to already know $linkname - it needs to find the next one in
> the subdir, whichever one that is.
>
> What am I missing?
First, you missed reading the documentation before posting yet
another question. Second, you missed defining to us what
'the next one' means. If there is some order, then you need to
sort the files/directories and do whatever you want with that
information:
perldoc File::Find
perldoc -f stat
perldoc -f sort
Reading those should help you answer your questions.
------------------------------
Date: Thu, 10 Apr 2008 21:44:46 GMT
From: Rich Grise <rich@example.net>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <pan.2008.04.10.22.44.04.449447@example.net>
On Thu, 10 Apr 2008 14:41:32 -0500, J. Gleixner wrote:
> Rich Grise wrote:
>> On Tue, 08 Apr 2008 16:12:14 -0700, Jim Gibson wrote:
>>
>>> In article <47fbe8c0$0$33227$815e3792@news.qwest.net>, J. Gleixner
>>> <glex_no-spam@qwest-spam-no.invalid> wrote:
>>>> Rich Grise wrote:
>>
>>>>> my $line=`ls -l source-links | head -2 | tail -1`;
>>>>> chomp $line;
>>>>> my $linkname = substr("$line", 50, 12);
>>>>> my $targetname = substr("$line", 66);
>>>>> print("$line\n");
>>>>> print("name = $linkname, target = $targetname\n");
>>>> Not very reliable. If the owner or group change to something
>>>> of different length, it could easily return the wrong data. Using
>>>> split would be more reliable, but still not very good.
>>>>
>>>> Use the correct function: perldoc -f readlink
>>> This should work and doesn't require shelling out to ls:
>>>
>>> use strict;
>>> use warnings;
>>> use File::Find;
>>> find(
>>> sub {
>>> my $linkname = $_;
>>> return unless -l $_;
>>> my $targetname = readlink $linkname;
>>> print "name = $linkname, target = $targetname\n";
>>> },
>>> 'source-links'
>>> );
>>
>> OK, I do this, and it shows me _all_ of the links. What have I
>> missed?
>>
>> And am I supposed to pass the name of the link I'm looking for? Why
>> do you initialize $linkname to $_? I want a script that doesn't
>> have to already know $linkname - it needs to find the next one in
>> the subdir, whichever one that is.
>>
>> What am I missing?
>
> First, you missed reading the documentation before posting yet
> another question. Second, you missed defining to us what
> 'the next one' means. If there is some order, then you need to
> sort the files/directories and do whatever you want with that
> information:
>
> perldoc File::Find
> perldoc -f stat
> perldoc -f sort
>
> Reading those should help you answer your questions.
Yeah, you're right, I'm sorry, but I've been reading for going on about
a month now and it's terribly frustrating - it's pretty much the same
problem with all the Linux docs - you have to already know what feature
you're looking for before you know which doc to read, like for example:
`readlink` - how is a person supposed to know that such a thing even
exists, except by asking, or plowing through every possible doc there
is until you stumble upon it? ?:-/
Thanks,
Rich
------------------------------
Date: Thu, 10 Apr 2008 23:55:04 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <87skxtxtmv.fsf@zeekat.nl>
Rich Grise <rich@example.net> writes:
> Yeah, you're right, I'm sorry, but I've been reading for going on about
> a month now and it's terribly frustrating - it's pretty much the same
> problem with all the Linux docs - you have to already know what feature
> you're looking for before you know which doc to read, like for example:
> `readlink` - how is a person supposed to know that such a thing even
> exists, except by asking, or plowing through every possible doc there
> is until you stumble upon it? ?:-/
For *nix programming in general, I really recommend the "advanced
programming in the unix environment, 2nd edition" book from Addisson
Wesley. For perl, get the "programming perl" book from O'Reilly, and for
quick searches, see perldoc perltoc.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Thu, 10 Apr 2008 17:45:45 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <47fe9899$0$89395$815e3792@news.qwest.net>
Joost Diepenmaat wrote:
> Rich Grise <rich@example.net> writes:
>
>> Yeah, you're right, I'm sorry, but I've been reading for going on about
>> a month now and it's terribly frustrating - it's pretty much the same
>> problem with all the Linux docs - you have to already know what feature
>> you're looking for before you know which doc to read, like for example:
>> `readlink` - how is a person supposed to know that such a thing even
>> exists, except by asking, or plowing through every possible doc there
>> is until you stumble upon it? ?:-/
>
> For *nix programming in general, I really recommend the "advanced
> programming in the unix environment, 2nd edition" book from Addisson
> Wesley. For perl, get the "programming perl" book from O'Reilly, and for
> quick searches, see perldoc perltoc.
>
Also you may use the power of the that there Internet. For fun I
searched on "perl symbolic link" and readlink was covered in the
second link of the results.
------------------------------
Date: Thu, 10 Apr 2008 23:40:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <Xns9A7CC83501F3Fasu1cornelledu@127.0.0.1>
"J. Gleixner" <glex_no-spam@qwest-spam-no.invalid> wrote in
news:47fe9899$0$89395$815e3792@news.qwest.net:
> Joost Diepenmaat wrote:
>> Rich Grise <rich@example.net> writes:
>>
...
>>> which doc to read, like for example: `readlink` - how is a
>>> person supposed to know that such a thing even exists, except by
>>> asking, or plowing through every possible doc there is until you
>>> stumble upon it? ?:-/
>>
...
>> for quick searches, see perldoc perltoc.
>>
>
> Also you may use the power of the that there Internet. For fun I
> searched on "perl symbolic link" and readlink was covered in the
> second link of the results.
I also think the most natural place to look first is:
perldoc perltoc
from which one finds out
perlfunc - Perl builtin functions
Then, reading perldoc perlfunc, one notices
Functions for filehandles, files, or directories
"-*X*", "chdir", "chmod", "chown", "chroot", "fcntl", "glob",
"ioctl", "link", "lstat", "mkdir", "open", "opendir", "readlink",
"rename", "rmdir", "stat", "symlink", "sysopen", "umask",
"unlink", "utime"
One can then learn more about the four functions that have 'link' as
part of their names.
perldoc -f link
perldoc -f readlink
perldoc -f symlink
perldoc -f unlink
I would assume that somewhere along this short and painless process,
one would find out what one needs.
Look 'ma: No Google. No UseNet. No books. Just the basic Perl
documentation.
After a while, one can develop a sense of where to find information
with even less searching.
On the other hand, if one can always rely on being handed a fish for
the asking, one will never have an incentive to put one's own time
and effort into researching answers.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Thu, 10 Apr 2008 16:43:45 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <100420081643454900%jimsgibson@gmail.com>
In article <pan.2008.04.10.19.27.41.430511@example.net>, Rich Grise
<rich@example.net> wrote:
> On Tue, 08 Apr 2008 16:12:14 -0700, Jim Gibson wrote:
>
> > In article <47fbe8c0$0$33227$815e3792@news.qwest.net>, J. Gleixner
> > <glex_no-spam@qwest-spam-no.invalid> wrote:
> >> Rich Grise wrote:
>
> >> >
> >> > my $line=`ls -l source-links | head -2 | tail -1`;
> >> > chomp $line;
> >> > my $linkname = substr("$line", 50, 12);
> >> > my $targetname = substr("$line", 66);
> >> > print("$line\n");
> >> > print("name = $linkname, target = $targetname\n");
> >>
> >> Not very reliable. If the owner or group change to something
> >> of different length, it could easily return the wrong data. Using
> >> split would be more reliable, but still not very good.
> >>
> >> Use the correct function: perldoc -f readlink
> >
> > This should work and doesn't require shelling out to ls:
> >
> > use strict;
> > use warnings;
> > use File::Find;
> > find(
> > sub {
> > my $linkname = $_;
> > return unless -l $_;
> > my $targetname = readlink $linkname;
> > print "name = $linkname, target = $targetname\n";
> > },
> > 'source-links'
> > );
>
> OK, I do this, and it shows me _all_ of the links. What have I
> missed?
>
> And am I supposed to pass the name of the link I'm looking for? Why
> do you initialize $linkname to $_? I want a script that doesn't
> have to already know $linkname - it needs to find the next one in
> the subdir, whichever one that is.
>
> What am I missing?
Nothing, really. I didn't explain why my program prints out all of the
links while yours only does one. I thought you might be able to figure
out how to modify this program, which is just an example of fetching
_all_ symbolic links in a directory.
If you read the documentation for File::Find, you will see that the
module will first cd to the target directory containing the file and
put the name of the file in the variable $_ before calling what the
docs call the "wanted" subroutine, which is actually an anonymous
subroutine in my program. I copied $_ to $linkname to save the name in
case you wanted to do anything that might change the $_ variable, which
is global.
If you only want to process one file at each execution, you can
terminate your program after the first one, or save the name of the
first one in a variable and only process that one after find() has
finished.
However, you may want to process _all_ files in your subdirectory, in
which case using File::Find makes it very easy to iterate over all of
the files in a subdirectory tree.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Tue, 15 Apr 2008 18:31:50 GMT
From: Rich Grise <rich@example.net>
Subject: Re: Can I iterate through a file on a CGI page?
Message-Id: <pan.2008.04.15.19.31.09.16170@example.net>
On Thu, 10 Apr 2008 18:28:20 +0000, Rich Grise wrote:
For what it's worth, I've used a lot of the suggestions here, and I
have a successful script - now comes the tedious part - sitting and
looking at 17,000 pictures, one at a time, with a "keep" and "skip"
button. :-)
Many Thanks to All!
Rich
------------------------------
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 1436
***************************************