[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: binary files in diff



"Jaldhar H. Vyas" <jaldhar@debian.org> wrote:

> On Thu, 9 Nov 2006, Frank Küster wrote:
>
>> Thank you, that's nice.  Oh, well, for the non-Perlmaniacs it might be
>> confusing that two functions are called after the other, and hard to
>> understand that print just prints the result of the pack or unpack
>> function.  Is
>>
>> perl -ne 'print(pack "u", $_);'
>>
>> better (and actually works always, not only with my test file)?
>>
>
> Yes I suppose that is more legible.  Don't forget to mention that $_
> has to become $$_ in a Makefile.  I remember that totally confused me
> when I first tried this and got weird errors.

In order to make that clear, I have added a complete Makefile snippet:

+<example>
+uuencode-file:
+    perl -ne 'print(pack "u", $$_);' $(file) > $(file).uuencoded
+
+uudecode-file:
+    perl -ne 'print(unpack "u", $$_);' $(file).uuencoded > $(file)
+</example>

Bug #397786

Thanks, Frank
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Reply to: