Compiler issue I think...

Use and complete the template provided. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    One problem says do the following problem using perl:
    A stamp dealer maintains a price list that displays the country, the Scott catalog number, year of issue, description, and price:

Sample entry:
Kenya 288-92 1984 Heron Plover Thrush gonolek Apalis $6.60

  1. Relevant commands, code, scripts, algorithms:
    This is what I have so far...
#!usr/bin/perl
#reads the lines from a file and formats the output and calculates a total price.

Open (FILEIN, "data.txt") || die ("Cannot open file");
ttlprc= 0;
while($in = <FILEIN>)
{
  ($con, $catnum, $yr, $str) =split (/\s/,$in, 4);
  $rts=reverse($str);
  ($prc, $desc) =split (/\s/, $rts, 2);
  print "Country: $con\n";
  print "Catagory Number: $catnum";
  print "Year: $yr";
  print "Description: $desc";
  print "Price: $prc";
  $ttlprc= $ttlprc + $prc ;
}

print "The total price is \$$ttlprc";


  1. The attempts at a solution (include all code and scripts):
    see above.

  2. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    University Maryland University College, Adelphi Maryland, CMIS 325A

Note: Without school/professor/course information, you will be banned if you post here!

I don't really want someone to "solve" this, I just can't get my complier to work.... if you could try to compile this and maybe suggest one... that would be great. If you notice any obvious reason why I can't get this to run (it's grayed out when I attempt to run it) that would be great :stuck_out_tongue:

Thanks!

What do you mean by "get my compiler to work"? Perl scripts usually aren't compiled like C programs. Or do you get a syntax error? Because I can see 3 definite syntax errors in the code you provided (all in the first 3 code lines). That, plus your total price will be way off (hint: if you reverse something, you'll have to reverse it again to be right again), and your output won't look like you'll expect it to look.