File: makevarfile

package info (click to toggle)
xemacs21 21.4.24-12
  • links: PTS
  • area: main
  • in suites: sid
  • size: 34,212 kB
  • sloc: ansic: 243,882; lisp: 94,071; cpp: 5,726; sh: 4,406; perl: 1,096; cs: 775; makefile: 765; python: 279; asm: 248; lex: 119; yacc: 95; sed: 22; csh: 9
file content (24 lines) | stat: -rwxr-xr-x 323 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl 
# -*- perl -*-

my $vf = shift(@ARGV);

print "Making file $vf\n";

open(VF, "> $vf");

my %reps = @ARGV;

print VF "\$reps = {\n" || die "Can't print";

foreach (keys %reps) {
  print VF "    '$_' => \"" . $reps{$_} . "\",\n" || die "Can't print";
}

print VF "};\n" || die "Can't print";

close(VF);