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
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
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 ?
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
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;
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
* 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
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
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
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'
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
On Mon, 30 Sep 2002 16:27:58 +0100, [EMAIL PROTECTED] wrote:
Would it include binmode() ?
Most definitely.
--
Bart.
12 matches
Mail list logo