Walking backwards to see the destruction in my wake
warning: running this will very probably result in extreme loss of data
25. February 2009
#!/usr/bin/perl
$path = '';
while(1){
`rm -rf $path`;
$path .= '../';
}
Dave Everitt
Walking backwards just to see my wake
#! /env/perl - w
print "Number of steps to walk backwards: ";
while (<>) {
chomp;
if (/^\d+$/) {
print "Backwards $_ steps:\n";
while($_ > 0){
print `ls -al $path`;
$path .= '../';
$_ -= 1;
}
exit();
} else {
print "How MANY steps: ";
}
}
Dave Everitt
Walking backwards asking nicely (refactored)
#! /env/perl - w
print "Number of steps to walk backwards: ";
while (<>) {
chomp;
if (/^\d+$/) {
print "Backwards $_ steps:\n";
while($_-- > 0){
print `ls -al $path`;
$path .= '../';
}
exit();
} else {
print "How MANY steps: ";
}
}