[Zurich-pm] Nachtrag: Was passiert intern, wenn man Perl mit einem Verzeichnis als einzigen Parameter aufruft?

Paul Johnson paul at pjcj.net
Tue Oct 2 06:33:41 PDT 2012


On Tue, Oct 02, 2012 at 02:39:14PM +0200, Paul Johnson wrote:
> On Tue, Oct 02, 2012 at 01:58:43PM +0200, Axel Beckert wrote:
> > Hi nochmal,
> > 
> > On Tue, Oct 02, 2012 at 11:28:05AM +0200, Axel Beckert wrote:
> > > wir sind heute bei der Kombination von Test Driven Development und
> > > Autotools auf einen interessanten Fall gestossen: Aus einem Testfile
> > > (d.h. aus einem der Files t/*.t):
> > > 
> > >   system_ok('perl', '../projektname', [...])
> > > 
> > > (Das ".." wird von den autotools als Pfad eingesetzt.)
> > > 
> > > Je nachdem, auf welcher Ebene das dann aufgerufen wird (./bla.t oder
> > > t/bla.t) ist '../projektname' das zu testende Skript oder eben das
> > > Basisverzeichnis des Projektes.
> > > 
> > > Interessanterweise schlägt der Test in letzterem Fall _nicht_ fehl.
> > > Genauso wie das hier:
> > > 
> > > ~ → perl /tmp
> > > ~ → echo $?
> > > 0
> > > ~ → 
> > > 
> > > Kann mir jemand erklären, was dabei bei Perl intern abgeht?
> > 
> > strace half ein wenig:
> > 
> > read(3, 0x20ecfe0, 8192)                = -1 EISDIR (Is a directory)
> > 
> > Auf #debian-perl kam als Kommentar dann noch ein "yeah, it feels
> > wrong", deswegen habe ich dann mal einen "minor" Bug-Report bei Debian
> > geschrieben:
> > 
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689412
> > 
> > 		Gruss, Axel
> 
> Ruby and python both give an error message, neither of which is
> particularly inspiring, I think, and more importantly each returns 1.
> 
> If you, or debian, care to provide a patch I'm sure it will be accepted.
> I believe there's already at least one perl bug open around this area.
> 
> If neither of you are in a position to provide a patch I may be able to
> find time to do it, but it's probably worth while making sure that the
> bug gets into perl's own bug tracker anyway, or if it's already there
> then giving it a bump couldn't hurt.

Looks like Dom has done just that:

    https://rt.perl.org/rt3//Public/Bug/Display.html?id=61362

-- 
Paul Johnson - paul at pjcj.net
http://www.pjcj.net


More information about the Zurich-pm mailing list