George_Sherston has asked for the wisdom of the Perl Monks concerning the following question:
Thanks to all,#!/usr/bin/perl -w use strict; use CGI qw(:standard); print header, start_html( -title=>'CHMOD UTILITY' ); &do_chmod if param; &send_form; sub do_chmod { for (param('Dirs')) { my @files; push @files, $_ while <$_*.p*>; if (chmod param('Action'), @files) { print "Changed permissions on " . join(" ; ",@files) . " t +o " . param('Action') . "<BR>"; } else { print "Could not change permissions on " . join(" ; ",@fil +es) . " to " . param('Action') . "<BR>"; } } print "DONE"; } sub send_form { my @dirs; push @dirs, $_ while <../*/>; print startform( -name=>'mainform', -method=>'POST', -action=>'chmod.pl', ), checkbox_group( 'Dirs', [@dirs], [], 1, ), submit( -name=>'Action', -value=>'0755', ), submit( -name=>'Action', -value=>'0644', ), endform, end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ongoing chmod lack of success
by tommyw (Hermit) on Oct 06, 2001 at 21:26 UTC | |
|
Final Update: Re: Ongoing chmod lack of success
by George_Sherston (Vicar) on Oct 06, 2001 at 21:52 UTC | |
by tommyw (Hermit) on Oct 06, 2001 at 23:29 UTC | |
|
Re: Ongoing chmod lack of success
by lemming (Priest) on Oct 06, 2001 at 21:27 UTC |