chiark
/
gitweb
/
~mdw
/
distorted-bits
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
bdea49f
)
mkaptsrc: Perl's scoping for `my' variables is bobbins.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 30 Apr 2014 17:42:55 +0000
(18:42 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 30 Apr 2014 17:42:55 +0000
(18:42 +0100)
The scope for a `my' variable doesn't begin until the next statement,
which is obviously stupid.
mkaptsrc
patch
|
blob
|
blame
|
history
diff --git
a/mkaptsrc
b/mkaptsrc
index 684f96417359890433b00409c4a9b65d825518b5..b8da27045fb4ff30e1976d4729080a77511717c6 100755
(executable)
--- a/
mkaptsrc
+++ b/
mkaptsrc
@@
-327,7
+327,7
@@
for my $pair (@SUB) {
## Build an output line.
my $out = "";
- defined (my $opt = $a{options}) and $out .= "[ $opt ] ";
+ if (defined (my $opt = $a{options})) { $out .= "[ $opt ] "; }
$out .= "$a{uri} $a{release} $a{components}";
## Canonify whitespace.