I'm looking for the exact way to implement the SDL environment variable from a perl script that is the front end for launching a dosbox BBS.
I have the right approach from this link: running-dosbox-completely-headless
I'm just not sure how to implement it from inside the perl script.
export SDL_VIDEODRIVER=dummy
I'm launching dosbox with this script: telnetbbs-0.5
Here's the header. I assume it would need to go somewhere just before or after the first section.
#!/usr/bin/perl -wT
BEGIN {
delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
$ENV{PATH} = "/bin:/usr/bin";
$|++;
# $SIG{__DIE__} = sub { require Carp; Carp::confess(@_); }
}
I assumed I could manually edit the beginning of the script to set the variable, but that's where I'm stuck.
I have tried adding
$sdl = "export SDL_VIDEODRIVER=dummy";
system($sdl);
Maybe that is the right syntax for running a command from a perl script, but not the way to set the SDL environment variable.
I get the error "Can't exec export": No such file or directory at ./telnetbbs.pl "
I don't want to change SDL globally, just when the script is executed, as I might want to launch the BBS locally, as my pi is connected to a monitor and keyboard. I just don't want it to tie up a user desktop session. In the end I want to create a separate user and have that execute the script and launch dosbox upon connection, with the ability to log on as other users at the same time.
Any help would be greatly appreciated.
$ENV{PATH} = "/bin:/usr/bin";
statement seems to be setting thePATH
environment variable. You probably need to do something like that.