#!/usr/bin/env perl use warnings; use strict; $| = 1; use File::Basename qw(basename); use vars qw($ME $TODAY); use Resume (); # $Id$ # Andrew Ho (andrew@zeuscat.com) # We'll structure our individual formatting files containing the dispatch # table and subroutines so that two pre-defined variables containing the # generating program's name ($ME) and the current date ($TODAY) are # easily available. $ME = basename $0; my($day, $month, $year) = (localtime)[3..5]; $TODAY = sprintf '%s %d, %04d', (qw( January Feburary March April May June July August September October November December ))[$month], $day, $year + 1900; # Pull in dispatch table %DISPATCH and associated subroutines from # an include file, given at the command-line. Default to HTML. use vars qw(%DISPATCH); my $type = lc($ARGV[0]) || 'html'; eval { require "$type"; }; if($@ =~ /^Can't locate/i) { require "$type.pl"; } elsif($@) { die; } # That's it! See the documentation for Resume.pm, plus the individual # formatting files, for more information. my $parser = Resume->new(%DISPATCH); my $parsed = $parser->parsefile("./resume.xml"); $parsed =~ s/\s+$/\n/; print $parsed; exit 0;