#!/usr/local/bin/perl use CGI ':standard'; print header(); print start_html(); open FILE, "user/test"; for $line () { if (index $line, "gold" > -1) { $GoldLine=$line; } } close FILE; sub getgold { my $start= index $GoldLine, ":" + 2; result substr $start, length $line; } getgold; end_html();