perl - Passing a reference and a string into a subroutine -


i'm trying pass reference array, , string function in form;

&function2(\g_array, "string"); 

in subroutine want deference array can evaluate/print it, when try complains can't map string array while using strict. best method this?

you forgot use strict in current scope. have warned you: bareword "g_array" not allowed.

if g_array function, \g_array parses \(g_array()). if isn't, parses \"g_array". passing reference string.

what wanted pass arrayref? include @ sigil in variable:

function2(\@g_array, "string"); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -