07-12-2001
Telnet to server and run the code. If u want to execute it is through browser you have to make some changes:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use File::Find;
foreach $start (@INC) { find(\&modules, $start); }
sub modules {
if (-d && /^[a-z]/) { $File::Find::Prune = 1; return; }
return unless /\.pm$/;
my $filename = "$File::Find::dir/$_";
$filename =~ s!^$start/!!;
$filename =~ s!\.pm$!!;
$filename =~ s!/!::!g;
print "$filename<BR>\n";
}
10 More Discussions You Might Find Interesting
1. Solaris
My company has a product that is running on JBoss on Solaris against Oracle 8.1.7. We are having an issue with the server process and high CPU utilization. During this time, and only during this time, we are experiencing database locks that will not let go. A 'ps -L' on the server process... (5 Replies)
Discussion started by: hosierdm
5 Replies
2. Shell Programming and Scripting
Hi,
I've a issue in writing a perl script that will automatically monitor the site availability.
There are two different cookies are set in two consecutive flows to a URL and this second cookie has to be passed to the third step which actually gives permission to access based upon the cookie. ... (1 Reply)
Discussion started by: dayanandra
1 Replies
3. Linux
Hi all,
I am working on USB data monitoring on Fedora Core 9. Kernel 2.6.25 has a built-in module (the one that isn't loadable, but compiles and links statically with the kernel during compilation) to snoop USB data. It is in <kernel_source_code>/drivers/usb/mon/.
I need to know if I can... (0 Replies)
Discussion started by: anitemp
0 Replies
4. Shell Programming and Scripting
Hi,
Could some one tell me how to login to any web site and get that page using perl LWP. I heard that we can login to the site using LWP.
I dont want to use WWW:Mechanize as I dont have that module installed on the server.
Appreciate your early response.
Thanks... (8 Replies)
Discussion started by: Anjan1
8 Replies
5. Shell Programming and Scripting
Can some one tell me how to post the username and password using perl LWP. An example is sufficient.. (0 Replies)
Discussion started by: Anjan1
0 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I'm having a problem when I run the following code for example
perl -e 'use LWP::Simple; getprint "http://google.com"'
Can't locate LWP/Simple.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6... (7 Replies)
Discussion started by: pawannoel
7 Replies
7. Shell Programming and Scripting
Hello all.. i am new to perl scripting.. i wanted to parse a text file, encode the parsed text and attach in url.. please point me to right resources if you know any..This is my major problem. Now i try to get a url running and save it in a text file using LWP module in perl, I used following... (0 Replies)
Discussion started by: empyrean
0 Replies
8. Shell Programming and Scripting
Hi;
Can i have ne sample examples of of using " lwp-request" in shell script.
Is it necessary to have perl installed already in linux box for using this;
Thnks; (2 Replies)
Discussion started by: ajaypadvi
2 Replies
9. Shell Programming and Scripting
I am requesting for the text parsing section below. Any helps are highly appreciated.
<tr valign="top"><td nowrap>Source name</td>
<td style="text-align: justify">Sample Name<br></td>
I want Sample Name from above.
In the same file, I have to search for another pattern like this
<td><a... (1 Reply)
Discussion started by: jacobs.smith
1 Replies
10. Web Development
Hi,
I would like to read content from a https site.
I have decided to use LWP module in perl. but it throwed 401 Authorization required error.
i dont want to hard code the password in my perl code. Is there any way to achieve the authentication without hardcoding the password.
Thanks,... (1 Reply)
Discussion started by: pandeesh
1 Replies
LEARN ABOUT DEBIAN
file::find::object
File::Find::Object(3pm) User Contributed Perl Documentation File::Find::Object(3pm)
NAME
File::Find::Object - An object oriented File::Find replacement
SYNOPSIS
use File::Find::Object;
my $tree = File::Find::Object->new({}, @targets);
while (my $r = $tree->next()) {
print $r ."
";
}
DESCRIPTION
File::Find::Object does same job as File::Find but works like an object and with an iterator. As File::Find is not object oriented, one
cannot perform multiple searches in the same application. The second problem of File::Find is its file processing: after starting its main
loop, one cannot easilly wait for another event and so get the next result.
With File::Find::Object you can get the next file by calling the next() function, but setting a callback is still possible.
FUNCTIONS
new
my $ffo = File::Find::Object->new( { options }, @targets);
Create a new File::Find::Object object. @targets is the list of directories or files which the object should explore.
options
depth
Boolean - returns the directory content before the directory itself.
nocrossfs
Boolean - doesn't continue on filesystems different than the parent.
followlink
Boolean - follow symlinks when they point to a directory.
You can safely set this option to true as File::Find::Object does not follow the link if it detects a loop.
filter
Function reference - should point to a function returning TRUE or FALSE. This function is called with the filename to filter, if the
function return FALSE, the file is skipped.
callback
Function reference - should point to a function, which would be called each time a new file is returned. The function is called with
the current filename as an argument.
next
Returns the next file found by the File::Find::Object. It returns undef once the scan is completed.
item
Returns the current filename found by the File::Find::Object object, i.e: the last value returned by next().
next_obj
Like next() only returns the result as a convenient File::Find::Object::Result object. "$ff->next()" is equivalent to
"$ff->next_obj()->path()".
item_obj
Like item() only returns the result as a convenient File::Find::Object::Result object. "$ff->item()" is equivalent to
"$ff->item_obj()->path()".
$ff->set_traverse_to([@children])
Sets the children to traverse to from the current node. Useful for pruning items to traverse.
$ff->prune()
Prunes the current directory. Equivalent to $ff->set_traverse_to([]).
[@children] = $ff->get_traverse_to()
Retrieves the children that will be traversed to.
[@files] = $ff->get_current_node_files_list()
Gets all the files that appear in the current directory. This value is constant for every node, and is useful to use as the basis of the
argument for "set_traverse_to()".
BUGS
No bugs are known, but it doesn't mean there aren't any.
SEE ALSO
There's an article about this module in the Perl Advent Calendar of 2006: <http://perladvent.pm.org/2006/2/>.
File::Find is the core module for traversing files in perl, which has several limitations.
File::Next, File::Find::Iterator, File::Walker and the unmaintained File::FTS are alternatives to this module.
LICENSE
Copyright (C) 2005, 2006 by Olivier Thauvin
This package is free software; you can redistribute it and/or modify it under the following terms:
1. The GNU General Public License Version 2.0 - http://www.opensource.org/licenses/gpl-license.php
2. The Artistic License Version 2.0 - http://www.perlfoundation.org/legal/licenses/artistic-2_0.html
3. At your option - any later version of either or both of these licenses.
perl v5.10.0 2009-06-18 File::Find::Object(3pm)