Assigning scalars from a subroutine which returns an array in Perl -
i have perl subroutine returns array of vaules, , i'd call subroutine , capture values in individual scalar variables.
i know how when initializing group of scalars:
my ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea();
but i'm not sure how same set of scalars (since can't use 'my' again):
($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea();
thanks - i'm new @ perl.
alternatively can first define variables , later use them without my
:
my ($workbenchid, $woid, $wotrayid, $trayid, $customernumber); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea();
Comments
Post a Comment