#!/usr/bin/perl -w -i.orig use strict; my $PERL_PATH ='#!/usr/local/bin/perl -w'; my $DATE_GENERATED = (localtime(time)); if (!$ARGV[0]) { usage(); } my $SCRIPT_TO_POD = $ARGV[0]; while (<>) { ## line number is one if ($. == 1) { if (/^#\!/) { $PERL_PATH = $_; } print <<"END"; $PERL_PATH #------------------------------------------------------------------------------- =pod =head1 NAME B<$SCRIPT_TO_POD> =head1 SYNOPSIS B<$SCRIPT_TO_POD> does blah =head1 DESCRIPTION B<$SCRIPT_TO_POD> =head OPTIONS =cut #------------------------------------------------------------------------------- END } elsif (eof) { print; ## double quotes here doc -- interpolate vars print <<"END"; #------------------------------------------------------------------------------- =head1 AUTHOR Lucy Newman Pod template generated on: $DATE_GENERATED =head1 SEE ALSO L =cut #------------------------------------------------------------------------------- END } else { print; } } sub usage { print "Usage: $0 name/of/file/to/inline/pod.pl\n"; exit 1; }