in reply to Mac Space in Path
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
outputs:#!/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;
<?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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Mac Space in Path
by bettis (Initiate) on May 23, 2013 at 03:27 UTC | |
by bettis (Initiate) on May 23, 2013 at 04:40 UTC | |
by Anonymous Monk on May 25, 2013 at 07:36 UTC |