[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] UNIX Perl problem



On Sat, 30 Sep 2000 05:57:02 +0000
 Sveinbjorn Thordarson <paladeen@soth.zoneit.com> wrote:
> #!/usr/bin/perl
> 
> use Shell.pm;
> 
> write("$user");
> 
> #now what? How do I actually send the message and close?  Is there
> another Unix command that just sends text in a single line command?

Try learning Perl a bit.
"use Shell" rather than "use Shell.pm"
Read documentation (perldoc Shell).
"use Shell qw(write)"
lets you use the shell command "write" because otherwise "write"
is an internal Perl function.
I wouldn't use Unix write for a simple text line. You would need
to learn more about write which expects ctrl-d to end a message.

Just execute "w", extract the tty column and do in Perl
system( "echo moin >/dev/pts/0")

This is a MacPerl mailing list!


Regards


Axel Rose

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org