wood estate has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I'm beginner to learn perl script . I follow the doc to learn perl . But I got below error as below when I start to run @al. Anyone have idea ? thanks for your help ! script :
#!/usr/bin/perl -w # Example 3.5 - splice @alpha = (’a’ .. ’z’); splice @alpha, 4, 5, map(uc, @alpha[4 .. 8]); $, = ’ ’; print @alpha;
error :
C:\begperl>splice3.pl Unrecognized character \x92; marked by <-- HERE after @alpha = (<-- HE +RE near co lumn 11 at C:\begperl\splice3.pl line 4.
my perl version is ActivePerl 5.20.1 Build 2000 (64-bit )

Replies are listed 'Best First'.
Re: Unrecognized character \x92 ERROR
by choroba (Cardinal) on Jan 05, 2015 at 10:11 UTC
    Perl doesn't understand the "smart" quotes
    ’a’

    Use the dumb ones:

    'a'
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Unrecognized character \x92 ERROR
by pme (Monsignor) on Jan 05, 2015 at 14:33 UTC
    Hi wood_estate,

    Be careful if you copy/paste code snippets from your browser to your editor. Always check the apostrophes. Lots of page has unicode encoding, thus the ' can be is unicoded (0x2019) what is different from the ASCII value: 0x27. As choroba said above: perl understand dumb quotes only.

Re: Unrecognized character \x92 ERROR
by Anonymous Monk on Jan 05, 2015 at 15:43 UTC
    I follow the doc to learn perl .

    Are you reading "Perl 5 Tutorial" by Chan Bernard Ki Hong? (http://www.cbkihong.com/index.pl?op=perltut&lang=e) Be aware that it is 11 years old now, and some of the code examples are showing their age, such as not using strict or the three-arg open. (Plus I imagine having to change all those single quotes and removing line numbers will get a little annoying.)

    There are lots of other places to learn Perl, lots of books including Learning Perl, or the resources on this site.

      Thanks for your all expert ! the problem have been resolved . Also, I will take your suggestion to learn the Perl again.