Scott Taylor wrote: > Hey all, > > I have a small array with field names that I would like to store them in a > string so that I can include it in an SQL string later. > > ie: > @Fields = ("field1","field2","field3"); > > I want $SQLFields = "field1,field2,field3"; > > of course $SQLField = "@Fields"; returns the list "field1 field2 field3", > how can I change the white spaces to commas? >
you get space because by default it prints whatever is set in $" between your array element: $" = ','; print "@Fields"; #-- will give you , instead. a better way is: print join(',',@Fields); where "@Fields" calls implicitly with $" david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]