use HTML::TreeBuilder::XPath;
my $temp_path = $ENV{'TEMP'}."\\html\\globals_func.html";
// prints as C:\Users\Rockstar\Appdata\Local\Temp\html\globals_func.html
my $url = $temp_path;
my $page = get($url) or die $!;
my $p = HTML::TreeBuilder::XPath->new_from_content($page);
I get error: protocol 'c' is not supported
I get correct output when
my $url='file:///C:/Users/Rockstar/AppData/Local/Temp/html/globals_func.html';
As I want to make it run across all systems I am using global environment variable.
how do I change '\' to '/' in $url by using regex or is there any other way?
HTML file is present locally in the system itself.
LWPfor slurping a local file. UseFile::Slurpor do it manually usingopen($fh,...)and<$fh>, then you can use the path as is.