The hardest part to this is calculating the day of the week. There are a ton of modules out there that can help with that, in this instance I chose DateTime.
After that it's just a basic array index operation to determine the days of the week that you want to display.
my $start_date = '2011-05-18'; # that's a wednesday
my @days_of_week = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);
my ($y, $m, $d) = split '-', $start_date;
my $dow = DateTime->new(year => $y, month => $m, day => $d)->dow();
print "$dow\n"; # Prints 3.
print join(',', @days_of_week[$dow..6]), "\n";
print join(',', @days_of_week[0..$dow-1]), "\n" if $dow > 0;