comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
December 2007
motuwethfrsasuw
     12 48
3456789 49
10111213141516 50
17181920212223 51
24252627282930 52
31       1
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  File::Find make me mad         


Author: Alitaia
Date: Dec 2, 2007 19:10

I write a simple perl, del.pl, to use File::Find to find *.ape and
delete them. I can find the *.ape but can not del outside the
directory, can del them within the directory, I dont know what's
wrong.

for example:
If directory structure like this:
---./layer1
|
/layer2
|
a.ape
b.ape

with the following code, within layer2
#del.pl ./ a.ape and b.ape can be deleted

but if under ./layer1,
#del.pl ./layer2 a.ape, b.ape can be found but can not del

what is wrong?
Show full article (0.96Kb)
6 Comments
  Increment in nested loop         


Author: Tony Lissner
Date: Dec 2, 2007 08:30

This is a shortened version.
Anyone have any ideas how to get the
inner loop to increment.

Source file unknown number of lines.
Read the file and print two lines per
page until EOF

This is what I want.
Page N
Headers
Two lines on each page

Page 1
Headers
25,Fred,Nerk
23,Foo,Bar

Page 2
Headers
05,perl,v5.8.8
blank line

This is what I get.
Show full article (0.81Kb)
6 Comments
  FAQ 4.45 How do I find the first array element for which a condition is true?         


Author: PerlFAQ Server
Date: Dec 2, 2007 06:03

This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

4.45: How do I find the first array element for which a condition is true?

To find the first array element which satisfies a condition, you can use
the "first()" function in the "List::Util" module, which comes with Perl
5.8. This example finds the first element that contains "Perl".

use List::Util qw(first);

my $element = first { /Perl/ } @array;

If you cannot use "List::Util", you can make your own loop to do the
same thing. Once you find the element, you stop the loop with last.

my $found;
foreach ( @array ) {
if( /Perl/ ) { $found = $_; last }
}
Show full article (2.14Kb)
no comments
  FAQ 3.31 What's MakeMaker?         


Author: PerlFAQ Server
Date: Dec 2, 2007 00:03

This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

3.31: What's MakeMaker?

(contributed by brian d foy)

The "ExtUtils::MakeMaker" module, better known simply as "MakeMaker",
turns a Perl script, typically called "Makefile.PL", into a Makefile.
The unix tool "make" uses this file to manage dependencies and actions
to process and install a Perl distribution.

--------------------------------------------------------------------
Show full article (1.30Kb)
no comments