[comp.lang.perl] chsh /usr/bin/perl

ziegast@eng.umd.edu (Eric W. Ziegast) (06/25/91)

Has anyone ever thought about changing their shell to Perl?
I know it's an evil thought, but it's one of those things that has to
be asked just for the sake of asking.

JAPH,
Eric Z.

tchrist@convex.COM (Tom Christiansen) (06/25/91)

It would be too hard to type commands in, which after all is what shells
are all about.  Everything would be system thing, or print `foo` that.

--tom
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
		"So much mail, so little time."  

merlyn@iWarp.intel.com (Randal L. Schwartz) (06/26/91)

In article <1991Jun25.135706.20813@convex.com>, tchrist@convex (Tom Christiansen) writes:
| It would be too hard to type commands in, which after all is what shells
| are all about.  Everything would be system thing, or print `foo` that.

Not if your first entry was: system("/bin/sh") :-)

# warning... probably not SysV compatible, but I don't care... :-)
$0 = "Just another Perl hacker,"; grep(/(Just.*,)/ && (print $1), `ps xww`)
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/

eichin@athena.mit.edu (Mark W. Eichin) (06/26/91)

Actually, as someone who used gnuemacs as my shell for several months,
I've considered using perl as a shell. The trick is that many of the
commands which you'd expect to run as system("foo") are now available
as perl scripts... I'vve been porting pieces of my working environment
to perl, and grabbing things off the net. As part of my startup, I
have one perl script which 4 "finger"s, sends the output via "zwrite"
(a Project Athena networked write that has the end effect of popping
up an X window), does a nameserver lookup (and fetches the Athena
global motd) and does an xrdb load (loads my X resources.) 
	Even though there is some significant overhead in starting up
a perl process, I am saved the overhead of at least a dozen forks (and
on a 3MIPS  machine, heavily loaded by the xterms starting up, that is
noticeable.)
	Maybe if perl checked argv[0] on startup, and if it was "-"
ran $ENV{"HOME"}/.perlrc ...

				_Mark_ <eichin@athena.mit.edu>
				MIT Student Information Processing Board
				Watchmaker Computing <eichin@watch.com>

worley@compass.com (Dale Worley) (06/26/91)

Doesn't Perl read the entire script from the tty into a temporary
file, compile it, and then run it?  Wouldn't that be a strange shell,
if you had to type your entire session in before any of it ran?

Dale Worley		Compass, Inc.			worley@compass.com
--
Isn't it interesting that the first thing you do with your
color bitmapped window system on a network is emulate an ASR33?

flee@cs.psu.edu (Felix Lee) (06/28/91)

>Doesn't Perl read the entire script from the tty into a temporary
>file, compile it, and then run it?  Wouldn't that be a strange shell,

No problem.  You just have to type
	do 'read-eval-print-loop.pl';
	^D
and then proceed from there.
--
Felix Lee	flee@cs.psu.edu