why can't I collapse reference variables?
[email protected] (Mark_Galeck) Fri, 27 Nov 2009 19:48:09 -0800 (PST)
| Newsgroups | perl.scripts |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <1ea17ca2-142e-4595-be28-a9325e6e7e1c@b36g2000prf.googlegroups.com> |
Hello, the following question I posted on perl.beginners but for a few days there is no response, so maybe it is not a beginners question? Nah, it must be :) -------------------------------- If I can do this: $ref = \@foobar; print @$ref; then why can't I do this: print @\@foobar; ------------------------------------ I have this kind of problem often, let me give another example, I think it is similar, let me know if not. Why are all the printouts different: @foobar = (); print \@foobar; #prints as reference to ARRAY $foobar = \(); print $foobar; # prints as reference to SCALAR print \(); #prints as array of references to SCALAR, in this case empty array