sam wrote: > Hello everyone! This is my first time posting anywhere about perl, so > be gentle. Let me start off with my script: > > #!/usr/local/bin/perl > #Author: Sam Ganim 10/26/07 > > print "What Lesson are you on? "; > chop($lesson = <STDIN>); > > print "How many exercises are there? "; > chop($exercises = <STDIN>); > > #print "What is the date today?(MM/DD/YY) "; > #chop($date = <STDIN>); > > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > localtime(time); > $year += 1900; > $year = sprintf("%02d", $year % 100); > > $date = ++$mon ."/" .$mday ."/" .$year; > > umask 0022; > It appears as though this umask function serves to only block against particular permissions rather than allowing for setting full permissions. Since the x bit generally wouldn't be a default (at least on a regular file), it's not being affected. Look into the default permissions of the underlying directory, or the mode options of the mkdir or syspoen Perl functions. > while ($exercises > 0) > { > open EXERCISE, ">exercise" .$lesson ."_" .$exercises .".pl"; > print EXERCISE "#!/usr/local/bin/perl\n#Author: Sam Ganim " .$date > ."\n#perltutor Lesson " ."$lesson " ."Exercise " > .$exercises ."\n"; > $exercises = --$exercises; > } > > > The problem I'm having is that the permissions on the files being > created are 644 and not 755. I know it has something to do with octals > but I'm not sure what else. Any help either solving the problem or > steering me in the right direction would be greatly appreciated. > >
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/