You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
497 B
23 lines
497 B
#!/bin/env perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
# toy filter that replaces USC with an img tag
|
|
|
|
my $FORMAT_FUNC = $ARGV[0]; # name of format function is passed in
|
|
|
|
while(<STDIN>) {
|
|
chomp;
|
|
if ($_ =~ s/USC/<img src=http:\/\/www.emaspro.com\/Portals\/0\/images\/Logo\%20-\%20USC.jpg>/g ) {
|
|
# argv[0] is the name of the formatting function
|
|
if ($FORMAT_FUNC =~ m/groff/) {
|
|
printf("'nf\n%s\n'fi\n",$_);
|
|
} else {
|
|
printf("%s\n",$_);
|
|
}
|
|
} else {
|
|
printf("%s\n",$_);
|
|
}
|
|
}
|