You nailed it on the head. To learn more about subroutines read "perldoc perlsub". When you want to know what a command does type "perldoc -f command". For instance perldoc -f sub returns sub BLOCK sub NAME sub NAME BLOCK This is subroutine definition, not a real function per se. With just a NAME (and possibly prototypes or attributes), it's just a forward declaration. Without a NAME, it's an anonymous function declaration, and does actually return a value: the CODE ref of the closure you just created. See the perlsub manpage and the perlref manpage for details. On 21 Jun 2001 15:00:17 +0100, [EMAIL PROTECTED] wrote: > Hi All, > > Can you tell me what this sub is. Is it sub routine ? > > Regards, > Elaine. > > > local(@acc_fields) = @_; > return(-810) if ( $acc_fields[0] == 0 || $acc_fields[0] eq '' ); > return(-811) if ( $acc_fields[1] eq "" ); > return(-812) if ( $acc_fields[2] eq "" ); > return(-813) if ( $acc_fields[7] < 0 ); > $acc_fields[8] = &get_date if ( $acc_fields[8] eq '' ); > > return(&send_ddc("tdilc5110b000","accum_cycle_count",@acc_fields)); > } > > sub ilc_cycle_counting > { > # @icc_fields are: > # 0 - Cycle Counting Order > # 1 - Warehouse > # 2 - Location > # 3 - Item Code > # 4 - Container > # 5 - Lot Code > # 6 - Storage Unit > # 7 - Counted Inventory > # 8 - Counting Date > > local(@icc_fields) = @_; > return(-810) if ( $icc_fields[0] == 0 || $icc_fields[0] eq '' ); > return(-811) if ( $icc_fields[1] eq "" ); > return(-812) if ( $icc_fields[2] eq "" ); > return(-813) if ( $icc_fields[7] < 0 ); > $icc_fields[8] = &get_date if ( $icc_fields[8] eq '' ); > > return(&send_ddc("tdilc5110b000","ilc_cycle_counting",@icc_fields)); > } > > # > ----------------------------------------------------------------------------- > # called from ccount form to ensure wharehouse/order combination is valid > # > ----------------------------------------------------------------------------- > > sub validate_whse_order > { > local($whse) = $_[0]; > local($corder) = $_[1]; > > return if ($whse eq ""); > return if ($corder eq ""); > > &display_status("Checking Order..."); > $select = "SQL$;VALCCORDER$;${company}$;N$;$;${corder}$;${whse}"; > return(&send_dc($select)); > } > > sub item_loc_on_ccorder > { > my($item,$loc,$corder) = @_; > > return if ($item eq ""); > return if ($loc eq ""); > return if ($corder eq ""); > > &display_status("Checking Item/Loc..."); > $select = "SQL$;ITMLOCCCORDER$;${company}$;N$;$;${corder}$;${item}$; > ${loc}"; > return(&send_dc($select)); > } # item_loc_on_ccorder > > sub get_ccorder_item_date > { > my($item,$location,$order,$warehouse,$lot) = @_; > > &display_status("Checking Item/Loc..."); > $select = "SQL$;CCORDERDATE$;${company}$;N$;$;${order}$;${warehouse}$; > ${location}$;${item}$;${lot}"; > ### return(&send_dc($select)); > $return = &send_dc($select); > ($cdate) = split($;,$err_msgs[0]); > if ( $return == 1 ) > { > return 0; > } > else > { > return 1; > } > } # > > 1; > > > > -- Today is Boomtime, the 26th day of Confusion in the YOLD 3167 P'tang!