Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the devel-nytprof CPAN distribution.

Report information
The Basics
Id: 99080
Status: resolved
Priority: 0/
Queue: devel-nytprof

People
Owner: Nobody in particular
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.06
Fixed in: (no value)



Subject: nytprofhtml --open fails on KDE
"nytprofhtml --open" will fail on KDE (KDE4 with non-standard Opera), as the code is broken failure line: sh: openURL: command not found $ perl -MV=Devel::NYTProf Devel::NYTProf /pro/lib/perl5/site_perl/5.20.0/x86_64-linux-thread-multi-ld/Devel/NYTProf.pm: 5.06 This is perl 5, version 20, subversion 0 (v5.20.0) built for x86_64-linux-thread-multi-ld line 1317 and on my @try = qw(xdg-open); if ($ENV{BROWSER}) { push(@try, split(/:/, $ENV{BROWSER})); } else { push(@try, qw(firefox galeon mozilla opera netscape)); } unshift(@try, "kfmclient") if $ENV{KDE_FULL_SESSION}; unshift(@try, "gnome-open") if $ENV{GNOME_DESKTOP_SESSION_ID}; # here @try is qw( kfmclient xdg-open firefox opera ) for (grep { have_prog($_) } @try) { if ($_ eq "kfmclient") { $BROWSER .= " openURL %s"; # <= bad code } elsif ($_ eq "gnome-open" || $_ eq "opera") { $BROWSER = "$_ %s"; } else { $BROWSER = "$_ %s &"; } last; } } # here $BROWSER = " openURL %s" Obviously, the line should have been $BROWSER = "$_ openURL %s"; Which is almost never what is wanted: $ xdg-mime query filetype nytprof/index.html text/html $ xdg-mime query default text/html Opera.desktop Using KDE's "systemsettings" has Opera on top as possible webbrowsers, but kfmclient still opens with Konqueror. IMHO, "xdg-open" should always be first as it is so widely adopted now FWIW Opening index.html from dolphin will also start Opera
IMHO, having xdg-open first would be cleanest like this: else { my @try; if ($ENV{BROWSER}) { push(@try, split(/:/, $ENV{BROWSER})); } else { push(@try, qw(firefox galeon mozilla opera netscape)); } unshift @try, "kfmclient" if $ENV{KDE_FULL_SESSION}; unshift @try, "gnome-open" if $ENV{GNOME_DESKTOP_SESSION_ID}; unshift @try, "xdg-open"; for (grep { have_prog($_) } @try) { if ($_ eq "kfmclient") { $BROWSER = "$_ openURL %s"; } elsif ($_ eq "gnome-open" || $_ eq "opera") { $BROWSER = "$_ %s"; } else { $BROWSER = "$_ %s &"; } last; } Works fine in my environment
Does installing Browser::Open fix it for you?
Fixed in b03293f I hope (via your suggested change). Thanks.