How do I chdir in an exec?

Michael G Schwern schwern at pobox.com
Mon Mar 9 23:16:11 GMT 2009


Alex Vandiver wrote:
> On Mon, 2009-03-09 at 20:24 +0000, Andy Armstrong wrote:
>> On 9 Mar 2009, at 20:14, Michael G Schwern wrote:
>>> Here's one to read URLs out of the test files and fetch the test  
>>> results from
>>> the web.
>>>
>>> exec => sub {
>>>    my($harness, $file) = @_;
>>>
>>>    open my $fh, $file or die $!;
>>>    my $url = <$fh>;
>>>    chomp $url;
>>>
>>>    # get_url() being some function that returns a filehandle to
>>>    # a web get
>>>    my $web_fh = get_url($url);
>>>    return $web_fh;
>>> }
>> +1
> 
> Implemented as r1299 -- you can now also return a string containing raw
> TAP, if you prefer.

I considered something like that, a scalar ref containing TAP, but scalar ref
filehandles would seem to make that obsolete.


-- 
...they shared one last kiss that left a bitter yet sweet taste in her
mouth--kind of like throwing up after eating a junior mint.
    -- Dishonorable Mention, 2005 Bulwer-Lytton Fiction Contest
           by Tami Farmer


More information about the tapx-dev mailing list