Re: removing extra empty lines

2002-09-30 Thread Smylers
Vladi Belperchinov-Shabanski wrote: #!/usr/bin/perl -p $_='' if !/\S/ $e; # i.e. don't print if empty and last one was empty $e = !/\S/; # remember if last one is empty... #eof Reading in a paragraph at a time rather than a line at a time helps here. Perl's idea of a

TPJ is back (almost)

2002-09-30 Thread Andy_Bach
I imagine most of you've heard this, but it certainly was the most 'fun' magazine I ever got in the mail (well, w/o the obscuring wrapper) : The Perl Journal?Back in Business! Since 1996, The Perl Journal has been the definitive publication for and about Perl programming. Now as a monthly

Content-type:image/gif\n\n problem

2002-09-30 Thread Davide Copelli
I am using this script to print an image using img tag print Content-type:image/gif\n\n; gifdata = `cat $giffile`; print gifdata; The problem is that it works on unix but not on windows operating sistem Can someone give me an altenative way to print an image without extra perl modules ?

Re: Content-type:image/gif\n\n problem

2002-09-30 Thread Philippe 'BooK' Bruhat
On Mon, 30 Sep 2002, Davide Copelli wrote: I am using this script to print an image using img tag print Content-type:image/gif\n\n; gifdata = `cat $giffile`; print gifdata; The problem is that it works on unix but not on windows operating sistem Fun aswer: s/cat/type/ A little more

Re: Content-type:image/gif\n\n problem

2002-09-30 Thread David Henderson
On Mon, Sep 30, 2002 at 05:05:31PM +0200, Davide Copelli wrote: I am using this script to print an image using img tag print Content-type:image/gif\n\n; You should have a space between the colon and the i: print Content-type: image/gif\n\n; gifdata = `cat $giffile`; print gifdata;

Re: Content-type:image/gif\n\n problem

2002-09-30 Thread csaba . raduly
On 30/09/2002 16:20:25 Philippe 'BooK' Bruhat wrote: On Mon, 30 Sep 2002, Davide Copelli wrote: I am using this script to print an image using img tag print Content-type:image/gif\n\n; @gifdata = `cat $giffile`; print @gifdata; The problem is that it works on unix but not on windows

Re: removing extra empty lines

2002-09-30 Thread Aristoteles Pagaltzis
* Vladi Belperchinov-Shabanski [EMAIL PROTECTED] [2002-09-30 19:24]: $_='' if !/\S/ $e; # i.e. don't print if empty and last one was empty $e = !/\S/; # remember if last one is empty... Since you have already done $_='' in the first line, you don't need a regex in the

Re: removing extra empty lines

2002-09-30 Thread Yanick
On Mon, Sep 30, 2002 at 08:06:55PM +0200, Aristoteles Pagaltzis wrote: perl -pe'!/\S/?($e++and$_=):($e=0)' filename perl -pe'/\S/?($e=0):($e++and$_=)' filename :) Joy, `/anick -- Comedy is an escape, not from truth but from despair; a narrow escape into faith.-- Christopher Fry

Re: removing extra empty lines

2002-09-30 Thread Peter B. Ensch
Uri Guttman wrote: Y == Yanick [EMAIL PROTECTED] writes: no one seems to have seen my earlier post on this so here it is again and it is much shorter. Y perl -pe'/\S/?($e=0):($e++and$_=)' filename perl -0777pe's/^\s*\n/\n/m' file This didn't work as is. It

Re: removing extra empty lines

2002-09-30 Thread Yanick
On Mon, Sep 30, 2002 at 02:51:54PM -0400, Uri Guttman wrote: Y == Yanick [EMAIL PROTECTED] writes: no one seems to have seen my earlier post on this so here it is again and it is much shorter. Y perl -pe'/\S/?($e=0):($e++and$_=)' filename perl -0777pe's/^\s*\n/\n/m'

Re: removing extra empty lines

2002-09-30 Thread Uri Guttman
PBE == Peter B Ensch [EMAIL PROTECTED] writes: PBE Uri Guttman wrote: Y == Yanick [EMAIL PROTECTED] writes: no one seems to have seen my earlier post on this so here it is again and it is much shorter. Y perl -pe'/\S/?($e=0):($e++and$_=)' filename perl

Re: Content-type:image/gif\n\n problem

2002-09-30 Thread Bart Lateur
On Mon, 30 Sep 2002 16:27:58 +0100, [EMAIL PROTECTED] wrote: Would it include binmode() ? Most definitely. -- Bart.