in reply to How to pass array literal through pass by reference
You are mixing paradigms here. The easiest way to do what you want would be to insert your list into an anonymous array, i.e.:
WriteToFile([qw(abc 23343)]);
See perlref and Quote-and-Quote-like-Operators for details.
Update: Incidentally, the qw list generator does not function like you may think - it uses whitespace as a delimiter, so commas and quotes are treated as literals, likely not what you want (I don't know for certain, obviously.) This is discussed in the link above. If you don't want to think about that, you could just as easily say:
WriteToFile( ["abc", "23343"] );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to pass array literal through pass by reference
by pravlm (Acolyte) on Mar 16, 2009 at 20:08 UTC | |
by kennethk (Abbot) on Mar 16, 2009 at 20:29 UTC | |
by kyle (Abbot) on Mar 16, 2009 at 21:08 UTC |