nayabrahil has asked for the wisdom of the Perl Monks concerning the following question:
Hello Masters,
I would be glad if someone could tell me how to embed bash function in perl. Also how to call them.
For example:
##function body
function name {
echo "name is nayab rahil"
}
##function call.
name
__________________________________
I am using backtick to run the below function but i always get this error
`function forloop {
for ((a=1;a<=5;a++))
var="$a"
echo "$var"
done
}`
$result=`forloop`;
I want to make a function of the above for loop and run it. Also it should be embedded in perl script only.
Please help!!!
I would be glad if someone could tell me how to embed bash function in perl. Also how to call them.
For example:
##function body
function name {
echo "name is nayab rahil"
}
##function call.
name
__________________________________
I am using backtick to run the below function but i always get this error
`function forloop {
for ((a=1;a<=5;a++))
var="$a"
echo "$var"
done
}`
$result=`forloop`;
I want to make a function of the above for loop and run it. Also it should be embedded in perl script only.
Please help!!!
Back to
Seekers of Perl Wisdom