Dear Gurus:
I am very new to perl and have inherited a piece of code written in Perl. This utility used utf-8 stuff and convets excel worksheet to xml. When I run this I get following error

Unknown open() mode '>:utf8' at xls-to-xml.pl line 74.

Here is my perl script code snippet

use strict; use vars qw( $MAX_EMPTY_ROWS ); use Win32::OLE qw/CP_UTF8/; ### Settings ### # The number of max empty rows $MAX_EMPTY_ROWS = 5; # Set UTF-8 support on Win32::OLE->Option(CP => CP_UTF8); # Read the xls and the output filenames from the command line die ( usage() ) if $#ARGV != 1; my $xlsfile = shift (@ARGV); my $xmlfile = shift (@ARGV); # Create OLE object - Excel Application Pointer my $xl_app = CreateObject Win32::OLE 'Excel.Application' or die "Cannot create OLE object: ". Win32::OLE->LastError(); # Open Excel File my $workbook = $xl_app->Workbooks->Open($xlsfile) or die "Cannot open workbook '$xlsfile' (".Win32::OLE->LastError()." +)"; do processing..... # Open the output file open(OUTPUT, ">:utf8", $xmlfile) or die "Cannot open file '$xmlfile' for writing";


Can someone help my ?
I am using Perl v5.6.1 (from ActiveState) on Windows 2000
Thanks

janitored by ybiC: <code> and <readmore> tags around code block as per Monastery convention


In reply to Excel -to-XML conversion utility by wagleg

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.