On Monday 30 July 2001 05:37 am, Me wrote:
> In a nutshell, you are viewing:
>
> foo if bar;
>
> as two statements rather than one, right?
>
Yep. The 5.7 docs explain it rather well, I think. Too bad I didn't read
them until *after* I had posted and taken off for work.
--
Bryan C. Warnoc
> Out of morbid curiosity (since I'm working on documentation), given the
> program that the following program generates:
>
> #!/your/path/to/perl -w# perl 5.6.1
> my @l = ('a' .. 'g');
> my $my = 0;
>
> for my $v (@l) {
>my @a = map { "\$$v .= '$_'" } @l;
>$a[$my++] = "my $a[$my]"
In a nutshell, you are viewing:
foo if bar;
as two statements rather than one, right?
Personally, I think it's more natural to view the above as one
statement, so any my anywhere in one element of it does not
apply to other elements of it.
Yes, this is semi-related to the 'my $a if 0;' behavior.
Out of morbid curiosity (since I'm working on documentation), given the
program that the following program generates:
#!/your/path/to/perl -w# perl 5.6.1
my @l = ('a' .. 'g');
my $my = 0;
for my $v (@l) {
my @a = map { "\$$v .= '$