Hi Cai,
You try to get the first command line argument with $ARGV[0] contains in array @ARGV.
I think for your function you should use "@_" or "shift" to get the function passed arguments.
my ($command_line) = @_; # precise more variable for several arguments or my $command_line = shift;
Olivier Renard
Cai, Lixin (L.) wrote:
Now I am meeting the problem: my codes is like:
************************************************** $ldapsearch="/usr/bin/ldapsearch"; my $command = "$ldapsearch -x -LLL -h \"cds2.ford.com\" -b \"ou=People, o=Ford,c=US\" \"uid=$login\" uid fordUNIXid"; print "print A ---------- $command"; @verifyinfo = ldapsearch_result ($command);
sub ldapsearch_result { my $command_line = $ARGV[0]; print "print B --------- $command_line\n"; } ************************************************
Print A I got:
/usr/bin/ldapsearch -x -LLL -h "cds2.ford.comi" -b "ou=People, o=Ford,c=US" "uid=ldapdb3" uid fordUNIXid
Print B I got nothing
I do not understand that I have content in $command, why I get not get it in the method? I am working on linux.\ Could anyone tell me why?
Thanks a lot in advance!!!!
Lixin
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs