Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl and UNIX

Status
Not open for further replies.

druggist

Technical User
Oct 11, 2000
36
US
I have a very large database that i can search using some unix commands. I need to create a web interface so the users can access it the same way.

I want to create a perl script that has unix commands in it that will enable users to click various fields and then hit submit to run the script.

Is this possible? I can give more info if needed.

druggist
 
perldoc -f system

or

perldoc -f exec

on your UNIX prompt should provide you information on UNIX commands within a perl script.

Backticks should also help ....


#!/usr/bin/perl
print "Perl is here -> ",`which perl`,"\n";


The shell command in the above code is enclosed within backticks .





HTH

regards
CM


I don't know where everyone gets this notion that Perl has "weak typing". It's just not true, as long as you define the context properly.
-Randall L Schwartz in comp.lang.perl.misc
 
try using systems calls
e.g

print `ls` will list the directory

you can assing variables to these

$list = `ls`;
print "$list";
 
I think that will work for executing a unix command with a perl script, but now the more daunting task is to create something that my web interface/form will be able to process. If i have a couple of fields that will give me the necessary info to put in the command line, how do i go from the inputted data by the user to the command line?

druggist?
 
Check out the documentation on the CGI module. You can find it at Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top