perl - How to print the array element values in array order? -


How to print array values ​​in order of array elements?

  @ ab = & lt; Statistics & gt; Print "@ab \ n"; @ A = QW (ABCD); Forex $ s (@ab) {foreach $ m (@a) {$ z = ~ m / $ m / g; Print "$ z"; }} __DATA__D43A5B24D4A12B 54C11A1D13232Isi / DTADD43A5B24D4A12B 54C11A1D1 32 32First> First value of the first array array element is printed on the second and so on. How can I do this?   

Your external loop should loop at @ A and @ Ab

  my @ ab = & lt; Data & gt ;; My @ A = QW (ABCD); Do your $ S (@Ab) before your $ M (@ A) {print $ s if $ s = ~ / ^ $ m /; }} __DATA__D43A5b 24d4a12b 54c11a1d132bbx  
  one 5 a12 a1 32b 24b 54 c 11d 43d 4D1  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -