#!/usr/bin/perl use strict; use warnings; my @Project = ; chomp (@Project); # chomp is a little more selective than chop! It removes $/ my $width = 80; my $heading; for (@Project) { if (/(SECTION\s\d+.*)/) { print ' ' x (($width-length($1))/2); # Center the heading } print "$_\n"; } __DATA__ ============================================================================= SECTION 35 - BUILDING VIM FROM SOURCE 35.1. How do I build Vim from the sources on a Unix system? For a Unix system, follow these steps to build Vim from the sources: - Download the source and run-time filles archive (vim-##.tar.bz2) from the ftp://ftp.vim.org/pub/vim/unix directory. - Extract the archive using the bzip2 and tar utilities using the command: $ bunzip2 -c | tar -xf - #### ============================================================================= SECTION 35 - BUILDING VIM FROM SOURCE 35.1. How do I build Vim from the sources on a Unix system? For a Unix system, follow these steps to build Vim from the sources: - Download the source and run-time filles archive (vim-##.tar.bz2) from the ftp://ftp.vim.org/pub/vim/unix directory. - Extract the archive using the bzip2 and tar utilities using the command: $ bunzip2 -c | tar -xf -