base_16 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w ##base16's cddb script %title=(); sysopen(FILEDATA, "$ARGV[0]", O_RDWR) or die "no input"; flock(FILEDATA, 2); while (<FILEDATA>) { $match = <FILEDATA>; if ($match =~ /^TTITLE(\d+)=(.+)$/) { $title{$1} = $2; } } while ( ($key, $value) = each %title) { print $key, '-', $value, "\n"; } close(FILEDATA);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: regexps and hashes
by lhoward (Vicar) on May 15, 2000 at 21:44 UTC | |
by Vane (Novice) on May 15, 2000 at 22:35 UTC | |
by base_16 (Beadle) on May 15, 2000 at 21:47 UTC | |
|
RE: regexps and hashes
by turnstep (Parson) on May 16, 2000 at 19:15 UTC |