hi,
i'm having trouble with concatenation in perl. What I need to do is put the input of a file into an array. Then I want to join certain indices in the array. For example:
open FILENAME, "testtest";
@mylist = <FILENAME>;
close FILENAME;
$temp = @mylist[0] . @mylist[1];
print "$temp";
The filename testtest contains these strings:
1
asdf
asdf
but when i run the code, this is want happens:
Result:
1
asdf
#an empty line
Expected Result:
1asdf
What am I doing wrong?
thanks,
gammaman
i'm having trouble with concatenation in perl. What I need to do is put the input of a file into an array. Then I want to join certain indices in the array. For example:
open FILENAME, "testtest";
@mylist = <FILENAME>;
close FILENAME;
$temp = @mylist[0] . @mylist[1];
print "$temp";
The filename testtest contains these strings:
1
asdf
asdf
but when i run the code, this is want happens:
Result:
1
asdf
#an empty line
Expected Result:
1asdf
What am I doing wrong?
thanks,
gammaman