[VPM] Printing one line over several lines

Peter Scott peter at PSDT.com
Thu Mar 27 15:49:20 CST 2003


At 12:15 PM 3/27/2003 -0800, Carl B. Constantine wrote:
>*On Thu Mar 27, 2003 at 11:58:48AM -0800, Carl B. Constantine 
>(cconstan at csc.UVic.CA) wrote:
> > > Probably a syntax error on an immediately preceding line.
> >
> > nope. I put this code at the end of the file in a new subroutine like
> > so:
> >
> > sub newHeader {
> >  my @split_names = map split_name($_), @allPrinters;
> >  for (my $line = 0; grep $split_names[$_][$line] => 
> 0..$#allPrinters; $line++) {
> >     my $begin = $line ? "              " : "Student Login ";
> >     print $begin, map(col_fmt($_, $line, $split_names[$line]) => 0 
> .. $#allPrinters), "\n";
> >   }
> > }
>
>did a little more digging.
>
> > I just moved it to "global" scope and do not get any errors, but I also
> > do not get printer names either.
>
>it does need to be global scope as it's referenced in the col_fmt
>routine. However it does not print the printer names at all.

Well this illustrates the problem in trying to do development on a 
program when all you have is a fragment :-)  Take my input as a 
suggested approach but not necessarily something you can drop straight 
in to whatever you've got.


-- 
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/




More information about the Victoria-pm mailing list