Michael Maraist wrote:
> 
> >   my var; # declaring a scalar
> >   my array[]; # declaring an array
> >   my hash{}; # declaring a hash
> 
> Though the declarations seem fine, I assume that you propose this to be
> optional at usage time, since variable interpolations such as
> "xxx${var1}xxx${var2}xxx" really need the prefix.  One of the great
> strengths of perl is in fast and simple string manipulations.  Currently,
> it's unabiguous as to how here-document simpler strings get interpolated.
> Compare that to Java's:
>  "str" + var + "str"
>  or python's:
>  "xxx%sxxx" % var
> 
> -Michael

At interpolation time, I think you're explictly specifying the context
the variable is in, so the answer is "yes",
though you may also be trigger in the 'quote operator' to recognize
variable interpolation should be performed.

I think all of the following might work.

$x = "xx${var}yy";
$x = "xx$var\yy";
$x = "xx".var."yy";

and for the more complex variables, 
$x = "xx".@array."yy";
$x = "xx".array[]."yy";
$x = "xx".@array[]."yy";  # not so sure about this one.

# I'm not sure at all about these - I tend to avoid interpolation of
arrays and hashes for "safety"
$x = "xx@{array}yy"
$x = "xx{array[]}yy"

-- 
David Corbin            
Mach Turtle Technologies, Inc.
http://www.machturtle.com
[EMAIL PROTECTED]

Reply via email to