in reply to I dont understand what it is doing....

Regardless of the errors that hinder this code from working and which have been duly explained to you, the subroutine in here has a prototype checking mechanism in place, however, this mechanism is a compile-time mechanism, so to avail of it you got to declare your subroutine and then call it afterwards, if you do it the other way around, i.e you wrote the subroutine call before defining it the prototype checking would simply get ignored and the subroutine would get executed as long as it is free from other errors (logic, syntax, keyword misspelling...).

What this code above is supposed to be doing? , well, the subroutine named "query" has been declared, then when you call it and simultaneously provide arguments, it goes checking if these arguments correspond to the prototype predeclared.

After that each one of the arguments is read into the variables "$name, $type, $comb, @vals" and in the subsequent line @vals contents are modified via the map function and reassigned to @vals again.

The subroutine returns a string of @vals elements enclosed within () and joined together with '=' sign.

Welcome to the Monastery noobie82, familiarize yourself around and make a good use of the Perl documentations...


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.