Click to See Complete Forum and Search --> : Perl Script


barney34
05-02-2001, 10:20 AM
If I have the code for a perl script in txt format what do I do to be able to run it. I have RedHat 7.0. Perl is installed I just need to know what to name the file and then what command in perl to run it.

Antho
05-02-2001, 11:37 AM
I'm not for sure but I think all you have to do is put:
#!/bin/perl
as the first line (no whitespace)and then chmod 0755 it, it should run then...

Muzzafarath
05-02-2001, 12:15 PM
Perl is usually located in /usr/bin/perl. :)

bighara
05-02-2001, 03:04 PM
first line of the text file should read (add if it doesn't)
#! usr/bin/perl
(unless you put Perl somewhere wacky in your directory)

Then from your shell type:
perl [filename]
that should be it

YaRness
05-02-2001, 03:15 PM
you can just dump the code into a text file and run "perl filename".

or you can dummp the code into a file, make sure to include the appropriate "#!/usr/local/bin/perl" line at the top (depending on where your copy of perl is), chmod the file to be executable ('chmod 755 filename' will give execute access to everyone, and write access to the current user), and then execute the file: './filename'.