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;

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/


Reply via email to