how to return value from function and print from main program???
And also I need to return true or false... Is it possible?
Sure you can do both, just like from any shell script. Output is output and exit / return status is a different thing.
myfunc () {
echo Fnord
return 42
}
It's certainly possible, which is the language in use ?
I m working in Perl.
and also want to print the returned value.
If it's used in sub routine, use "return" function, otherwise printing the last value can be done with 'print "$variable_name\n"'
Also, you can always define custom return codes and strings, and print them when matching certain conditions.