Seventh has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use IO::File; use Data::Dumper; use Getopt::Long; open(DATA,"ccrutil.pl") or die $!; my $file ="ccrutil.html"; open FILE, ">$file" or die "unable to open $file $!"; print FILE "\<html\>\n"; # Build HTML header print FILE "\<title\>CCRUTIL.HTML\<\\title\>\n"; print FILE "\<body bgcolor\=\"black\"\>\n"; close FILE; my %functxt; while (<DATA>) { my $line = $_; chomp($line); if ($line =~ /^\#CCR/) { my ($functionName) = $line =~ /^\#CCR-(.*)/; my $desc = <DATA>; # pull the next line $functxt{$functionName} = $desc; } } foreach my $func (keys(%functxt)) { my $text = $functxt{$func}; my $file ="ccrutil.html"; open FILE, ">$file" or die "unable to open $file $!"; print FILE "\<b\>Function $func does $text\<\/b\>\n"; close FILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help needed with file output and hashes.
by Zaxo (Archbishop) on Oct 31, 2005 at 19:04 UTC | |
by Fletch (Bishop) on Oct 31, 2005 at 19:13 UTC | |
|
Re: Help needed with file output and hashes.
by BrowserUk (Patriarch) on Oct 31, 2005 at 19:08 UTC | |
|
Re: Help needed with file output and hashes.
by pg (Canon) on Oct 31, 2005 at 19:09 UTC | |
|
Re: Help needed with file output and hashes.
by jeffa (Bishop) on Oct 31, 2005 at 19:02 UTC | |
|
Re: Help needed with file output and hashes.
by Roy Johnson (Monsignor) on Oct 31, 2005 at 19:04 UTC | |
|
Re: Help needed with file output and hashes.
by graff (Chancellor) on Nov 01, 2005 at 05:39 UTC |