AW: 'sprintf' is not recognized as an internal or external command, operable program or batch file.

"Selke, Gisbert W." <[email protected]> Thu, 7 Apr 2011 10:12:03 +0200
Newsgroups gmane.comp.db.mysql.perl
Message-ID <DA5D2621C9566F488C32ACE506A7BB8901A3076F@wido-exch01.wido.bv.aok.de>
Hi Leo --

The qx operator, according to the Perl docs, takes "A string which is =
(possibly) interpolated and then executed as a system command with =
/bin/sh or its equivalent". So you're asking your shell to do a sprintf. =
Since you seem to be working under Windows, this is equivalent to you =
typing "sprintf(blah)" at the Windows (aka "DOS") command prompt (try =
it!). The error message you get has nothing to do with Perl at all, it's =
just that you're asking your shell something that the shell does not =
know how to do.

In any case, it's probably not what you want to do anyway. What you want =
to do is what you describe in the second part of your mail. And that =
does work indeed, as you say.=20

\Gisbert

> -----Urspr=FCngliche Nachricht-----
> Von: Leo Susanto [mailto:[email protected]]=20
> Gesendet: Donnerstag, 7. April 2011 00:11
> An: [email protected]
> Betreff: 'sprintf' is not recognized as an internal or=20
> external command, operable program or batch file.
>=20
>=20
> Hi,
>=20
> I am trying to make the makefile with the option of inserting
> testuser, testpassword and testhost into "perl.exe Makefile.PL"
> command line, but I keep getting "'sprintf' is not recognized as an
> internal or external command, operable program or batch file."
>=20
> C:\CPANTesters\Perl5.10.0\cpan\build\DBD-mysql-4.018-d8v5HG>perl.exe
> Makefile.PL INSTALLDIRS=3Dsite --testuser=3Dcpantesters
> --testpassword=3Dcpantesters --testhost=3Dlocalhost
> 'sprintf' is not recognized as an internal or external command,
> operable program or batch file.
> Problem running C:\CPANTE~1\bin\MYSQL-~1.11-\bin\MYSQLA~1.EXE=20
> - aborting ...
>=20
> I trace it down and this is the part of Makefile.PL that doesn't work.
>=20
>     my $v;
>     if ( defined $opt->{'testuser'} and defined=20
> $opt->{'testpassword'}) {
>         $v =3D qx( sprintf('%s --user=3D%s --password=3D%s version',
> $mysqladmin , $opt->{'testuser'}, $opt->{'testpassword'}) );
>     } else {
>         $v =3D qx($mysqladmin version);
>     }
>=20
> Taking the sprintf() out of qx() works.
>=20
>     my $v;
>     if ( defined $opt->{'testuser'} and defined=20
> $opt->{'testpassword'}) {
>         my $line =3D sprintf('%s --user=3D%s --password=3D%s version',
> $mysqladmin , $opt->{'testuser'}, $opt->{'testpassword'});
>         $v =3D qx( $line );
>     } else {
>         $v =3D qx($mysqladmin version);
>     }
>=20
> I can reproduce this on the latest ActiveState Perl 5.12.3 (1204) too.
>=20
> --=20
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe:   =20
> http://lists.mysql.com/[email protected]
>=20
>=20

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]