|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I have a function that has several variables called $val1, $val2, ... , $val10.
In the function, I call another function that does work on each of the variables i.e. printOp ($val1) printOp ($val2) ... printOp ($val10) ------------------------------------- Is there any way to do this using a loop? i.e. for ( $i = 0 to 10 ) printOp ( $val$i ) } |
|
#2
|
|||
|
|||
|
For one, instead of assigning all you variables to seperate scalars, you could push them onto an array and create a loop to process through that array.
__________________
- dsb - ![]() Perl Guy |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > variable interpolation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|