perl - parsing values into array -


i have simple question, think, can't find solution it.
simple perl script prints out following line "tests - blub" "tests - blub - abc" , assign variable var=$(perl ...), why can't parse array vararray=( $var ) , command vararray=( "tests - blub" "tests - blub - abc" ) works?

the expected result should this:

tests - blub tests - blub - abc 

and not this:

"tests - blub" "tests - blub - abc" 

thanks advices.

here's doodling:

$ bash $ a='"tests - blub" "tests - blub - abc"' $ ary=( $a ); echo ${#ary[@]} 8 $ ary=( "$a" ); echo ${#ary[@]} 1 $ eval ary=( $a ); echo ${#ary[@]} 2 

clearly 3rd result want. when populate variable output of perl script, double quotes within have no special meaning shell: they're characters. have shell parse (with eval) meaning exposed.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -