neniro has asked for the wisdom of the Perl Monks concerning the following question:
It works as expected - on a Windows-system it just warns that there is no chgrp-command. Is there a better way to do this? I searched on CPAN for 'chgrp' but I found nothing.#!/usr/bin/perl use strict; use warnings; my $group = 'users'; my @folder = qw ( worksheets correspondence ); &chgrp($group, \@folder); sub chgrp { my ($group, $folder) = @_; eval { system( "chgrp $group @$folder" ) }; warn $@ if $@; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to chgrp in perl?
by PodMaster (Abbot) on Apr 04, 2004 at 10:56 UTC | |
by neniro (Priest) on Apr 04, 2004 at 11:52 UTC | |
by Aragorn (Curate) on Apr 04, 2004 at 13:58 UTC | |
by neniro (Priest) on Apr 04, 2004 at 14:19 UTC | |
|
Re: How to chgrp in perl?
by borisz (Canon) on Apr 04, 2004 at 13:54 UTC | |
|
Re: How to chgrp in perl?
by Vautrin (Hermit) on Apr 05, 2004 at 05:00 UTC | |
|
Re: How to chgrp in perl?
by Abigail-II (Bishop) on Apr 05, 2004 at 09:20 UTC | |
by neniro (Priest) on Apr 05, 2004 at 15:03 UTC |