Skip Menu |

This queue is for tickets about the Browser-Open CPAN distribution.

Report information
The Basics
Id: 58004
Status: open
Priority: 0/
Queue: Browser-Open

People
Owner: melo [...] cpan.org
Requestors: feng.shaun [...] gmail.com
Cc:
AdminCc:

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



Hello, Using 'system' in Browser::Open is making it hard to use it with Curses, since 'system' also prints the output of the browser to terminal and that's almost always undesirable behaviour. I would suggest using system $cmd, $url, "> /dev/null &"; instead of system $cmd, $url; This way, the output will go to /dev/null rather that stdout and so doesn't pollute the terminal window when using Curses. It would also make sense to make a switch for it, like: open_browser($url, output => "/dev/null"); Just something to think about, but outputting 'system' is pretty annoying and not helpful at all. Thank you for this great module, Armin Using: Perl => 5.010; Linux => Archlinux;
Subject: Re: [rt.cpan.org #58004]
Date: Tue, 1 Jun 2010 07:38:35 +0100
To: bug-Browser-Open [...] rt.cpan.org
From: Pedro Melo <melo [...] simplicidade.org>
That's a nice idea. Let me think a bit about it to work out a good API for it. On Tue, Jun 1, 2010 at 5:07 AM, http://fengshaun.wordpress.com/ via RT <bug-Browser-Open@rt.cpan.org> wrote: Show quoted text
> Tue Jun 01 00:07:20 2010: Request 58004 was acted upon. > Transaction: Ticket created by http://fengshaun.wordpress.com/ >       Queue: Browser-Open >     Subject: (No subject given) >   Broken in: 0.03 >    Severity: Normal >       Owner: Nobody >  Requestors: feng.shaun@gmail.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58004 > > > > Hello, > > Using 'system' in Browser::Open is making it hard to use it with Curses, > since 'system' also prints the output of the browser to terminal and > that's almost always undesirable behaviour.  I would suggest using > > system $cmd, $url, "> /dev/null &"; > > instead of > > system $cmd, $url; > > This way, the output will go to /dev/null rather that stdout and so > doesn't pollute the terminal window when using Curses. > > It would also make sense to make a switch for it, like: > > open_browser($url, output => "/dev/null"); > > Just something to think about, but outputting 'system' is pretty > annoying and not helpful at all. > > Thank you for this great module, > Armin > > Using: > Perl => 5.010; > Linux => Archlinux; > >
-- Pedro Melo http://www.simplicidade.org/ xmpp:melo@simplicidade.org mailto:melo@simplicidade.org
On 2010-06-01 00:07:20, http://fengshaun.wordpress.com/ wrote: Show quoted text
> Hello, > > Using 'system' in Browser::Open is making it hard to use it with Curses, > since 'system' also prints the output of the browser to terminal and > that's almost always undesirable behaviour. I would suggest using > > system $cmd, $url, "> /dev/null &";
It's not possible to use redirects or background processes with the list form of system(). On the other hand, the list form is preferable in case there are special shell meta characters in $cmd or $url. So the real implementation would be more complicated, probably would need the use of fork, pipe open and so. Show quoted text
> instead of > > system $cmd, $url; > > This way, the output will go to /dev/null rather that stdout and so > doesn't pollute the terminal window when using Curses. > > It would also make sense to make a switch for it, like: > > open_browser($url, output => "/dev/null"); > > Just something to think about, but outputting 'system' is pretty > annoying and not helpful at all. > > Thank you for this great module, > Armin > > Using: > Perl => 5.010; > Linux => Archlinux;