Live Help

Enterprise Email Hosting

Guru-host is now offering a wide range of Zimbra hosted packages based on latest Zimbra Collaboration Suite. With Zimbra you will be able to sync in real time your mobile phone no matter it's Operating System, share documents, write online documents and many many other interesting features available only on Zimbra. Squirrelmail, Gmail, Horde and other IMAP clients are a way behind Zimbra. Contact us to setup a demo account for you. Pricing details along with usuful information about how Zimbra works can be found under http://guru-host.eu/en/Zimbra.

Guru-host goes to Centos.org

We are thrilled to announce that Guru-host.eu is a sponsor of CentOS project.
A new repository with 100Mbit Internet Connection on Dual Core Xeon CPU will be available to all our customers along with European citizens. This will server data much faster than the US repositories. Guru-host customers will be able to update their CentOS servers without calculating traffic (bandwidth) as the server is running inside our core network. CentOS is 100% compatible with Redhat Enterprise Server.


Network Storage up to 8TB per customer

We can now deliver iSCSI storage on our enterprise class Storage Area Network (SAN) which is based on the industry leading Lefthand Networks platform from HP.

Contact us for a custom quote
Walking the Filesystem Using the File Find Module

Perl comes with a module called File::Find that allows Perl to emulate the Unix find command. The easiest way to begin using this module is to use the find2perl command to generate prototypical Perl code for you. find2perl is not always easy to use on non-Unix Perl ports. For example, MacOS users either will need Macintosh Programmer's Workshop (MPW) to run it, or should modify the code to take @ARGV from a dialog box.

For instance, let's say you need some code to search the /home directory for files named hosting.
The command line that uses the Unix find command is:
% find /home -name hosting -print

Feed the same options to find2perl:
% find2perl /home -name hosting -print

and it produces:

#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
require "find.pl";
# Traverse desired filesystems
&find('/home');
exit;
sub wanted {
/^hosting$/ && print("$name\n");
}


The find2perl-generated code is fairly straightforward. It loads in the necessary find.pl library with a require statement, then calls the subroutine &find( ) with the name of the starting directory. Before we begin our modifications of this code, it's important to note a few things that may not be obvious just by looking at the sample output above:
• The folks who have worked on the File::Find module have gone to considerable trouble to make this module portable across platforms. File::Find's internal routines work behind the scenes so the same Perl code for filesystem walking works for Unix, MacOS, NT, VMS, and so on.
• Though the code find2perl generates looks like Perl Version 4 code on the surface (for example, it uses require to load a .pl file), find.pl actually sets up some Perl Version 5 aliases for the user. In general, it is useful to look under the hood whenever you use a module in your code. If you need to find the Perl source for a module already installed on your system, running either perl -V or the following code will show you the standard library directories for your installation:
%perl -e 'print join("\n",@INC,"")'

The find2perl-generated code is fairly straightforward. It loads in the necessary find.pl library with a require statement, then calls the subroutine &find( ) with the name of the starting directory. We'll discuss the purpose of the &wanted( ) subroutine in a moment, since that's where all of the interesting modifications we're about to explore will live. Before we begin our modifications of this code, it's important to note a few things that may not be obvious just by looking at the sample output above:

• The folks who have worked on the File::Find module have gone to considerable trouble to make this module portable across platforms. File::Find's internal routines work behind the scenes so the same Perl code for filesystem walking works for Unix, MacOS, NT, VMS, and so on.

• Though the code find2perl generates looks like Perl Version 4 code on the surface (for example, it uses require to load a .pl file), find.pl actually sets up some Perl Version 5 aliases for the user. In general, it is useful to look under the hood whenever you use a module in your code. If you need to find the Perl source for a module already installed on your system, running either perl -V or the following code will
show you the standard library directories for your installation:

%perl -e 'print join("\n",@INC,"")'

More on Perl coming soon!

Posted on: 27/07/2009

Back to Home page