require "stat.pl";

@ary = stat('foo');
$st_dev = @ary[$ST_DEV];
# or
&Stat('foo');
print "$st_dev\n";