Chandrakant Reddy wrote:
Hi

Hello,

I wrote this simple script :

#!/usr/local/bin/perl

use strict ;
use warnings ;
use File::Stat ;

Is there a reason that you can't use the built-in stat function or the core module File::stat?



my $filename = "/tmp/cvr.txt" ;

my $stat = new File::Stat($filename) or die " No $filename : $! \n";

print " Dev = $stat->dev \n";
print " Inode = $stat->ino \n";
print " Mode = $stat->mode \n";
print "  Link = $stat->nlink \n";
print " Uid = $stat->uid \n";

 but the output is comming like this
---OUTPUT --

Dev = File::Stat=ARRAY(0x150a20)->dev
Inode = File::Stat=ARRAY(0x150a20)->ino
Mode = File::Stat=ARRAY(0x150a20)->mode
 Link = File::Stat=ARRAY(0x150a20)->nlink
Uid = File::Stat=ARRAY(0x150a20)->uid

what i want is actual values like what is the uid of the file ? .....
Thanks in advance :)


#!/usr/local/bin/perl

use strict;
use warnings;

my $filename = '/tmp/cvr.txt';

my ( $dev, $ino, $mode, $nlink, $uid ) = stat $filename;

print " Dev = $dev\n";
print " Inode = $ino\n";
print " Mode = $mode\n";
print "  Link = $nlink\n";
print " Uid = $uid\n";

__END__



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to