Use 'test -f', not 'test -x'
[perl.git] / keywords.pl
1 #!/usr/bin/perl
2
3 unlink "keywords.h";
4 open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n";
5 select KW;
6
7 # Read & print data.
8
9 $keynum = 0;
10 while (<DATA>) {
11     chop;
12     next unless $_;
13     next if /^#/;
14     ($keyword) = split;
15     print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
16 }
17
18 ###########################################################################
19 sub tab {
20     local($l, $t) = @_;
21     $t .= "\t" x ($l - (length($t) + 1) / 8);
22     $t;
23 }
24 ###########################################################################
25 __END__
26
27 NULL
28 __LINE__
29 __FILE__
30 __DATA__
31 __END__
32 AUTOLOAD
33 BEGIN
34 CORE
35 DESTROY
36 END
37 EQ
38 GE
39 GT
40 LE
41 LT
42 NE
43 abs
44 accept
45 alarm
46 and
47 atan2
48 bind
49 binmode
50 bless
51 caller
52 chdir
53 chmod
54 chomp
55 chop
56 chown
57 chr
58 chroot
59 close
60 closedir
61 cmp
62 connect
63 continue
64 cos
65 crypt
66 dbmclose
67 dbmopen
68 defined
69 delete
70 die
71 do
72 dump
73 each
74 else
75 elsif
76 endgrent
77 endhostent
78 endnetent
79 endprotoent
80 endpwent
81 endservent
82 eof
83 eq
84 eval
85 exec
86 exists
87 exit
88 exp
89 fcntl
90 fileno
91 flock
92 for
93 foreach
94 fork
95 format
96 formline
97 ge
98 getc
99 getgrent
100 getgrgid
101 getgrnam
102 gethostbyaddr
103 gethostbyname
104 gethostent
105 getlogin
106 getnetbyaddr
107 getnetbyname
108 getnetent
109 getpeername
110 getpgrp
111 getppid
112 getpriority
113 getprotobyname
114 getprotobynumber
115 getprotoent
116 getpwent
117 getpwnam
118 getpwuid
119 getservbyname
120 getservbyport
121 getservent
122 getsockname
123 getsockopt
124 glob
125 gmtime
126 goto
127 grep
128 gt
129 hex
130 if
131 index
132 int
133 ioctl
134 join
135 keys
136 kill
137 last
138 lc
139 lcfirst
140 le
141 length
142 link
143 listen
144 local
145 localtime
146 log
147 lstat
148 lt
149 m
150 map
151 mkdir
152 msgctl
153 msgget
154 msgrcv
155 msgsnd
156 my
157 ne
158 next
159 no
160 not
161 oct
162 open
163 opendir
164 or
165 ord
166 pack
167 package
168 pipe
169 pop
170 pos
171 print
172 printf
173 prototype
174 push
175 q
176 qq
177 quotemeta
178 qw
179 qx
180 rand
181 read
182 readdir
183 readline
184 readlink
185 readpipe
186 recv
187 redo
188 ref
189 rename
190 require
191 reset
192 return
193 reverse
194 rewinddir
195 rindex
196 rmdir
197 s
198 scalar
199 seek
200 seekdir
201 select
202 semctl
203 semget
204 semop
205 send
206 setgrent
207 sethostent
208 setnetent
209 setpgrp
210 setpriority
211 setprotoent
212 setpwent
213 setservent
214 setsockopt
215 shift
216 shmctl
217 shmget
218 shmread
219 shmwrite
220 shutdown
221 sin
222 sleep
223 socket
224 socketpair
225 sort
226 splice
227 split
228 sprintf
229 sqrt
230 srand
231 stat
232 study
233 sub
234 substr
235 symlink
236 syscall
237 sysopen
238 sysread
239 system
240 syswrite
241 tell
242 telldir
243 tie
244 tied
245 time
246 times
247 tr
248 truncate
249 uc
250 ucfirst
251 umask
252 undef
253 unless
254 unlink
255 unpack
256 unshift
257 untie
258 until
259 use
260 utime
261 values
262 vec
263 wait
264 waitpid
265 wantarray
266 warn
267 while
268 write
269 x
270 xor
271 y