[Gllug] Variadic arguments in perl

- Tethys tethys at gmail.com
Tue Oct 24 17:48:18 UTC 2006


I'm sure there's a trivial answer to this, but I'm buggered if I can
find it. In perl, I want to create a function that take a
printf()-like format specifier, and a variable number of subsequent
arguments. I want to sprintf() those arguments into a string, which I
then do some other stuff with later in the function. The thing I can't
get to work is passing those arguments into sprintf(). The naive
approach of:

$str = sprintf(@_);

doesn't work. Any ideas?

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list