Juerd <[EMAIL PROTECTED]> wrote:
> Without introduction, I'll just present the syntax idea:
>
> f/%03d %15s/$foo, $bar/;
>
> Of course, this is s///-like in quoting behaviour, so f[][] or f"""
> should work just as well. The RHS is not a string, but parsed as an
> expression in list context. If this feels weird, just think of s///e,
> where the RHS is also not a string.
I think s///e is going away, since you can just use s/pattern/{code}/
now anyway.
Besides, I think "as" will do just fine, especially since you can now
interpolate method calls as well. You can even do something like this
if you want to perform bulk formatting:
say join ' ', ($n1, $n2, $n3) >>.as('%d');
Or, if that's not quite sufficient:
say map { .key.as(.value) }
$num => '%d',
$str => '%s',
...;
--
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker
"I used to have a life, but I liked mail-reading so much better."