Yes, "sub" denotes a "subroutine".
Syntax:
sub name {
command;
command;
command;
}
You call it like this:
name(arg1,arg2);
I highly recommend picking up a copy of "Learning Perl" which explains this
in great detail.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 10:00 AM
Subject: SUB ?
> 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;
>
>