Two things need to note for unpack in Perl
In item 116 of the book ?"Effective Perl",author demonstrates how to use?unpack to process?fix-width?columnar data. I tried to write a toy code for practice,?and found two things need to note. First thing,?MUST use ?single quote ' ?before and after the format string,?or you'll get unexpected result,?because @xx can be parsed as an array in Perl if enclosed within double quote. Second thing,?format @xxx makes unpack move to specified position,NOTICE here unpack will work from position xxx+1,not position xxx. Code is as below.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |