Laborious and probably Over-the-Top(TM) but here it is...
#!/usr/bin/perl @nums=(10,32,33,74,97,99,101,104,107,108,110,111,112,114,115,116,117); @order=(4,17,15,16,2,5,11,12,16,8,7,14,2,13,7,14,10,2,8,5,6,9,7,14,3,1 +); foreach $line (@order) { print pack("C",$nums[$line-1]); }
Don't kill me - this is my introductory post. I'm new.

aZ.

Replies are listed 'Best First'.
Re: yaJAPH
by blakem (Monsignor) on Aug 13, 2001 at 12:24 UTC
    Pretty good, though you might want to rid yourself of those helpful variable names. Could also muddy up your data with obscure calculations. Finally make that loop a little less "text-book"... This should get you started:
    #!/usr/bin/perl @a=(10,32,33,74,97,99,101,104,107,108,110,111,112,114,115,116,117); @b=(4,17,15,16,2,5,11,12,16,8,7,14,2,13,7,14,10,2,8,5,6,9,7,14,3,1); print pack("C",$a[--$_]) for(@b);

    -Blake

      Ta Muchly. I'm relatively new to perl so I'm just learning all the odd stuff. aZ.
Re: yaJAPH
by Anonymous Monk on Aug 13, 2001 at 18:25 UTC

    If you decrease all your numbers in @order by one, you can replace the loop with print pack 'C*', @nums[@order].

    You could probably also get some more obfuscation by not mentioning all numbers explicitly but using ranges such as 101..117 and picking out just the ones you need.

      I like the range idea... How about leaving the @order numbers alone and using map:

      print pack 'C*', @nums[map {--$_} @order];
      Or in my naming
      print pack'C*',@a[map{--$_}@b];
      Ha, compare that with the original loop!

      -Blake