|
|
Up |
|
|
  |
Author: AlitaiaAlitaia
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 |
|
  |
Author: Tony LissnerTony 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 |
|
  |
Author: PerlFAQ ServerPerlFAQ 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
|
|
  |
Author: PerlFAQ ServerPerlFAQ 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
|
|
  |
Author: Anaya.Stratton.group.comAnaya.Stratton.group.com
Date: Dec 1, 2007 21:43
.:: Unix and Linux Hacking and Security ::.
1. Unix - Vulnerabilities and Advisories
-- Tutorials and Papers
-- Specific Exploits and Vulnerabilities
2. Unix - Security Tools
-- Unix Security and Audit Tools (Including IDS and Access Control
Tools)
-- Unix Log Analysis Tools
-- Unix Proxies, Firewalls and Accessories
-- Unix Miscellany
3. Unix - BSD, FreeBSD, etc...
-- FreeBSD
-- BSD and Misc. BSD variants
-- BSD Security Tools
-- BSD Micro-distributions
|
| Show full article (6.74Kb) |
|
no comments
|
|
  |
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Dec 1, 2007 18: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.18: Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
Short answer: No, Perl does not have a Year 2000 problem. Yes, Perl is
Y2K compliant (whatever that means). The programmers you've hired to use
it, however, probably are not.
Long answer: The question belies a true understanding of the issue. Perl
is just as Y2K compliant as your pencil--no more, and no less. Can you
use your pencil to write a non-Y2K-compliant memo? Of course you can. Is
that the pencil's fault? Of course it isn't.
|
| Show full article (2.56Kb) |
|
no comments
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Dec 1, 2007 12: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.73: How do I print out or copy a recursive data structure?
The "Data::Dumper" module on CPAN (or the 5.005 release of Perl) is
great for printing out data structures. The "Storable" module on CPAN
(or the 5.8 release of Perl), provides a function called "dclone" that
recursively copies its argument.
use Storable qw(dclone);
$r2 = dclone($r1);
Where $r1 can be a reference to any kind of data structure you'd like.
It will be deeply copied. Because "dclone" takes and returns references,
you'd have to add extra punctuation if you had a hash of arrays that you
wanted to copy.
%%newhash = %%{ dclone(\%%oldhash) };
--------------------------------------------------------------------
|
| Show full article (1.66Kb) |
|
no comments
|
|
  |
Author: dilbert1999dilbert1999
Date: Dec 1, 2007 09:16
Hi all,
I have used Perl 5.8.8 for some time now, but I hope you don't mind if
I post my first ever perl 5.10 program and ask for comments: (I just
discovered that ActiveState have now released a Beta for Perl 5.10
under Windows XP)
C:\>perl -v
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
Binary build 1000 [283192] Beta provided by ActiveState http://www.ActiveState.com
Built Nov 22 2007 14:37:48
Here is my program :
use strict;
use warnings;
use feature ':5.10';
property($_) for (0, 1, 2, 3, 4, 'aad', 'abd', 'acd', 'add', 99, 100,
101, 3.1415);
|
| Show full article (1.07Kb) |
|
4 Comments |
|
  |
|
|
  |
Author: A. Sinan UnurA. Sinan Unur
Date: Dec 1, 2007 08:20
"Petr Vileta" wrote in
news:fipin5$vsd$1@ns.felk.cvut.cz:
> My question is not perl specific but here are many clever people :-)
You don't see me asking for restaurant recommendations here, do you?
Sinan
|
| |
|
5 Comments |
|
|
|
|
|
|