Can I break my Perl regex into multiple lines in my code?

前端 未结 3 1412
野性不改
野性不改 2021-01-17 08:52

I was just wondering if I am able to break up a long regular expression that I have in my Perl code so that it is written over several lines? I just want the readability an

3条回答
  •  Happy的楠姐
    2021-01-17 09:12

    Use the + symbol. Here is example:

    push @steps, $steps[-1] +
            $radial_velocity * $elapsed_time +
            $orbital_velocity * ($phase + $phase_shift) -
            $DRAG_COEFF * $altitude;
    

提交回复
热议问题