PERL chown Function



Definition and Usage

Changes the owner (and group) of a list of files. The first two elements of the list must be the numeric uid and gid, in that order. This funcation call works in similar way as unix commandchown. Thus you should have sufficient privilege to change the permission of the file.

Return Value

  • Returns the number of files successfully changed.


Here is an example which will change ownership for the given number of files.

$cnt = chown $uid, $gid, 'foo', 'bar';
chown $uid, $gid, @filenames;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s