hi i have a sprintf which uses a scalar as its format: my $Bformat = "%1\$s16-> %2\$s16 %3\$s16 %4\$s16 %5\$s16 %6\$s16-> %7\$s16 %8\$s16"
what i would like to do is generate a new format for the sprintf by doing permutations of 5 arrays like this: my @phraseA = qw( %1\$s16-> %2\$s16-> %3\$s16-> ); my @phraseB = qw( %4\$s16 %5\$s16 %6\$s16-> ); my @phraseC = qw( %7\$s16 %8\$s16 %9\$s16 ); my @phraseD = qw( %10\$s16-> %11\$s16 %12\$s16 ); my @phraseE = qw( %13\$s16 %14\$s16 %15\$s16-> ); my @phrasegroup = ([...@phrasea], [...@phraseb], [...@phrasec], [...@phrased], [...@phrasee]); my @phraseperm = map {...@$_} permute(@phrasegroup); #flatten permutation array my @Bformat = map { @$_ } @phraseperm; but when i do this i get : Invalid conversion in sprintf: "%\" at score-generator11.pl line 53. so i thought maybe i needed to turn the array into a scalar: #my $test = join(" ",@Bformat); but that gave the same error any ideas what i am doing wrong? thanks rob -------------- r...@goto10.org rob.goto10.org --------------
signature.asc
Description: Digital signature