Sponsored Content
Full Discussion: calling Perl from C
Top Forums Programming calling Perl from C Post 11531 by shaik786 on Friday 7th of December 2001 12:49:00 AM
Old 12-07-2001
Hi!

Two simple ways of getting the output are:

1.) system("perl test.pl filename > output.txt"); ----> and then open the file output.txt and read it for the output.

2.) popen("perl test.pl filename", "r"); and read the output, which is the method I suggest. ----> See the man pages of popen()

Rgds
SHAIK
shaik786
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URL calling in PERL

All Please help me to call url in Perl. Ex: http://www.test.com/dynf?urn=123 Assume it will return success if 123 is in urn or it will return " failed". I want store this return type in a variable. Please help me to call the URL through PERL. Thanx in advance Regards Deepak (1 Reply)
Discussion started by: DeepakXavier
1 Replies

2. Shell Programming and Scripting

calling a shell script from perl

Hi all, Not sure if this is the right forum to post query regarding perl script. I have a perl script which internally calls a shell script. My problem is that the shell script should be passed command line arguments. I call a shell script from perl using: system("sript.sh"); How do... (3 Replies)
Discussion started by: gurukottur
3 Replies

3. Shell Programming and Scripting

Calling Expect script in Perl...

I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. The values to be exported or stored in a file. I have close to 10 machines and I have created 10 files and pass the corresponding files in command line, Now I could like... (4 Replies)
Discussion started by: ramkriz
4 Replies

4. Shell Programming and Scripting

calling problem in perl script

Hi , Here is my piece of code-- main(); sub main { $result = GetOptions ("LogDir=s" => \$LogDir, "Summary" => \$Summary, "Indiviual=s" => \$Individual , "Diagnostics=s" => \$Diagnostics, ... (1 Reply)
Discussion started by: namishtiwari
1 Replies

5. Shell Programming and Scripting

Calling 3 perl script from one

hi all, I have 3 perl scripts a.pl,b.pl and c.pl each of these work when i pass a date for eg: perl c.pl 2010-05-27 now i want to write a perl script that would call the 3 scripts and make it run all the 3 scripts (a.pl,b.pl,c.pl) parallelly rather than 1 after the other....... pls... (2 Replies)
Discussion started by: siva_nagarajan
2 Replies

6. Shell Programming and Scripting

calling perl commands in shell

i have four commands 1. perl -MCPAN -e shell 2. o conf prerequisites_policy follow 3. o conf commit 4. exit I am attempting to streamline a bunch of yum commands and cpan installations and want to remove the confirmation portion of the cpan these four commands will do just that. my... (2 Replies)
Discussion started by: murphybr
2 Replies

7. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

8. Shell Programming and Scripting

PERL: Function calling using parameters

I have two variables. I need to call them using the same function my $dat1 ="abc"; my $dat2 ="def"; my $check; filecheck($dat1,$dat2); sub filecheck($) { $check = shift; print "first name is $check\n"; } print "this is fine\n"; sub filecheck($) { $check = shift; print "second... (2 Replies)
Discussion started by: irudayaraj
2 Replies

9. Shell Programming and Scripting

Perl Methods Calling

Hello I am on my way to improve my wonderful Perl skills, I got an issue which I want to share with you all. I have a Perl module which looks like package Cocoa; require Exporter; @ISA = qw(Exporter); my $a=''; my $b=''; my $c=''; sub new { my $this = shift; # Create... (8 Replies)
Discussion started by: adisky123
8 Replies

10. Shell Programming and Scripting

Calling perl from shell script

I am calling a perl script from shell script. $ cat mah_appln_bkp_oln.ksh #!/bin/ksh . /udb/home/udbappln/.profile . /udb/home/udbappln/sqllib/db2profile Com=/udb/udbappln/utility/systemscripts/currentUMR perl $Com/backup.pl -d dbname --tsm --purgetsmcopies 21 --purgetsmlogs exit 0 ... (1 Reply)
Discussion started by: ilugopal
1 Replies
ExtUtils::Helpers(3)					User Contributed Perl Documentation				      ExtUtils::Helpers(3)

NAME
ExtUtils::Helpers - Various portability utilities for module builders VERSION
version 0.021 SYNOPSIS
use ExtUtils::Helpers qw/build_script make_executable split_like_shell/; unshift @ARGV, split_like_shell($ENV{PROGRAM_OPTS}); write_script_to('Build'); make_executable('Build'); DESCRIPTION
This module provides various portable helper functions for module building modules. FUNCTIONS
build_script() This function returns the appropriate name for the Build script on the local platform. make_executable($filename) This makes a perl script executable. split_like_shell($string) This function splits a string the same way as the local platform does. detildefy($path) This function substitutes a tilde at the start of a path with the users homedir in an appropriate manner. man1_pagename($filename) Returns the man page filename for a script. man3_pagename($filename, $basedir) Returns the man page filename for a Perl library. manify($input_filename, $output_file, $section, $opts) Create a manpage for the script in $input_filename as $output_file in section $section ACKNOWLEDGEMENTS
Olivier Mengue and Christian Walde made "make_executable" work on Windows. AUTHORS
o Ken Williams <kwilliams@cpan.org> o Leon Timmermans <leont@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2004 by Ken Williams, Leon Timmermans. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-05-06 ExtUtils::Helpers(3)
All times are GMT -4. The time now is 08:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy