BUU has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl sub foo :lvalue { if( $_[0] ) { $bar } else { $baz } } foo($ARGV[0]) = 32; print "Bar: $bar, Baz: $baz\n"
buu@its01:~$ perl test.pl 1 Bar: 32, Baz:
Anyone know whats happening here?buu@its01:~$ perl test.pl 0 Can't return a temporary from lvalue subroutine at test.pl line 15.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Oddness with lvalue and if/else blocks
by Zaxo (Archbishop) on Sep 09, 2004 at 01:52 UTC | |
by Aristotle (Chancellor) on Sep 09, 2004 at 07:47 UTC | |
|
Re: Oddness with lvalue and if/else blocks
by Aristotle (Chancellor) on Sep 08, 2004 at 23:43 UTC | |
by diotalevi (Canon) on Sep 09, 2004 at 02:08 UTC |