in reply to Re^4: = rather than =~ ? (too brief?)
in thread = rather than =~ ?
This if 0 hack has been known for a long time and might even be useful if it weren't such a dirty trick. An actual condition in that place nearly certainly means that someone is going to be very surprised.use strict; use warnings; sub remember { my $memory if 0; print "Previous value of \$memory: $memory\n"; $memory = shift; } remember "foo"; remember 42; remember "bar"; remember; __END__ Use of uninitialized value in concatenation (.) or string at - line 6. Previous value of $memory: Previous value of $memory: foo Previous value of $memory: 42 Previous value of $memory: bar
Makeshifts last the longest.
|
|---|