The output I want is:my @bar = qw(One Two Three); my $foo = "bar"; print "***" . $foo . "***\n"; foreach my $baz (@$foo) { print $_ . "\n"; }
***bar*** One Two ThreeNow I tried $foo = \@bar, but I got the expected Array reference stuff when I printed it. Is there any easy way to keep $foo as a string and still be able to use to access the array or if I make $foo the array reference is there an easy way to get the sting bar from it? I'm also using v5.6.1 built for MSWin32-x86-multi-thread if that makes any difference. Thanks
In reply to Create an array reference from a string by xorl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |