Skip to content

Instantly share code, notes, and snippets.

$ # 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
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:
$ sh
$ . kkk
.: Can't open kkk: No such file or directory
$ touch kkk
$ . kkk
$ uname -r
7.0-20080303-SNAP
$ # WTF???