#!/import/bw/tools/local/perl-5.8.0/bin/perl
eval 'exec /import/bw/tools/local/perl-5.8.0/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# Copyright (C) 1999-2003 Gregor N. Purdy. All rights reserved.
# This script is free software. It may be copied or modified according
# to the same terms as Perl itself.
package Psh; # still use a package so getopt etc. is not imported into
# Parse the command line and deal with the options except -r, which is
# handled in the MAIN program below. We do this part very early in this
# file so that the results apply to all the setting up we do before the
@Psh::origINC=@INC; # save it
Getopt::Std::getopts('Fiwrd:f:c:', \%opt);
Psh::Util::print_error_i18n('no_r_flag');
Psh::Util::print_out_i18n('simulate_perl_w');
if (exists($opt{'d'})) { $Psh::debugging = $opt{'d'}||'soie'; }
else { $Psh::debugging = 0; }
Psh::Util::print_debug("Debugging!\n");
Psh::process_rc($opt{'f'}) unless $opt{'F'};
# TODO: Is this implementation equivalent to sh's ?
Psh::initialize_interactive_mode;
eval { Psh::main_loop; };
Psh::handle_message($@,'main_loop');