in reply to Re^8: Writing an array inside an array
in thread Writing an array inside an array

Would you recommend me using $graph or @graph?

Use the @ sigil. It gives you several advantages: it behaves sensibly in scalar context, and the syntax for working with it less convoluted than reference syntax.