#!/usr/bin/perl -w use strict; my $width = 80; my $format = '@'. ('|' x $width) . "\n"; # Print a centred line using the format # formline($format, "This text is centred."); print $^A; # Print the accumulator $^A = ''; # Clear the accumulator # Print some centred lines using the format # my @a = qw(A hat often beckons snowballs); formline($format x @a, @a); print $^A; # Print the accumulator $^A = ''; # Clear the accumulator __END__ Here is the output: This text is centred. A hat often beckons snowballs