How do I get the dirname of a file with Perl?

Viewed 52697

In my perl script, I have the param $FILE=/etc/sysconfig/network

in which way (in perl) I can cut only the directory and put the directory in $DIR param

in order to get:

$DIR=/etc/sysconfig

(like dirname /etc/sysconfig/network in shell script)
3 Answers
Related