Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^6: Win32 wperl open Console when system

by fdesar (Beadle)
on Jan 21, 2020 at 15:39 UTC ( [id://11111690]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Win32 wperl open Console when system
in thread Win32 wperl open Console when system

I finally got it work the way I want by using:

sub ShowPDF { my $pdf=shift; my $action = { MSWin32 => sub { $pdf=~s/\//\\/g; qx/explorer.exe "$url"/; }, darwin => sub { system qq{open "$pdf" >/dev/null 2>&1 &} }, }->{$^O} || sub { system qq{xdg-open "$pdf" >/dev/null 2>&1 &} }; $action->(); }

I just had to add the RE to make sure there is only '\' in the path (its porting from Unices).

Using "explorer" command did the trick and solved my issue !

Many, many , thank to you all :-))

F.

Replies are listed 'Best First'.
Re^7: Win32 wperl open Console when system
by Anonymous Monk on Jan 21, 2020 at 21:32 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-23 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found