Perl

Menu

Wednesday, November 28, 2007
As noted in class, Homework 7 is available. It is due on Friday, December 7, 2007. There is no late allowance for this final homework.
ICA11 has been graded
A number of people attempted (unsuccessfully) to pass one or more variables to the subroutine that did the calculation. First off, and the reason I didn't make this feature overly explicit - there's no need to do that. The variables are already file-scoped. The subroutine already has access to them. Creating copies by passing arguments that don't need to be passed is wasteful and inefficient.
However, the reason most people's attempts failed is that that they were passing the values those variables had at the time of the widget's creation. For example,
my ($foo, $bar) = (5, 10);
my $btn = $mw->Button(-command=>[\&fctn, $foo, $bar]);
will pass 5 and 10 to fctn() every time the button is clicked, regardless of what the values of $foo and $bar are at that time.
If you want to be able to access the real-time value of a variable, you're going to need to pass a reference instead, and dereference it inside the subroutine:
my ($foo, $bar) = (5, 10);
my $btn = $mw->Button(-command=>[\&fctn, \$foo, \$bar]);
# . . . 
sub foo {
  my ($foo_ref, $bar_ref) = @_;
  my $f = ${$foo_ref};
  my $b = ${$bar_ref};
  # . . . 
}
This is no different than creating a string involving two variables and expecting the string to change whenever the variables do:
my $string = "I have $foo and $bar";  # I have 5 and 10
$foo = 'alpha';
$bar = 99.44;
# $string is still "I have 5 and 10";
Please let me know if you have any questions on this.
Sunday, November 25, 2007
I am finally caught up on all the HW grading. All HW4s and HW5s have been graded. Any questions or comments about your grade, please let me know. If you haven't received either or both grades, email me ASAP.
Wednesday, November 14, 2007
Homework 6 is now available. It is due in two weeks, on Tuesday, November 27, 2007.
Wednesday, November 7, 2007
I will be on vacation from this Saturday through next Tuesday. That means I will be unable to hold office hours Monday and Tuesday. With that in mind, Homework 5's duedate is hereby extended to Friday, November 16, 2007 at 11:59:59pm. If you wish to meet with me in person either Wednesday, Thursday, or Friday, please email me. The TA's will hold their normal office hours next week.
Thursday, October 25, 2007
Several people seem to have misunderstood the slide about strftime. I agree it was a bit ambiguous. I have updated the slides accordignly. Please ask us if you have questions.
Wednesday, October 24, 2007
Homework 5 has now been posted. It is due in three weeks, on Tuesday, November 13, 2007. Keep in mind HW4 is due the previous week, Tuesday, November 6, 2007.
Sunday, October 21, 2007
I've removed the requirement for the overloaded += operator in the Tenant class. I'd forgotten that this operator involves creating a copy constructor for the = operator as well, which we did not cover. The five points for this task have been distributed to the Tenant constructor and the available() method.
Friday, October 19, 2007
I've made a very small addition to HW4. The Landlord class needs a name() accessor to return the name of the Landlord.
Thursday, October 18, 2007
I have finished correcting ICA7. I strongly suggest you take a look at the sample solution online, and email us if you have any questions.
Tuesday, October 16, 2007
Homework 4 is now available, on the Homeworks page. Please make sure you pay special attention to the duedates of HW4 and HW5.
Wednesday, October 10, 2007
When submitting homework 3, Please submit a data file in addition to your code. The data file should contain at least three courses with meeting times, and at least two assignments for at least one course.
Tuesday, October 9, 2007
Homework 2 has been graded. Please let me know if you have any quetions or concerns about your grade.
Wednesday, October 3, 2007
Homework 3 has been posted. Please let us know if you have any questions regarding it.
Thursday, September 27, 2007
At your earliest convenience (and certainly before submitting HW2), please log on to the Unix machines and read: perldoc -q quoting. Thank you.
Wednesday, September 26, 2007
IC4 has been graded. Please make sure you click your ICA total on the Check Grades page to view my comments, if any. I've also added an explanation of my solution to the bonus as comments in my solution file.
Several new topics have been added to the Debugging page. I suggest you give it a look.
Grading for HW1 will begin tonight. No, really! You will receive an email when your grade has been recorded.
Wednesday, September 19, 2007
My Solution to HW1 is now available. Please take a look at it and email us if you have any questions.
HW2 has been posted. If you have any questions about it, please email us.
Friday, September 7, 2007
HW1 Part B has now been posted.
Wednesday, September 5, 2007
Part A of Homework 1 has now been posted. Part B (which requires information from next week's lecture) will be posted later this week.
Wednesday, August 29, 2007
The Check Grades link is not yet functional. It will be active after ICA0 is corrected next week. All other parts of the course website should be ready to go. Please let me know if you find a broken link.
Thursday, August 23, 2007
Welcome to Programming in Perl's Fall07 course webpage. Before the end of the first class, please fill out This Signup Form. This will add you to the course grading sheet and mailing list. The password you choose will be used for checking your grades and submitting the assignments.
You will need your laptop computers in every class of this course. While it will be technically optional for the first class, it is strongly suggested. We will cover connecting to your RCS accounts, editing a file in Unix, and starting the perl interpreter.
Perl Quotes
Perl Quotes