problem in accessing variables declared in another perl script
hi guys, i have a problem in perl. I want to access variables from a different script.
i give an example script first script Code:
#!/usr/bin/perl -w Code:
#!/usr/bin/perl Code:
Global symbol "$name" requires explicit package name at ./sending.pl line 5. but if i try this, it works first script Code:
#!/usr/bin/perl Code:
#!/usr/bin/perl |
well, that's when you use strict
you need to declare variables, try my $name = <>; perldoc strict |
Actually, system() doesn't provide the output from the called prog.
Try backticks: my $result=`/dir/some.pl`; or you can use a piped open : http://perldoc.perl.org/IPC/Open2.html alternately, if the programs / functions are always associated with each other, but need to be in different files, eg you want 2nd prog to be usable by other programs as well, convert it to a Perl module. http://perldoc.perl.org/perlmod.html, specifically the section entitled 'Perl Modules' approx 2/3 down the page. |
Please check my code, something is wrong somewhere
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 08:34 PM. |