On Wed, Feb 8, 2012 at 7:42 PM, Daniel Shahaf <danie...@elego.de> wrote: > Daniel Shahaf wrote on Thu, Feb 09, 2012 at 01:46:45 +0200: >> Jason Wong wrote on Wed, Feb 08, 2012 at 15:32:05 -0800:
>> Get xxd.exe from http://www.vim.org/ and cat.exe and sed.exe from >> http://gnuwin32.sf.net (or from Cygwin). Delete from the script the >> line that uses the 'head' command. > > There is a second use of 'head', which you shouldn't delete. So > instead, just get head.exe from the same place as the other two, or use > the following kind of statement: Or install CygWin and run the scripts from inside CygWin. This does present end-of-line issues, so be very careful about using "svn:eol native" properties. > > my $line = do { > open FOO, "perl -V 2>&1 |"; > <FOO>; > }; > > Lastly, there's a 'sed' invocation that uses single-quoted arguments. > All it does is "print the input up to the first empty line" --- feel > free to implement it differently. (One way: > > my @lines = split /\n/, `command | goes | here`; > $_ and print or last for @lines; > > Both of these examples could do with some error checking.) > > Daniel > (yes, there's also a neater way to do this without split(). but it's > not a Perl class here)