LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   perl plugin not working on some linux machines (https://www.linuxquestions.org/questions/linux-newbie-8/perl-plugin-not-working-on-some-linux-machines-43566/)

nda211 01-31-2003 03:11 PM

perl plugin not working on some linux machines
 
hi

i have created a plugin in perl and am trying to run it but am not able to on some of my machies. The code seems to be working on some and not on others. So there is no uniformity that has been observed.

The main plugin is supposed to get informations from other perl plugins and i am using the -- run and -- info switches to get that information.

can you let me know if this is due to the following code....

open FILE, "$plugindir/$plugin.plugin --info |" || die "ERROR: Couldn't run plug-in \"$plugin\"\n";
INFOLOOP: while ($line = <FILE>)

Can You kindly suggest me the way either to rectify this problem or
suggest a new way of implementing the same thing.

thanks
Nitin
:newbie:

Mara 02-01-2003 03:39 PM

Could you write more about your problem? Are you sure the $plugindir is set correctly in all cases?

nda211 02-02-2003 12:57 PM

perl plugin not running on some linux machines
 
The code seems to be working on some and not on others.it is running fine on my
machine . it runs on my machine when I give "perl the_plugin_name" but not on some other linux machines.

the design is such that there is a main plugin called main.plugin which is supposed to execute other plugins(66 plugins in all.. lets call each of these 66 plugin as individual_plugin) tht are kept in a directory. to run the 66 plugins we are using -- run comand line option defined in each of the 66 plugins. also we are gathering system information which can be accessed using the -- info command line option defined in each plugin. the -- run and -- info are then used in the main.plugin to run the 66 plugins and display information about these 66 plugins.
now on all machines when i run "perl individual_plugin --run" it runs the individual
plugin. also when i use perl individual_plugin --info the plugin works fine, returning all the information required. but the problem is that on some machines we are not able to run the main.plugin.

We have identified two lines in the ferret code that do not
work.

The first one is

open FILE, "$plugindir/$plugin.plugin --info |"||die....
On line number 264 we use similar line trying to "run" the plugins using
"--run" and face the same problem there also.

If we remove "info switch" then we are able to open the plugins file but
if I use "--info" then we cant.

The motive of the developer was to pass the "info" switch to the plugin
called. If we open any plugin from the plugins directory then in the
GetOption "info" and "run" can be seen. But the thing is that we are not
able to pass the value to those fields in the plugin thruh our main
code.

Can You kindly suggest me the way either to rectify this problem or
suggest a new way of implementing the same thing.

regards
Nitin

Mara 02-03-2003 03:11 PM

Have you tried to check WHY it sometimes fails? If I remember correctly you can use $! variable for it. It seems like a permission/other configuration problem rather than a code one...

nda211 02-03-2003 05:37 PM

hi
we have not been able to figure out exactly why the plugins work on some machine and not on others. the code part looks fine as it is running on some machines. but we are stuck up as we do not know whats wrong with the configuration tht needs to be changed in order to get it working on all the machines. we have also tried all combinations of permissions but it doesnt work.
thanks

Mara 02-04-2003 05:28 AM

Modify the line this way:
open FILE, "$plugindir/$plugin.plugin --info |" || die "ERROR: Couldn't run plug-in \"$plugin\" code: $!\n";
Then it will print not only your message, bt also the error code. Please try it and see it it's always the same error code, or it changes. And please post it...


All times are GMT -5. The time now is 03:19 PM.