Hi Parag, It's probably not a good idea to do this kind of indirection anyway. You're better off using a hash; you don't know what you could be overwriting, depending on the input to foo_bar, and it creates a class of bugs you're better off avoiding worrying about.
See this well written article for more: http://perl.plover.com/varvarname.html The short answer to your question is yes. The longer answer is yes, because it's probably not a good idea. - Anneli 2011/11/5 Parag Kalra <paragka...@gmail.com> > Hi, > > I have a function which looks something like: > > sub foo_bar { > ${$_[0]} = new foo_bar ( > address => $_[1], > sudo => $_[3]', > id => $_[0] . '_' . $_[2], > ); > sleep 8; > > } > > When the code is executed, I get an error > > *Can't use string ("some") as a SCALAR ref while "strict refs" * > > This is resolved using - *no strict 'refs*'; > > Do we need to always use the above while using Perl variable indirection > - ${$_[0]} > > Parag >