#
# subs.pl
# Joel Uckelman (uckelman@nomic.net)
# 1 March 2001
#

#
# read_file: Reads the contents of a file, returns it as a string.
#
sub read_file ($) {
	my ($file) = @_;
	open FILE, "<$file" or die "\n$prog: $file: $!\n";
	my $data = join '', <FILE>;
	close FILE;
	return $data;
}

#
# write_file: Writes a string to a file.
#
sub write_file ($$) {
	my ($file, $data) = @_;
	open OUT, ">$file" or die "\n$prog: $file: $!";
	print OUT $data;
	close OUT;
	return 1;
}

# Do not remove the last line. File must return true.
1
