Skip to content

Instantly share code, notes, and snippets.

View ingydotnet's full-sized avatar

Ingy döt Net ingydotnet

View GitHub Profile
Note that you don’t have to use from-import to get into trouble:
# module Y
import X
X.spam() # doesn't work either: spam isn't defined yet!
To fix this, either refactor your program to avoid circular imports (moving stuff to a separate module often helps), or move the imports to the end of the module (in this case, if you move import Y to the end of module X, everything will work just fine).
Note that you don’t have to use from-import to get into trouble:
# module Y
import X
X.spam() # doesn't work either: spam isn't defined yet!
To fix this, either refactor your program to avoid circular imports (moving stuff to a
separate module often helps), or move the imports to the end of the module (in this
> cat yamlxs-tt2-utf8.t
use strict;
use warnings;
use Test::More tests => 1;
use Template::Toolkit::Simple;
use YAML::XS;
my $template = <<'...';
Hello, [% name %]
...
> cat yamlxs-tt2-utf8.t
use strict;
use warnings;
use Test::More tests => 2;
use Template::Toolkit::Simple;
use YAML::XS;
use Encode;
my $template = <<'...';
Hello, [% name %]
> cat yamlxs-tt2-utf8.t
use strict;
use warnings;
use Test::More tests => 2;
use Template::Toolkit::Simple;
use YAML::XS;
use Encode;
my $template = <<'...';
Hello, [% name %]
> cat yamlxs-tt2-utf8b.t
use strict;
use warnings;
use Test::More tests => 8;
use Template::Toolkit::Simple;
use YAML::XS;
use Encode;
my $template = <<'...';
Hello, [% name %]
=head1 USING YAML::XS WITH UNICODE
Handling unicode properly in Perl can be a pain. YAML::XS only deals
with streams of utf8 octets. Just remember this:
$perl = Load($utf8_octets);
$utf8_octets = Dump($perl);
There are many, many places where things can go wrong with unicode.
If you are having problems, use Devel::Peek on all the possible
diff --git a/Makefile.PL b/Makefile.PL
index 17ed88e..0326a72 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -141,6 +141,7 @@ EOT
clean_files q{
lib/Mouse/Tiny.pm $(O_FILES) test-mydeps-*.log
+ xshelper.h
*.out
_________________________________________
/ i'm 'thinging' that i need to get in \
| touch with you as soon as i'm done with |
\ this thing. i miss you. /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
_________________________________________
/ i'm 'thinging' that i need to get in \
| touch with you as soon as i'm done with |
\ this thing. i miss you. /
-----------------------------------------
\ ^__^
\ (@@)\_______
(__)\ )\/\
||----w |
|| ||