On Friday, May 24, 2002, at 11:18 , Michael Fowler wrote:
> On Thu, May 23, 2002 at 05:07:38PM -0700, drieux wrote: >> On Thursday, May 23, 2002, at 04:57 , Michael Fowler wrote: >>> perl -O777pi~ -e's^/usr/local^/tmp/local^g' mybinaryfile.out >> >> that's what I was afeared of... had that coffee break moment >> later on that evening.... since in 'binary' mode - isn't >> the above essentially slurping it all in as one long scalar??? first things first! Thank you! > No, binmode has nothing to do with slurping anything. It simply tells the > OS to treat the file as binary, i.e. "don't translate newlines". This is > all covered in the documentation. OYE! where was the coffee when I needed it... I normally read that and skip right over the top because of the 'most likely not required in *nix'..... { my apologies for the intrinsic *nix prejudices here... It's My Home Turf } > The thing causing it to slurp the entire file is the -0777. If you don't > want it to do that, pick a different seperator. Alternately, the file can > be read in chunks, rather than split on an arbitrary character. I will confess that this whole 'pie' trick 'worries me' - since I have all too often found that 'If I did that once at the command line - it is time to script it and forget it'.... { that is how I bred a whole suite of 'OpsTools' while waiting for the 'realCoders[tm]' to provide the canonical 'Operational Interface'.... } So I will defer to the Wizards of Wonder Here, who can perl at the command line their best golf strokes.... Dr. Strych9 introduced me to the fact that One can do some of these 'pie' ticks - since he freaks because from time to time I just whack the # cmd | [awkIsh|sedIsh|grepIsh] [| otroCmd] stuff and he thought I should know how to do that stuff for these 'one off cases'... but then again - I was sedding before there was Perl - so I never understood the 'perl is easier than sed and awk'..... By Perl 5 - the other stuff in perl makes it clearly worth the nickle.... So... For the Younger Generation - you know, people who think that there is 'music' AFTER 'dark side of the moon' by Pink Floyd.... Maybe....[1] Note: I have opted to cc the list since, you are way too correct that this sort of dialog will be of use to others. [..] ciao drieux --- [1] Children Let us NOT fall into temptation here.... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]