in reply to Help creating a function
Are you working on Perl? Above code snipped will not compile in Perl 5.
bless or eval may be of interest for you. If the data structure passed in arguemnts(e.g. $employeeData) has exactly the same structure as of the underlying object of the given package, you can directly bless it. If not, you'll have to first create some rules to set the properties of object from given data structure and then "eval"
The cost of genericness may be that you know the underlying structure of package and pass the correct arguments.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help creating a function
by varghees (Novice) on Feb 16, 2011 at 08:03 UTC |