Page 1 of 1

Please refer to notes we discussed in week-9 class to complete this assienment Create a subroutine without a prototype.

Posted: Thu Jul 14, 2022 2:28 pm
by answerhappygod
Please refer to notes we discussed in week-9 class to complete this assienment
Create a subroutine without a prototype. Make it print the number of arguments, and the
value of its first argument. Call it with:
• a scalar
• Two scalars
• An array with 4 elements
• A hash with 3 key/value pairs
Desired Output:
No. of args: 1;
first arg: text
No. of args: 2;
first arg: 1 No.
of args: 4;
first arg:
5 No.
of args: 6;
first arg: local
Write a program with a subroutine which takes a variable number or parameters (no
prototype. The urst is a scalar, and the others are named' parameters which all have the
following defaults:
Parameter
owner
same
color
Default Value
undef
Untitled
Black
Weave
width
background
White
Call the function, supplying the first scalar (any text), and values for the name, colour, and width
parametere oniv. Print out the tina values of all parameters In the sunroune
Desired Output:
Scalar: ZZZ
background param: White
colour param:
Red
width param: 2
name param: Label
No owner param specified
texture param: weave