Detecting the current directory
#!/usr/bin/perl -w use Cwd; $dir = getcwd(); print "Current directory is:\n"; print "$dir\n";