Open p5pRT opened 13 years ago
Consider the following example:
---- example ---- use warnings qw( FATAL exec ); eval { system( "ritzelbimpf" ); }; if ( $@ ) { warn "error: $@"; exit ( 0 ); } else { warn "nonerror"; exit ( 0 ); } ---- example ----
where the executable "ritzelbimpf" must not exist on your system.
When run\, this results in the following output:
---- output ---- error: Can't exec "ritzelbimpf": No such file or directory at -e line 3. nonerror at -e line 10. ---- output ----
because the cloned process runs the "if"\, the main process the "else" part. I don't think that this is in the spirit of the system() function which should appear to be synchronous to the caller.
Of course\, this way it looks simple. But I use warnings( FATAL all ) in my Perl programs and it took me some time to figure out why the system() function behaves that strangely.
jens.schmidt35@arcor.de - Status changed from 'new' to 'open'
jens.schmidt35@arcor.de - Status changed from 'open' to 'new'
Still reproduces in Perl 5.16.2.
jens.schmidt35@arcor.de - Status changed from 'new' to 'open'
Hi\,
This also reproduces in perl 5.18.1 (Debian GNU/Linux sid) and perl 5.8.8 (AIX 5 and AIX 6) -- James
Hi\,
This also reproduces in perl 5.18.1 (Debian GNU/Linux sid) and perl 5.8.8 (AIX 5 and AIX 6) -- James
Migrated from rt.perl.org#96332 (status was 'open')
Searchable as RT96332$