jryan has asked for the wisdom of the Perl Monks concerning the following question:
I want my overloaded operator sub join to return the array @meep, so I can access it in main. What needs to be the return value of the sub for this to work?
package aniftypackage; use overload ("." => "join_files"); # assume a working new sub is here; sub join { @meep = ("meep1", "meep2"); return @meep; } package main; $foo1 = new aniftypackage; $foo2 = new aniftypackage; $foo1 = $foo1.$foo2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning an array from a sub in a package
by japhy (Canon) on Aug 24, 2001 at 03:33 UTC | |
by jryan (Vicar) on Aug 24, 2001 at 04:07 UTC | |
by japhy (Canon) on Aug 24, 2001 at 04:09 UTC |