in reply to Doubt in usage of join function
Hello Perl_Programmer1992,
Your problem is not with the join function, but with the array assignment. The statement my @input = "1,2,3,4,5"; is not doing what you think it is. It is in fact assigning a single element to the @input array, namely the string "1,2,3,4,5".
If you want instead to assign 5 separate elements to the array, you have two options:
Note: a module such as Data::Dumper or Data::Dump is useful to show you the actual contents of an array (or hash), so you can easily check that its contents are what you expect them to be.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doubt in usage of join function
by Perl_Programmer1992 (Sexton) on Jan 07, 2019 at 07:22 UTC |