Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
Actually i am a new bee to perl and i am having a prob with the following piece of code.

eval 'exec perl $0 ${1+"$@"}' # -*- perl -*- if $running_under_some_shell; system "/usr/openwin/bin/xterm -e script";

My problem is that the launched xterm closes as soon as it opens. I would like that it remains there even after the script has run..Thanks in advance for your help!!!

20040526 Edit by Corion: Added formatting

Replies are listed 'Best First'.
Re: Facing prob with launching xterm!!
by Abigail-II (Bishop) on May 26, 2004 at 12:21 UTC
    system "/usr/openwin/bin/xterm -e bash --rcfile script";

    Abigail

Re: Facing prob with launching xterm!!
by dcvr69 (Beadle) on May 26, 2004 at 16:52 UTC

    Just in case you don't have bash - possible since this looks like a solaris system, and bash might not be installed:

    system "ENV=script /usr/openwin/bin/xterm -e ksh"

    This uses what is normally used to load .kshrc to run your script instead. Well, actually, it runs the shell, which then sources your script, which is slightly different from just running the script. This will leave you with an open shell.

    If all you want is to have it stay on screen until you hit enter, try:

    system qq{/usr/openwin/bin/xterm -e ksh -c "script;read"}

Re: Facing prob with launching xterm!!
by parv (Parson) on May 27, 2004 at 00:12 UTC
    The xterm from XFree86 has "hold" option which keeps the xterm around untill (x)kill-ed.