http://qs321.pair.com?node_id=1064635


in reply to Variable number of foreach loops

Generally speaking, you use recursion for this, as BrowserUK did, often calling a separate subroutine (this is where you would put the print-statement) from the innermost iteration. A Perl subroutine can call itself any (reasonable) number of times.

Replies are listed 'Best First'.
Re^2: Variable number of foreach loops
by abhay180 (Sexton) on Nov 27, 2013 at 17:58 UTC
    Thanks