[Melbourne-pm] Pls explain?

Brendon Oliver brendon.oliver at gmail.com
Tue Oct 23 17:50:44 PDT 2007


On Wednesday 24 October 2007 10:34:50 you wrote:
> >
> >     my $job_name = "backfill_" if $backfill;
>
> This line above is like writing:
>
> 	my $a if $b;
>
> So the lexical variable $a only springs into existence if $b is true. 
> Therefore (since $backfill isn't true)
>
> >     $job_name .= "migrate_$n";
>
> this must be the global $job_name; hence the behaviour you see.  

Yes, but with 'use strict', where is this "global" $job_name declared? (there 
is none at the main:: scope) That's the bit that was puzzling me...

> There is a 
> (lame) excuse for why you don't get strict errors and warnings, but I don't
> remember what it is, and personally I think it's a bug.

:-)

> You can fix get_name_1 by doing:

Yep, already did a similar work-around.  

Anyways, no big drama - just sort of an itch I couldn't scratch because I 
hadn't come across this before.

Thanks for the reply tho.

regards,

- Brendon.

-- 
Optimism is the content of small men in high places.
		-- F. Scott Fitzgerald, "The Crack Up"

 10:46:07 up 8 days, 22:11,  3 users,  load average: 0.04, 0.17, 0.18



More information about the Melbourne-pm mailing list