[comp.lang.perl] Perl != shell

jand@kuling.UUCP (Jan Dj{rv) (02/28/90)

In article <15188@bfmny0.UU.NET> tneff@bfmny0.UU.NET (Tom Neff) writes:
>In article <7113@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>>You might say that you want it to act as if it were a shell.  But what if
>>you say
>>
>> 	perl -c "myscript.pl arg1 arg2 | myotherscript.pl arg1 arg2"
>>
>>Should perl handle that?  How much shell syntax do I put into perl?
>
>I suppose it'd be a royal PITA to add that kind of thing.  All I can point
>out is that if it WERE added, Perl would come that much closer to being
>the universally flexible shell it's already darn close to now.
>

IMHO Larry has done enough by letting perl understand the #! construct.
This should really be understood by the kernel, not by programs like perl.
(Anybody know what POSIX has to say about this ?).

I suppose perl doesn't do the #! trick on set[ug]id scripts?

Instead of putting shell syntax into perl there must be other things
people wan't to see in perl.

I'd like to have some basic tty diciplines as builtins in perl.
Things like CBREAK and ECHO modes would help a lot.
(Save's me from creating a ioctl/termio[s]/sgtty for each machine :-).

NOTE: I'll settle for those two things, this could get out of hand if
something more complicated was attempted. If you wan't to do something more
complicated, you can do it by ioctl.

A basic curses interface would be nice also (move, clear and standout
would be enough) but this is perhaps asking to much.

I realise that this things would promote perl as a shell, but this is
not my intention. I wan't to do fancier reports (peRl ?).


There must be other things people would like to see in perl, or is perl
already perfect (Perfect Extraction and Report Language :-) ?


Feedback wanted,

	Jan D.



lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (03/07/90)

In article <1422@kuling.UUCP> jand@kuling.UUCP (Jan Dj{rv) writes:
: I'd like to have some basic tty diciplines as builtins in perl.
: Things like CBREAK and ECHO modes would help a lot.
: (Save's me from creating a ioctl/termio[s]/sgtty for each machine :-).

I don't have much trouble with

	`stty -echo cbreak`;

or equivalent.  Yeah, it starts up one whole extra process, two if you throw
in any shell metacharacters.  How often do you want to do it?  Usually
not more than twice per script.

: A basic curses interface would be nice also (move, clear and standout
: would be enough) but this is perhaps asking to much.

I'd probably never do that.  But I have SERIOUSLY considered adding a pager.
Seems it would make writing a new rn easier...

	$what_they_typed_last = page(@article, *keyboard_map_subroutine);

It would presumably be able to add to @article while it was waiting for
keyboard input.  So you could do all kinds of nifty tricks like emulate
the less program, start displaying something even while NNTP is still
talking, etc.

We're talkin' hypertext here, boys and girls.

: There must be other things people would like to see in perl, or is perl
: already perfect (Perfect Extraction and Report Language :-) ?

I laugh in your general direction.

Larry