How to call shell script into perl?

Let’s learn how to call shell script into perl. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How can I call a Perl function from a shell script?

I have written a library in Perl that contains a certain function, that returns information about a server as a character string. Can I call this function from a shell directly? My boss asks "Can you call it from a shell directly for the time being?" Because he said that, I think I should be able to do it, but how do I do it?

Answer:

perl -MServerlib=server_information -e 'print server_information()' Is another way to do this, but only...

Read more

freddiefujiwara at Stack Overflow Mark as irrelevant Undo

Other solutions

Perl script to display MySQL query results on webpage

Pasted below is my Perl script to generate a data entry form on a webpage, process the data when Submit is clicked, and insert the data into my MySQL database. Now, I'm trying to do the opposite, and display query results from same database to a webpage...

Answer:

Hello omniscientbeing, Since I don't have the ability to test this on your server, please ask for further...

Read more

omniscientbeing-ga at Google Answers Mark as irrelevant Undo

Unix: What is the best way to get script (typescript) to work with a restricted shell?

I have a scenario where I want to log every activity for a particular  user. I have a script built around the script command which I invoke  from the user's .profile. Now the requirement is that the user should  not be able to delete the subsequent typescript...

Answer:

I guess you need to set default shell for your user as rksh. You can do this while adding a user using...

Read more

Vishwajit Paste at Quora Mark as irrelevant Undo

Perl is making my head explode

Script-filter: I've been tasked with finding out who at our company is synchronizing to their home folders on our fileservers, and how often. Although initially it was recommended I do this in perl, my head is blowing up trying to get it to work. Lots...

Answer:

A basic stab at this in Perl could be:my $root = "\home\Department\Users";my $rootdh;opendir...

Read more

routergirl at Ask.Metafilter.Com Mark as irrelevant Undo

UNIX shell script question?

Hi guys, I want to create a shell script file (let's say 'answers'), which will call another script file (let's say 'questions'). The 'questions' script will ask three questions: what's your name?, what's your address?, who is your wife?. Then, 'answers...

Answer:

I'd use a temp file and have questions write the results there, and then answers can open it. You may...

Read more

dhtjtks33 at Yahoo! Answers Mark as irrelevant Undo

Perl help with Modules

Hi, I am after some help with using PERL modules. I am trying to read options using the Getopt:Long module as follows; #!/usr/bin/perl # import module use Getopt::Long; # set default value for option $debug = 0; # get value of debug flag $result...

Answer:

Hi Mick This had me stumped for a little while too until I noticed you had made a minor typo by missing...

Read more

mickr-ga at Google Answers Mark as irrelevant Undo

Perl regex hell

I have been hammering Google for about three hours now trying to find the answer to what I expected to be a simple question: WTF is up with regular expression backreferences in Perl? I cannot make this (simple) find-replace work. Trying to automate some...

Answer:

Specifically, this works for me:sub replaceString { my ($s, $r) = @_; if (s/$s/$r/eeig) { print; } else...

Read more

caution live frogs at Ask.Metafilter.Com Mark as irrelevant Undo

Can I run Hive queries from Shell Script?

I have a shell script I have written to pump all my logs into HDFS. After that I want to move my HDFS data into Hive tables. Can I add my Hive queries in the shell script itself? If so, please suggest me how to do it. I have read somewhere to write all...

Answer:

U can easily go with hive -e "query;"this should surely satisfy ur need.

Read more

Yaswanth Sree Harsha at Quora Mark as irrelevant Undo

How do I do a su -c "command" so that bash comes out as the default shell.

please answer only with regards to total description. I need to "su" to a given user name whose default shell is "tcsh", but use a "bash" shell to execute a few shell scripts/commands which are written in "bash"...

Answer:

Good evening cheekoo1-ga, If solaris prevents you from specifying a shell using -s, perhaps you can...

Read more

cheekoo1-ga at Google Answers Mark as irrelevant Undo

Which script language is easy to learn quickly?

i wd like to learn script language easily pls suggest me among these Perl/Python/Shell/TCL/Java Script/VB Script adv tahanks

Answer:

Depends what you wanna do, Perl/Javascript are web languages (Perl isnt used anymore) Python can be...

Read more

Kamal Raj at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.