mptc -- Mobile Phone Tariff Calculator


I knocked up this program to figure out if I could save money on mobile (cell) phone bills. Turns out I could -- about 15 UK pounds every month ... quite handy for a poor student!

To use it, you feed it a copy of one of your itemised phone bills as a plain text file in a very simple format, together with a tariff file for the tariff you're currently being charged on, and a tariff file for each tariff which you're considering switching to. (A tariff file is another plain text file, again in a very simple format, describing all the characteristics of a tariff, such as cost per minute for different categories of call, how much you get in free calls each month, cost of sending SMS messages, which times of the week are considered peak or off-peak etc.) It will then recalculate your entire bill for each of the tariffs you're considering switching to, so you can see whether you would have saved money by being on that tariff instead.



As I wrote it mainly for me, it's currently geared towards UK mobile phone network tariffs with monthly line rentals. It does not support the `pay as you go' or `pay for a whole year in one go' schemes, but those schemes tend rip you off anyway unless you're hardly making any calls, in which case you don't need this program anyway.

It served the purpose I wrote it for (to advise me which network and tariff to switch to), and because I have a lot of other things to do, taking the time to make it useful for other people has taken a back seat. Hence although the software seems to work fine for me, it should be considered as alpha software. It is full of rough edges, so unless you have a small amount of expertise in computer languages in general, there is no guarantee you'll find it useful. There's no guarantee even if you're Larry Wall, but you know what I mean.

However, there should be enough functionality in there that given someone with sufficient Perl skills and interest, it could easily be adapted to be suited for use in other countries, and maybe even turned into a polished product. I haven't the time or motivation to do this myself, so I'm hoping that other people will chip in.

How do I use it?

Unfortunately I don't have time to produce full documentation, so here's a brief introduction:

I want to help!

Great! Read through the source and get hacking. Here are some of the things you could do:

It should be fairly clear how everything works, but if something puzzles you, ask me about it and I'll do what I can to help. If you've made some changes to the code, please send them to me in unified diff format for inclusion in the next release.

Browser independent HTML! Valid CSS! Valid HTML 4.0!

Last updated: Sat Nov 1 22:37:39 2003
© 1995-2003 Adam Spiers <>