The problem is I can't post the whole script, because it's not allowed in our company.

You don't have to post the whole script, simply post something sequivalent that demonstrates the problem you encounter -- replicate the problem with fewer lines of code

So far its all been syntax errors

Here is what I "wrote" by copy/pasting from http://p3rl.org/Encode::Detect::Detector

#!/usr/bin/perl -- use strict; use warnings; use Encode::Detect::Detector; use autodie qw/ open /; my $octets = 'abc'.chr(266).chr(666); my $filename = shift || \$octets; open my($infh), '<:raw', $filename ; my $d = new Encode::Detect::Detector; while(my $line = readline $infh ){ $d -> handle( $line ); } $d -> eof; close $infh; my $charset = $d->getresult; print "**$filename gots *".$charset."*\n";
__END__ **SCALAR(0x3f8fac) gots *UTF-8* </c>

In reply to Re^5: Detect the Charset of an file by Anonymous Monk
in thread Detect the Charset of an file by endymion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.