"You can't take the sky from me." ... hrmm ... We can get creative here.
- If one takes Buber's I and Thou literally, "you" would be anything outside the program. In the context of Perl, that would be STDIN, STDOUT, @ARGV, ... and %ENV. As the first 2 are filehandles and the third is an array, let's work with %ENV.
- "take" is going to be a keyword in Perl6, but we don't have that yet. So, let's think about taking ... when you take from me, that is the same as removing something from my possession. We could use any number of functions that "take", like substr, chop/chomp, etc. The problem is representing the negation of these.
- The iconic representation of the program is $0, so we'll use that for "me". Now, if we tie me, we can override FETCH.
- Sky ... look below.
package Me;
TIESCALAR { bless \(my $x = $_[1]), $_[0] }
FETCH { die "cannot take it away" }
package main;
tie $0, Me;
eval { $ENV{'you'} = $0 =~ s/sky//; 1 } || print $@;
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?