Re: problem using system()
- From: A Dude <jjcassidy@xxxxxxxxx>
- Date: Wed, 9 Apr 2008 06:48:29 -0700 (PDT)
On Apr 9, 8:42 am, mike <mikaelpetter...@xxxxxxxxxxx> wrote:
Hi,
I have the following string:
my $command = "$User_Preferences{"asadminexecutable"} deploy --user=
$User_Preferences{"user"} --passwordfile=
$User_Preferences{"passwordfile"} --host=$User_Preferences{"host"} --
port=$User_Preferences{"port"} $User_Preferences{"pathdeployunit"}";
system($command);
Global symbol "$command" requires explicit package name at
remote_deploy.pl line 55.
syntax error at remote_deploy.pl line 55, at EOF
Missing right curly or square bracket at remote_deploy.pl line 55,
within string
Execution of remote_deploy.pl aborted due to compilation errors.
Any ideas what I need to do to make it possible to execute the
command?
cheers,
//mike
Actually, what you have there is a _quoting_ problem.
First of all there is no reason to delimit hash keys with the double
quotes. But if you're going to do that, you shouldn't surround the
whole string literal with double quotes. Use single quotes
( $User_Preferences{'user'} -- if any -- $User_Preferences{user} --
works just fine. ) or surround the thing with the qq operator, to
allow for the embedded double quotes.
For more on qq: perldoc perlop
.
- References:
- problem using system()
- From: mike
- problem using system()
- Prev by Date: Re: SOAP
- Next by Date: Re: problem using system()
- Previous by thread: Re: problem using system()
- Next by thread: FAQ 9.4 How do I remove HTML from a string?
- Index(es):
Relevant Pages
|