Re: string retrieval issue



Ben Morrow schreef:
mbliven1:

if ($formvalue eq "") {
@final[$i] = @splitdata[$i];
}
else {
@final[$i] = $formvalue;
}

This can be written more simply as

$final[$i] = $formvalue || $splitdata[$i];

Unless $formvalue can be "0".

--
Affijn, Ruud

"Gewoon is een tijger."
.



Relevant Pages

  • Re: looping issue
    ... Ben Morrow schreef: ... chomp $line; ... "Gewoon is een tijger." ...
    (comp.lang.perl.misc)
  • Re: best method to perform operations on word lists
    ... because the regex matches the empty string as well. ... "Gewoon is een tijger." ...
    (comp.lang.perl.misc)
  • Re: string matching doesnt work
    ... @c = qw(abc de fghi); ... "Gewoon is een tijger." ... I used Mirco Wahab's solution and it worked for some of the cases but ...
    (comp.lang.perl.misc)
  • Re: Adding hashes
    ... Your 'apples pears' communicated the opposite. ... "Gewoon is een tijger." ...
    (comp.lang.perl.misc)
  • Re: Perl - Joining of Binary values
    ... "Gewoon is een tijger." ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ... For additional commands, e-mail: beginners-help@xxxxxxxx ...
    (perl.beginners)