in reply to error: unrecognised character \xC2 at the end of line

Let's take this one step at a time.
#!/usr/local/bin/perl on Unix like systems is called the "shebang" line. This is normally:
#!/usr/bin/perl
This tells Unix what program to execute. On Windows this is "explained" in a different way.

The "-w" part tells Perl to 'use warnings;'
The 'print("Hi");' is the input to Perl.

So make a file "hello.pl" with:

#!usr/bin/perl -w print "hello world\n";
on Unix, you should just at least add "X" execute to permissions for at least u+x, (see chmod command).

Don't mess with fancy command line single line programs until you understand how to do this the "normal way".

Replies are listed 'Best First'.
Re^2: error: unrecognised character \xC2 at the end of line
by bdalzell (Sexton) on Dec 28, 2011 at 22:14 UTC
    I spent a whole day trying to figure out why I could not load a file with the slurp technique because of this error message:
    unrecognised character \xC2 at the end of line
    It was not until I found this string of comments that I realized my problem was due to my having cut and pasted code from a web page into linux gedit and the underscore character from the cut code was different from the underscore needed on my linux system.
    SO WHEN IN DOUBT try TYPING the copied code into your program.
    THANKS SO MUCH FOR THIS WEB SITE.
    Off to make a contribution now.