Anyway, here's the code:
Code: Select all
#!/usr/bin/perl
my $file = shift;
my $cpw = shift || 10; #The number represents default price per word
@_ = split(/ /,`wc $file -w`);
my $count = $_[0];
my $fr = $count * $cpw; #You can change these:
my $un = $fr * 3/4; #Price for unique content (Default: 3/4 fullrights)
my $us = $fr * 1/3; #Price for use (Default 1/3 fullrights)
print "$count WORDS\n";
print "Fullrights: ".price($fr);
print "\t-> ".price($fr * .65)."\n";
print "Unique: ".price($un);
print "\t-> ".price($un * .65)."\n";
print "Use: ".price($us);
print "\t-> ".price($us * .65)."\n";
print "\n";
sub price {
my $cents = shift;
my $dollars = int($cents / 100);
$cents = $cents % 100;
return "\$$dollars.$cents";
}