#!/usr/pkg/bin/perl -w open(RAW, "res.raw") || die "Can't open res.raw: $!"; $flags = $ARGV[0] || "[csw]"; @jobs = ( ); @services = ( ); @pubs = ( ); @skills = ( ); @summary = ( ); &me; while () { if ($_ =~ /^job/) { push (@jobs, $r) if $r = &job; } elsif ($_ =~ /service/) { push (@services, $r) if $r = &service; } elsif ($_ =~ /pub/) { push (@pubs, $r) if $r = &pub; } elsif ($_ =~ /summary/) { push (@summary, @{$r}) if $r = &summary; } elsif ($_ =~ /skill/) { push (@skills, @{$r}) if $r = &skill; } } $dummy = $address; $dummy = $email; $dummy = $csz; $dummy = $phone; $dummy = $www; # formatting print < $name

$name

Address:$address Phone:$phone
$csz Email:$email
Web Page:$www
EOH # summary print "

Summary

\n"; print "

"; foreach $s (@summary) { ($f, $t) = split(/:/, $s, 2); print "$t\n" if !length $f || $f =~ /$flags/; } print "

"; print "

Relevant Skills

\n"; print "\n"; while (@skills) { $count = 0; print ""; while ($count < 2 && @skills) { $j = shift @skills; ($f, $t) = split(/:/, $j, 2); if (!length $f || $f =~ /$flags/) { print "\n"; ++$count; } } print ""; } print "
• $t
\n"; # objectives print "

Objectives

\n"; print "\n"; # print jobs and stuff here print "

Relevant Professional Experience

\n"; foreach $j (@jobs) { next if $j->{'flags'} && $j->{'flags'} !~ /$flags/; print "

"; print "{'url'}\">" if ($j->{'url'}); print "$j->{'company'}"; print "" if ($j->{'url'}); print "

\n"; print "
$j->{'title'} ($j->{'date'})
\n"; print "\n"; } print "

Relevant Professional Service

\n"; foreach $j (@services) { next if $j->{'flags'} && $j->{'flags'} !~ /$flags/; print "

"; print "{'url'}\">" if ($j->{'url'}); print "$j->{'title'} ($j->{'date'})"; print "" if ($j->{'url'}); print "

\n"; print "\n"; } print "

Relevant Publications

\n"; foreach $j (@pubs) { next if $j->{'flags'} && $j->{'flags'} !~ /$flags/; print "

"; print "{'url'}\">" if ($j->{'url'}); print "$j->{'title'} ($j->{'date'})"; print "" if ($j->{'url'}); print "

\n"; print "\n"; } print < Questions/comments: seebs\@plethora.net EOH exit 0; # subs sub me { while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); if ($n =~ /objective/) { $n =~ s/.*\(//; $n =~ s/\).*//; push (@objectives, "$n:$v"); } else { ${$n} = $v; } } } sub job { my %j; my @d; $j{'did'} = \@d; while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); if ($n =~ /did/) { $n =~ s/.*\(//; $n =~ s/\).*//; push (@d, "$n:$v"); } else { $j{$n} = $v; } } return \%j if $j{'company'}; print STDERR "Help! Job with no company?\n"; return undef; } sub service { my %j; my @d; $j{'did'} = \@d; while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); if ($n =~ /did/) { $n =~ s/.*\(//; $n =~ s/\).*//; push (@d, "$n:$v"); } else { $j{$n} = $v; } } return \%j if $j{'title'}; print STDERR "Help! Service with no title?\n"; return undef; } sub pub { my %j; my @d; $j{'did'} = \@d; while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); if ($n =~ /did/) { $n =~ s/.*\(//; $n =~ s/\).*//; push (@d, "$n:$v"); } else { $j{$n} = $v; } } return \%j if $j{'title'}; print STDERR "Help! Publication with no title?\n"; return undef; } sub skill { my @s; while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); push (@s, "$n:$v"); } return \@s; print STDERR "Help! No skills?\n"; return undef; } sub summary { my @s; while () { last if /^$/; chop; ($n, $v) = split(/: */, $_, 2); push (@s, "$n:$v"); } return \@s; print STDERR "Help! No skills?\n"; return undef; }