[plug] [OT]how to do this in perl?

Michael Holland myk at westnet.com.au
Thu Aug 12 12:04:19 WST 2004


On Thu, 12 Aug 2004 simon at plumtek.com wrote:

> Anyhoo, I dont really want to post code since its part of a small 'tiny code'
> competition we've got going at work :)

Ah! Well, that rather changes the answer, which was going to be why you
shouldn't be using $_ .
  I dont think its possible in perl. I just tried $::_ .
Camel book says such scoped variables hide their namesakes.

> at the moment Im assigning a string to a variable, and then appending to that
> variable in the for loop - I just thought I could make it shorter by using $_
> instead of $a..... eg at the end I do a 'print $a;' and that could become just
> 'print;' etc


--
The best things in life go on sale sooner or later.



More information about the plug mailing list