First ... Back ... Next ... Last ... (Notes home)

Output Formatting

Perl output formats can be beneficial for output reports, but probably is not very widely used.

  • The concept: attach an output "mask" with an output handle. Fit variables into that mask, for neatly aligned output.
  • Format example
    my $ip="192.2.1.1"; my $get="/htdocs";
    
    format STDOUT =
    @<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $ip,             $get
    .
    
    write;
    
  • man perlform more (though it's the same as the book)

First ... Back ... Next ... Last ... (Notes home)

UAF Computer Science
Prof. Greg Newby