in reply to Re: Strings overwrite themselves in print command
in thread Strings overwrite themselves in print command

Bill,

I like the simplicity in this approach. I haven't learned enough perl to come up with this myself so thanks for stretching my understanding. However, I am seeing an error when I apply this code:

Not enough arguments for unpack at script.pl line 64, near "'@12A6';"

Not certain what this means.

  • Comment on Re^2: Strings overwrite themselves in print command

Replies are listed 'Best First'.
Re^3: Strings overwrite themselves in print command
by choroba (Cardinal) on Jun 28, 2016 at 08:59 UTC
    It means your Perl is ancient and doesn't support the default second argument. Use
    my ($memID) = unpack '@12A6', $_;

    instead.

    Update: The change happened in 5.10 (2007), see Miscellaneous.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,