Re: passing hash to a subroutine

2002-07-11 Thread Jenda Krynicky
From: George Schlossnagle <[EMAIL PROTECTED]> > The last item that you pass to a perl subroutine can be a array or a > hash, but none but the last, since oerl will greedy-match your arrays > when you assign them in your subroutine. The way around this is to > pass them in by reference: > > ($row

Re: passing hash to a subroutine

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, rory oconnor said: >Is it possible to pass a hash into a subroutine to be used as a local >variable? I'm trying to do this: The arguments sent to a function are flattened into one big list. There's no way to know where your array ends and your hash begins. Furthermore, doing $x

Re: passing hash to a subroutine

2002-07-11 Thread George Schlossnagle
The last item that you pass to a perl subroutine can be a array or a hash, but none but the last, since oerl will greedy-match your arrays when you assign them in your subroutine. The way around this is to pass them in by reference: ($rows, %results) = &Select($mytable, $where_f1, $compare1,

passing hash to a subroutine

2002-07-11 Thread rory oconnor
Is it possible to pass a hash into a subroutine to be used as a local variable? I'm trying to do this: ($rows, %results) = &Select($mytable, $where_f1, $compare1, $where_v1, @quick_check, %field_values); sub Select { my($db_table, $where_field, $comparison, $where_value,@fieldlist, %values) = @