New to PERL so I'm suppose to create a script that processes the data (name and number of hours worked during the month) submitted using an online form.The script calculates the number of weeks, days, and hours worked during the month, then displays the form data and the results of the calculations.
I keep getting this compilation error -
"Can't modify division (/) in scalar assignment near $weeks"
Here's my code:
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
$query = new CGI;
my $name; #Employee's name
my $hours; #Hours Worked per month
#Read the user's form input
$name = $query->param('name');
$hours = $query->param('hrs');
$hours /40 = $weeks;
$remainder = ($hours % 40);
($remainder / 8) = $days;
($remainder / 5) = $hour;
#HTML response to user
print "Hello, $name.n";
print "You have entered a total of $hours work hours.n";
print "For this month, you have worked $weeks week/s, $days days, and $hour hours.n";
The key to this solution is in the calculations to determine the weeks, days, and hours that the given number of worked hours represents. The following code is where ...
The solution assists in creating a script that processes the data submitted using an online form.
Write separate Perl scripts for given file processing requirements.
Write separate Perl scripts for each of the given requirements. Mentioned input data files are attached with this posting. In each case command to run the script from the command line should look like:
COMMAND_PROMPT> script_number.pl input_data_file.txt
 A script script_1.pl that replaces each instance of "th" with "TH" in file part1.txt. The script should print the file to the screen, not just the replaced lines.
 A script script_2.pl to look for lines in the file part2.txt containing a period, question mark, or comma at the end of the line. When these lines are found, print only the part of the line that occurs after the word "it" (case insensitive).
 A script script_3.pl that prints only words (not the entire line) in the file part3.txt on a word boundary that have the letter "p" or "P" in them (i.e. words begin/end with P/p).View Full Posting Details