in reply to Re^8: Read the lines until a string exists in the array
in thread Read the lines until a string exists in the array
To catenate to variables $v and $w, you write something like
In your case, you more likely want to append a variable (for example, a new author which you find on a new line), to an existing variable (for example, the variable containing the authors you already have encountered so far). In this case, you use the .= operator:my $catenated=$v.$w
One note on the side: May I ask you whether you have had already done any programming in whatever language before starting this project? Definitely no offense intended, but I get the impression that your primary problem is not so much related to Perl, but to programming as such, and if this is the case, you should say so; because in that case, we should approach the problem in general, by first discussing what algorithm to use in order to solve the problem (exressing the algorithm in high-level pseudo-code), and only THEN go ahead and translate it to Perl...my $string_of_authors .= $next_author;
|
|---|