LPM: hlp with h2ph :) sorry
Matt Cashner
sungo at earthling.net
Sat Apr 1 20:10:06 CST 2000
On Sat, 1 Apr 2000, Rich Bowen wrote:
> repett0 at sac.uky.edu wrote:
> >
> > I have been a lurker for a long time on this list and need some help. I
> > had to run a program for a class using anykind of scripting and I choose
> > perl so I can start getting some skillz... However, Im having problems on
> > finding the best way to get a syscall to work. In solaris(at least most
> > shells) you can type 'clear' to clear the screen or 'ls' to list files.
> > How do you make these calls in a perl script without exiting the script.
>
> The first part I can answer for you. And there are two answers, sort of.
> OK, three.
>
> To call system calls, use the `` notation.
> You can use the system() function, which behaves rather differently.
> Might not do what you want.
or you can use perl to do the same sorts of thinks without calling stuff
from the shell :)
for ls:
opendir DIR, '/home/sungo/';
my @files = readdir DIR;
closedir DIR:
for cp:
link '/home/sungo/file1', '/home/sungo/file2';
---------------------
Matt Cashner
sungo at earthling.net
---------------------
"It's always darkest just before it goes pitch black."
More information about the Lexington-pm
mailing list