Dear monks i m trying to parse an xml file using XML::Twig unfortunately my code shows this error please help me to clear this error

#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use XML::Twig; my @xhash=(); my $xhash=\@xhash; my $file= $ARGV[0]; $xhash = XML::Twig->new(); $xhash -> parsefile('$file'); $xhash -> print;
ERROR: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\BISADMIN>e: E:\>cd fh\demo E:\FH\Demo>cd 1-9demo E:\FH\Demo\1-9demo>perl hashreplace.pl Ch01.xml Couldn't open $file: No such file or directory at hashreplace.pl line 10 at hashreplace.pl line 10 E:\FH\Demo\1-9demo>_END_

but the file is on the folder only please tel what is the reason for this error and help me to fix this problem


In reply to xml parsing error by satzbu

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.