Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I think we need a little more info/context.

How are you executing the script?

Are you passing the file path as a command line arg, or is it in a file that is passed as an arg or piped to the script?

Did you try dumping out $metadata_file (via Data::Dumper) prior to the open call to see if it held the value you expected?

There's no need to quote $metadata_file in the open call as demonstrated in the following example

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $filepath = 'C:\Program Files\Internet Explorer\ie9props.propdesc'; open my $fh, '<', $filepath or die "can't open '$filepath' $!"; my $file_contents = join '', <$fh>; print $file_contents;
outputs:
&#8745;&#9559;&#9488;<?xml version="1.0" encoding="utf-8"?> <!-- The properties in this file cover the following: Microsoft.IE.* --> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="h +ttp://schemas.microsoft.com/windows/2006/propertydescription" schemaV +ersion="1.0"> <propertyDescriptionList publisher="Microsoft" product="Internet E +xplorer"> <propertyDescription name="Microsoft.IE.FeedItemLocalId" forma +tID="{E32596B0-1163-4E02-867A-12132DB4BA06}" propID="2"> <searchInfo inInvertedIndex="false" isColumn="true" maxSiz +e="256"/> <typeInfo type="String" isViewable="false"/> </propertyDescription> <propertyDescription name="Microsoft.IE.SelectionCount" format +ID="{1CE0D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="2"> <searchInfo inInvertedIndex="false" isColumn="true"/> <typeInfo type="UInt32" isViewable="false"/> </propertyDescription> <propertyDescription name="Microsoft.IE.TargetUrl" formatID="{ +1CE0D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="3"> <searchInfo inInvertedIndex="true" isColumn="true" maxSize +="4168"/> <typeInfo type="String" isViewable="false" isQueryable="tr +ue"/> </propertyDescription> <propertyDescription name="Microsoft.IE.TargetUrlHostName" for +matID="{1CE0D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="4"> <searchInfo inInvertedIndex="true" isColumn="true" maxSize +="512"/> <typeInfo type="String" isViewable="false" isQueryable="tr +ue"/> </propertyDescription> <propertyDescription name="Microsoft.IE.TargetUrlPath" formatI +D="{1CE0D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="5"> <searchInfo inInvertedIndex="true" isColumn="true" maxSize +="4168"/> <typeInfo type="String" isViewable="false" isQueryable="tr +ue"/> </propertyDescription> <propertyDescription name="Microsoft.IE.Title" formatID="{1CE0 +D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="6"> <searchInfo inInvertedIndex="true" isColumn="true" maxSize +="4168"/> <typeInfo type="String" isViewable="false" isQueryable="tr +ue"/> </propertyDescription> <propertyDescription name="Microsoft.IE.VisitCount" formatID=" +{1CE0D6BC-536C-4600-B0DD-7E0C66B350D5}" propID="7"> <searchInfo inInvertedIndex="false" isColumn="true"/> <typeInfo type="UInt32" isViewable="false"/> </propertyDescription> </propertyDescriptionList> </schema>

In reply to Re: Mac Space in Path by fishmonger
in thread Mac Space in Path by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-18 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found