Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sendfax knocks over perl script



Eric Smith wrote:
> 
> Hiya
> 
> Whenever my perl scrip comes to this exec statement, it falls over and
> exits (but does _successfully_ send the fax according to the contents of
> the variables) -->
> 
>   exec "sendfax $server -R -n -d $faxno ./temp/$faxno.tmp >/dev/null";
> 
> that vain attempt to supress output, you kow the "job no xxx submitted on
> host xxx" and let the script continue is the >/dev/null.
> 
> Any ideas how I may suppress the job confirmation statement, if this is
> really what causes the script to fail when it `execs' sendfax.
> 

No, exec will always cause your script to exit.  Try using "perl -w", you
will probably get a warning like this:

	Statement unlikely to be reached at foo.pl line 345.
	(Maybe you meant system() when you said exec()?)   


See "perldoc -f exec" or "perldoc -q exec"

=head2 How come exec() doesn't return?

Because that's what it does: it replaces your currently running
program with a different one.  If you want to keep going (as is
probably the case if you're asking this question) use system()
instead.        

	-phil



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services