This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sh | |
$ . kkk | |
.: Can't open kkk: No such file or directory | |
$ touch kkk | |
$ . kkk | |
$ uname -r | |
7.0-20080303-SNAP | |
$ # WTF??? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def all_import(module_name, into): | |
"""The simple 'from module_name import *' function. | |
Usage: | |
all_import('os', globals()) | |
all_import('os', locals()) | |
""" | |
module = __import__(module_name) | |
names = getattr(module, '__all__', dir(module)) | |
for name in names: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # first try | |
$ perl --version | grep v5 | |
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi | |
$ perl -MURI::Escape -E'say uri_escape_utf8 shift' "1&2" | |
$ perl -MURI::Escape -E'print uri_escape_utf8 shift' "1&2" | |
$ # wtf? | |
$ # another box | |
$ perl --version | grep v5 | |
This is perl, v5.8.8 built for amd64-freebsd |