[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

raeburn raeburn at source.lon-capa.org
Fri Oct 12 09:48:08 EDT 2012


raeburn		Fri Oct 12 13:48:08 2012 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - For perl 5.16 use of deprecated defined(@array) generates warnings.
    - eliminate use.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.619 loncom/interface/lonprintout.pm:1.620
--- loncom/interface/lonprintout.pm:1.619	Mon Jun 11 11:07:33 2012
+++ loncom/interface/lonprintout.pm	Fri Oct 12 13:48:08 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.619 2012/06/11 11:07:33 foxr Exp $
+# $Id: lonprintout.pm,v 1.620 2012/10/12 13:48:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -582,14 +582,17 @@
 sub get_print_dates {
     my $res = shift;
     my $partsref = $res->parts();
-    my @parts   = @$partsref;
+    my @parts;
+    if (ref($partsref) eq 'ARRAY') {
+        @parts   = @{$partsref};
+    }
     my $open_date;
     my $close_date;
     my @open_dates;
     my @close_dates;
 
 
-    if (defined(@parts) && (scalar(@parts) > 0)) {
+    if (@parts) {
 	foreach my $part (@parts) {
 	    my $partopen  = $res->parmval('printstartdate', $part);
 	    my $partclose = $res->parmval('printenddate',  $part);
@@ -632,7 +635,7 @@
 
     # Don't bother looping over undefined or empty parts arraY;
 
-    if (defined(@parts) && (scalar(@parts) > 0)) {
+    if (@parts) {
 	foreach my $part (@parts) {
 	    my ($partopen, $partclose) = $navmap->course_printdates($res, $part);
 	    push(@open_dates, $partopen);
@@ -658,7 +661,7 @@
 
     # Don't bother looping over undefined or empty parts arraY;
 
-    if (defined(@parts) && (scalar(@parts) > 0)) {
+    if (@parts) {
 	foreach my $part (@parts) {
 	    my ($partopen, $partclose) = $navmap->map_printdates($res, $part);
 	    push(@open_dates, $partopen);




More information about the LON-CAPA-cvs mailing list