projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e024fc4
)
Convert script to strict mode
author
Joey Schulze
<joey@infodrom.org>
Sun, 29 Apr 2018 17:00:45 +0000
(19:00 +0200)
committer
Joey Schulze
<joey@infodrom.org>
Sun, 29 Apr 2018 17:00:45 +0000
(19:00 +0200)
bin/wmldepend.pl
patch
|
blob
|
history
diff --git
a/bin/wmldepend.pl
b/bin/wmldepend.pl
index
3c7dc5a
..
4b6926a
100755
(executable)
--- a/
bin/wmldepend.pl
+++ b/
bin/wmldepend.pl
@@
-1,7
+1,10
@@
#! /usr/bin/perl
#! /usr/bin/perl
-$INCPATH = "";
-$FILES = "";
+use strict;
+use warnings;
+
+my @INCPATH;
+my @FILES;
# expandfile() {
# for i in $INCPATH
# expandfile() {
# for i in $INCPATH
@@
-23,6
+26,7
@@
sub expandfile
my $f = shift;
my %var = @_;
my $p;
my $f = shift;
my %var = @_;
my $p;
+ my $pivot;
if ($f =~ m,\$\((.*)\),) {
$pivot = $1;
if ($f =~ m,\$\((.*)\),) {
$pivot = $1;
@@
-75,7
+79,7
@@
sub findincludes
# Argument parsing
#
# Argument parsing
#
-while ($foo = shift (@ARGV)) {
+while (
my
$foo = shift (@ARGV)) {
if ($foo =~ m,-I(.*),) {
push (@INCPATH, $1);
} else {
if ($foo =~ m,-I(.*),) {
push (@INCPATH, $1);
} else {
@@
-83,9
+87,9
@@
while ($foo = shift (@ARGV)) {
}
}
}
}
-
%var=()
;
-for $f (@FILES) {
- $foo = $f;
+
my %var
;
+for
each my
$f (@FILES) {
+
my
$foo = $f;
$foo =~ s/\.wml$/\.php/;
printf "%s: %s", $foo, $f;
findincludes ($f, %var);
$foo =~ s/\.wml$/\.php/;
printf "%s: %s", $foo, $f;
findincludes ($f, %var);