Re: 'sprintf' is not recognized as an internal or external command, operable program or batch file.
David Nicol <[email protected]> Fri, 8 Apr 2011 10:49:46 -0500
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
looks like you found a perfectly workable solution. Here's a more
complex way to do it without a named temporary variable:
=C2=A0 =C2=A0 =C2=A0$v =3D qx( @{[sprintf('%s --user=3D%s --password=3D%s =
version',
$mysqladmin , $opt->{'testuser'}, $opt->{'testpassword'}) ]} )
That's an instance of
qq/ @{[ code goes here ]} /
which is a very handy idiom in my experience, except of course when
you want to run the code in scalar (not array) context, in which case
the approach can be adapted in any of several ways, but usually at
that point I'll use a named temporary.
On Wed, Apr 6, 2011 at 5:11 PM, Leo Susanto <[email protected]> wrote:
> [ Huh? ]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0$v =3D qx( sprintf('%s --user=3D%s --password=
=3D%s version',
> $mysqladmin , $opt->{'testuser'}, $opt->{'testpassword'}) );
> [ doesn't DWIM.]
--=20
"If people let the government decide what foods they eat and what
medicines they take, their bodies will soon be in as sorry a state as
the souls who live under tyranny." -Thomas Jefferson (1778) (via Paleo
Approved fb feed)
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]