#!/usr/bin/perl -w

$count=0; 
&count("/home/bobbo/perl/");
print "Number of files =".$count."\n";
sub count
{
	my $d=shift;
	my @l=split(" ",`cd $d;echo *`);
	for (@l)
	{
		if (-f $d.$_) { $count++; }
		if (-d $d.$_) { count($d.$_."/"); }
	}
}
