Print the current directory using perl

Hi I have this code to print the current directory using Perl

use Cwd qw(abs_path);
my $path = abs_path($0);
print "$path\n";

But it is displaying my perl source code file along with the directory.

like this

C:\Perl\duration.pl

But I want it only to display this "C:\Perl\"

Any clues ? I know this is a easy one. But I am a newbie..

dirname