On Nov 22, 2012, at 9:43 PM, boB Stepp wrote: > Win7-64bit. DWIM Perl, Strawberry Perl 5.14. Padre 0.96. > > I am using the 6th edition of Learning Perl. It recommends adding use > utf-8 to all programs. So I gave it my first try: > > #!/usr/bin/env perl > use utf-8; > > print "Hello world"; > > > This gives the result: > > > E:\Programs\Perl\LearningPerl>perl helloworld.pl > Can't locate utf.pm in @INC (@INC contains: E:/Dwimperl/perl/site/lib > E:/Dwimper > l/perl/vendor/lib E:/Dwimperl/perl/lib .) at helloworld.pl line 2. > BEGIN failed--compilation aborted at helloworld.pl line 2. > > I am puzzled as to why utf.pm is being looked for. utf8.pm is > available in E:\Dwimperl\perl\lib Googling the part of the error > message that does not contain my personal file paths has not led me to > anything that I find helpful. Thoughts?
I don't have a copy of that book, but I suspect that it is referring to 'use utf8;', with no dash. I think that Perl is not parsing the dash character as part of the module name and looking for the utf module, not the utf-8 module (or pragma). In any case, if you do not have any UTF characters in your source code, you don't need to add that statement. With it, the Perl parser will accept UTF-8 characters as part of the source program, so you can enter UTF strings directly in your source code. Other mechanisms are used for reading and writing files with UTF characters, but I haven't used those, either. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/