[30473] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1716 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 13 18:09:52 2008

Date: Sun, 13 Jul 2008 15:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 13 Jul 2008     Volume: 11 Number: 1716

Today's topics:
        Apparent bug in Perl 5.10 regexes w. UTF-8 expression <benkasminbullock@gmail.com>
    Re: Apparent bug in Perl 5.10 regexes w. UTF-8 expressi <hjp-usenet2@hjp.at>
    Re: Apparent bug in Perl 5.10 regexes w. UTF-8 expressi <ben@morrow.me.uk>
    Re: FAQ 1.1 What is Perl? <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: FAQ 1.12 What's the difference between "perl" and " <willem@stack.nl>
    Re: FAQ 1.12 What's the difference between "perl" and " <glennj@ncf.ca>
    Re: How can I use constants? <joe@inwap.com>
    Re: How can I use constants? <glennj@ncf.ca>
    Re: How can I use constants? <hjp-usenet2@hjp.at>
    Re: how do prlglobs expand (was Re: 'nobody' using sudo <joe@inwap.com>
    Re: how do prlglobs expand (was Re: 'nobody' using sudo <someone@example.com>
    Re: how do prlglobs expand (was Re: 'nobody' using sudo <ben@morrow.me.uk>
    Re: how do prlglobs expand (was Re: 'nobody' using sudo xhoster@gmail.com
        Odd error message on open()-ing scalar ref <JustMe@somewhere.de>
    Re: Odd error message on open()-ing scalar ref xhoster@gmail.com
    Re: Odd error message on open()-ing scalar ref <mjcarman@mchsi.com>
    Re: printing envelops from perl <joe@inwap.com>
    Re: printing envelops from perl <rvtol+news@isolution.nl>
    Re: printing envelops from perl <bill@ts1000.us>
    Re: remove previous lines of a log file <daveb@addr.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 13 Jul 2008 14:14:06 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Apparent bug in Perl 5.10 regexes w. UTF-8 expression
Message-Id: <g5d2je$4k0$1@cgi-ml.accsnet.ne.jp>

I've found a place where Perl seems to behave differently depending on 
whether something is marked as UTF-8 or not, regardless of the fact that 
it is just ASCII.

In the following code snippet,

#!/usr/local/bin/perl -lw
use strict;
use Encode 'decode';
use Lingua::JA::FindDates 'subsjdate';
binmode STDERR,"utf8";
binmode STDOUT,"utf8";
print STDERR "first try\n";
my $test = "ABCDEFG";
print subsjdate($test);
print STDERR "now try again\n";
$test = decode ('utf8', $test);
print subsjdate($test);

the output is like this:

ben ~ 541 $ ./test2.pl 
first try

Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
ABCDEFG
now try again

ABCDEFG
ben ~ 542 $ 

But, if I 

use utf8;

and call the routine with a non-ascii string, like 平成, I don't get the 
error messages.

What's more, after about one hour of exhaustive checking, I'm fairly sure 
that there is no uninitialized value in the pattern match in question. In 
fact I can remove the error message by removing a variable which is 
initialized, called $kanjidigits, from the pattern match, but that seems 
even more weird.

I think the above-described behaviour, regardless of any errors in the 
module, indicates an error in Perl. Also, I think there is nothing wrong 
with the module. Does anybody have any other opinions?



------------------------------

Date: Sun, 13 Jul 2008 18:03:21 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Apparent bug in Perl 5.10 regexes w. UTF-8 expression
Message-Id: <slrng7k9qg.mv1.hjp-usenet2@hrunkner.hjp.at>

On 2008-07-13 14:14, Ben Bullock <benkasminbullock@gmail.com> wrote:
> I've found a place where Perl seems to behave differently depending on 
> whether something is marked as UTF-8 or not, regardless of the fact that 
> it is just ASCII.
>
> In the following code snippet,
>
> #!/usr/local/bin/perl -lw
> use strict;
> use Encode 'decode';
> use Lingua::JA::FindDates 'subsjdate';
> binmode STDERR,"utf8";
> binmode STDOUT,"utf8";
> print STDERR "first try\n";
> my $test = "ABCDEFG";
> print subsjdate($test);
> print STDERR "now try again\n";
> $test = decode ('utf8', $test);
> print subsjdate($test);
>
> the output is like this:
>
> ben ~ 541 $ ./test2.pl 
> first try
>
> Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/
> site_perl/5.10.0/Lingua/JA/FindDates.pm line 531.
[...]
> What's more, after about one hour of exhaustive checking, I'm fairly sure 
> that there is no uninitialized value in the pattern match in question.

Right. Your problem can be reproduced with this script:

#!/usr/bin/perl
use warnings;
use strict;

my $regex =
"([\x{ff10}-\x{ff19}0-9]{4}|[\x{5341}\x{516d}\x{4e03}\x{4e5d}\x{4e94}\x{56db}\x{5343}\x{767e}\x{4e8c}\x{4e00}\x{516b}\x{4e09}]?\x{5343}[\x{5341}\x{516d}\x{4e03}\x{4e5d}\x{4e94}\x{56db}\x{5343}\x{767e}\x{4e8c}\x{4e00}\x{516b}\x{4e09}]*)\\s*\x{5e74}";
my $test = "ABCDEFG";
if ($test =~ /($regex)/) {
    print "m:<$1>\n";
}
__END__

If the last character ("\x{5e74}") is removed from the regexp, the
warning vanishes. But if the capturing () is removed (leaving just
"\\s*\x{5e74}", the warning vanishes, too - so it's not just \x{5e74}
which triggers the warning, only that combined with something else.

	hp


------------------------------

Date: Sun, 13 Jul 2008 19:46:14 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Apparent bug in Perl 5.10 regexes w. UTF-8 expression
Message-Id: <m4vpk5-ta4.ln1@osiris.mauzo.dyndns.org>


Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> On 2008-07-13 14:14, Ben Bullock <benkasminbullock@gmail.com> wrote:
> > I've found a place where Perl seems to behave differently depending on 
> > whether something is marked as UTF-8 or not, regardless of the fact that 
> > it is just ASCII.
> 
> Right. Your problem can be reproduced with this script:
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> 
> my $regex =
> "([\x{ff10}-\x{ff19}0-9]{4}|[\x{5341}\x{516d}\x{4e03}\x{4e5d}\x{4e94}\x{56db}\x{5343}\x{767e}\x{4e8c}\x{4e00}\x{516b}\x{4e09}]?\x{5343}[\x{5341}\x{516d}\x{4e03}\x{4e5d}\x{4e94}\x{56db}\x{5343}\x{767e}\x{4e8c}\x{4e00}\x{516b}\x{4e09}]*)\\s*\x{5e74}";

Using utf8 in regexen is not well-supported in 5.8; in particular, the
regex engine is not consistent about when to apply utf8 semantics and
when to apply byte semantics. Some of the bugs have been fixed in 5.10;
I don't know if they all have.

Ben

-- 
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann]     ben@morrow.me.uk


------------------------------

Date: Sun, 13 Jul 2008 13:53:54 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: FAQ 1.1 What is Perl?
Message-Id: <2k6qk5xl5s.ln2@goaway.wombat.san-francisco.ca.us>

On 2008-07-13, szr <szrRE@szromanMO.comVE> wrote:
>
> There are also some news readers that (incorrectly) will group messages 
> with the name subject, instead of checking for references. The easy fix 
> is add something variable to the subject to make it different each time 
> that FAQ is posted, like, for example,
>
>
> FAQ 123: Short Description of FAQ                   %
> FAQ 123: Short Description of FAQ                   ^
> FAQ 123: Short Description of FAQ                   $
>
> Or some other way of making it unique.


It seems like putting a posting date would help make it unique, if that
were actually desired.  (I don't see a real need.)

--keith




-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



------------------------------

Date: Sun, 13 Jul 2008 09:17:14 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <slrng7ji0q.156m.willem@snail.stack.nl>

Gordon Corbin Etly wrote:
) Why do many people write "TIMTOWTDI", instead of "There is more than one 
) way to do it"? Maybe it's because it's just more convenient to write it 
) that way. Maybe it's a personal preference to write it that way. It 
) saves time when typing.
)
) So why then is it in any way wrong to write "PERL", instead of writing 
) "Practical extraction and report language"?

Because 'Practical extraction and report language' is not the name
of the language.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


------------------------------

Date: 13 Jul 2008 12:17:07 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <slrng7jsi3.6vn.glennj@smeagol.ncf.ca>

At 2008-07-13 01:57AM, "Gordon Corbin Etly" wrote:
>  Why do many people write "TIMTOWTDI", instead of "There is more than one 
>  way to do it"? Maybe it's because it's just more convenient to write it 
>  that way. Maybe it's a personal preference to write it that way. It 
>  saves time when typing.
>  
>  So why then is it in any way wrong to write "PERL", instead of writing 
>  "Practical extraction and report language"?

You missed Tad's post where he said:

    First there was "Perl",
    then there was "Practical Extraction and Report Language".

    First there was "If I recall correctly",
    then there was "IIRC".

    The difference between the two isn't very subtle. 


-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous


------------------------------

Date: Sun, 13 Jul 2008 01:40:43 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: How can I use constants?
Message-Id: <B7-dnSmZkbcQIuTVnZ2dnUVZ_q_inZ2d@comcast.com>

Bill H wrote:
>
>> use constant lock_PLS => 1;
>> 
> Following up my follow up. That don't work.

It does work.

Show us a cut-down example of it not working.  There could be
a typo in the code you're trying.

	-Joe


------------------------------

Date: 13 Jul 2008 12:10:24 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: How can I use constants?
Message-Id: <slrng7js5g.6vn.glennj@smeagol.ncf.ca>

At 2008-07-12 09:13AM, "Bill H" wrote:
>  On Jul 12, 9:00am, Bill H <b...@ts1000.us> wrote:
> > use constant lock_PLS => 1;
>  
>  Following up my follow up. That don't work. Perl doesn't balk on it,
>  but it seems it is a null value, since it always brings up the 1st
>  element in the array (element 0) when I do:
>  
>  print $photoLayer[lock_PLS];

See the docs ("perldoc constant"):

       You can get into trouble if you use constants in a context which auto-
       matically quotes barewords (as is true for any subroutine call).  For
       example, you can't say $hash{CONSTANT} because "CONSTANT" will be
       interpreted as a string.  Use $hash{CONSTANT()} or $hash{+CONSTANT} to
       prevent the bareword quoting mechanism from kicking in.  Similarly,
       since the "=>" operator quotes a bareword immediately to its left, you
       have to say "CONSTANT() => 'value'" (or simply use a comma in place of
       the big arrow) instead of "CONSTANT => 'value'".


-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous


------------------------------

Date: Sun, 13 Jul 2008 15:29:48 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: How can I use constants?
Message-Id: <slrng7k0qd.lv9.hjp-usenet2@hrunkner.hjp.at>

On 2008-07-13 12:10, Glenn Jackman <glennj@ncf.ca> wrote:
> At 2008-07-12 09:13AM, "Bill H" wrote:
>>  On Jul 12, 9:00am, Bill H <b...@ts1000.us> wrote:
>> > use constant lock_PLS => 1;
>>  
>>  Following up my follow up. That don't work. Perl doesn't balk on it,
>>  but it seems it is a null value, since it always brings up the 1st
>>  element in the array (element 0) when I do:
>>  
>>  print $photoLayer[lock_PLS];
>
> See the docs ("perldoc constant"):
>
>        You can get into trouble if you use constants in a context which auto-
>        matically quotes barewords (as is true for any subroutine call).  For
>        example, you can't say $hash{CONSTANT} because "CONSTANT" will be
>        interpreted as a string.  Use $hash{CONSTANT()} or $hash{+CONSTANT} to
>        prevent the bareword quoting mechanism from kicking in.  Similarly,
>        since the "=>" operator quotes a bareword immediately to its left, you
>        have to say "CONSTANT() => 'value'" (or simply use a comma in place of
>        the big arrow) instead of "CONSTANT => 'value'".

How is this relevant? He is using lock_PLS neither as a hash key nor on
the left side of a fat comma (except int "use constant lock_PLS => 1"
and there he wants lock_PLS to be autoquoted). The docs say nothing
about using a constant as an array index.

	hp



------------------------------

Date: Sun, 13 Jul 2008 03:32:27 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
Message-Id: <9oSdnZ58ZZIgROTVnZ2dnUVZ_gCdnZ2d@comcast.com>

Hans Mulder wrote:

> If you really don't want to have the whole list in memory, you'll
> have to roll your own glob using readdir.  Something like:
> 
>     opendir HOMES, "/home" or die Can't read /home: $!";
>     while (my $entry = readdir(HOMES)) {

The first call to readdir() in scalar context will read the entire list
into memory and return just the first one.  Succeeding calls to
readdir() in scalar context will return the next one from the buffer.

Either way, you'll still end up having the whole list in memory.
	-Joe


------------------------------

Date: Sun, 13 Jul 2008 13:40:28 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
Message-Id: <gBnek.75477$Jx.73313@pd7urf1no>

Joe Smith wrote:
> Hans Mulder wrote:
> 
>> If you really don't want to have the whole list in memory, you'll
>> have to roll your own glob using readdir.  Something like:
>>
>>     opendir HOMES, "/home" or die Can't read /home: $!";
>>     while (my $entry = readdir(HOMES)) {
> 
> The first call to readdir() in scalar context will read the entire list
> into memory

No it won't.

> and return just the first one.  Succeeding calls to
> readdir() in scalar context will return the next one from the buffer.
> 
> Either way, you'll still end up having the whole list in memory.

That is not how it works.



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


------------------------------

Date: Sun, 13 Jul 2008 19:43:43 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
Message-Id: <vvupk5-ta4.ln1@osiris.mauzo.dyndns.org>


Quoth "John W. Krahn" <jwkrahn@shaw.ca>:
> Joe Smith wrote:
> > Hans Mulder wrote:
> > 
> >> If you really don't want to have the whole list in memory, you'll
> >> have to roll your own glob using readdir.  Something like:
> >>
> >>     opendir HOMES, "/home" or die Can't read /home: $!";
> >>     while (my $entry = readdir(HOMES)) {
> > 
> > The first call to readdir() in scalar context will read the entire list
> > into memory
> 
> No it won't.

(deja vu anyone?) Yes it will.

> > and return just the first one.  Succeeding calls to
> > readdir() in scalar context will return the next one from the buffer.
> > 
> > Either way, you'll still end up having the whole list in memory.
> 
> That is not how it works.

Yes it is. Check the source of File::Glob.

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk


------------------------------

Date: 13 Jul 2008 20:34:31 GMT
From: xhoster@gmail.com
Subject: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
Message-Id: <20080713163433.400$Cv@newsreader.com>

Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth "John W. Krahn" <jwkrahn@shaw.ca>:
> > Joe Smith wrote:
> > > Hans Mulder wrote:
> > >
> > >> If you really don't want to have the whole list in memory, you'll
> > >> have to roll your own glob using readdir.  Something like:
> > >>
> > >>     opendir HOMES, "/home" or die Can't read /home: $!";
> > >>     while (my $entry = readdir(HOMES)) {
> > >
> > > The first call to readdir() in scalar context will read the entire
> > > list into memory
> >
> > No it won't.
>
> (deja vu anyone?) Yes it will.

No it won't.

We have now switched from glob to readdir.  Different functions,
different behaviors.  (I missed that transition myself at first.)

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Sun, 13 Jul 2008 22:51:10 +0200
From: Hartmut Camphausen <JustMe@somewhere.de>
Subject: Odd error message on open()-ing scalar ref
Message-Id: <MPG.22e489247b9aceec989689@news.t-online.de>

Hi all,

Consider this snippet:

  #!perl.exe -w
  use strict;

  my $f       = 'abc';
  my $fref    = \$f;

  my $fh;
  warn          "(0) $!"            if $!;
  open          ($fh, '<', $fref)   || die $!
  warn          "(1) $!"            if $!;

  print         "\n", <$fh>;
  seek          ($fh, 1, 0)         || die $!; 
  print         "\n", <$fh>;


It produces this output:

  (1) Bad file descriptor at E:\[Public]\cgi-bin\lib\Text\testmisc.pl 
  line 10.

  abc
  bc
  Tool completed successfully

Any idea, why open() generates an error ($! set) without failing?
open() dies correctly if I dereference $fref via $$fref (No such 
file...).
I'm running Perl v5.8.8.


Clueless,
H.

-- 
-- 
  ------------------------------------------------
Hartmut Camphausen      h.camp[bei]textix[punkt]de


------------------------------

Date: 13 Jul 2008 21:09:56 GMT
From: xhoster@gmail.com
Subject: Re: Odd error message on open()-ing scalar ref
Message-Id: <20080713170959.133$vT@newsreader.com>

Hartmut Camphausen <JustMe@somewhere.de> wrote:
> Hi all,
>
> Consider this snippet:
>
>   open          ($fh, '<', $fref)   || die $!
>   warn          "(1) $!"            if $!;
>
>
> It produces this output:
>
>   (1) Bad file descriptor at E:\[Public]\cgi-bin\lib\Text\testmisc.pl
>   line 10.

Open did not fail.  Therefore, the value of $! is meaningless.  Meaningless
can be anything, including the value you see above.

> Any idea, why open() generates an error ($! set) without failing?

Setting $! is *not* generating an error[1].  The way that open indicates an
error is by returning a false value (or conceivably by dying).  It did not
do that.

[1]  And "open" is not setting it anyways, at least not directly.  Most
likely your use of open is triggering the loading of PerlIO::scalar, and it
is the loading of PerlIO::scalar that is setting $!, but in an innocuous
manner.  On my system, if I preload that module by "use PerlIO::scalar",
and then reset $! to 0, then do your open, after the open $! remains 0.
But that doesn't really matter, as by inspecting $! when an error has not
occurred you are living in sin.



Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Sun, 13 Jul 2008 21:16:22 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: Odd error message on open()-ing scalar ref
Message-Id: <Gguek.197052$TT4.14328@attbi_s22>

Hartmut Camphausen wrote:
>   open          ($fh, '<', $fref)   || die $!
>   warn          "(1) $!"            if $!;
>
> [...]
 >
> Any idea, why open() generates an error ($! set) without failing?
> open() dies correctly if I dereference $fref via $$fref (No such 
> file...).
> I'm running Perl v5.8.8.

The open() entry in perlfunc contains part of the answer:

   Since v5.8.0, [...] you can open file handles to "in memory"
   files held in Perl scalars via:

       open($fh, '>', \$variable) || ..

This is what you're doing except that you're opening the handle for 
reading instead of writing. The open() isn't returning false because it 
isn't failing. This can be seen in the output of your print() statements.

The rest of the answer is in the entry for $! in perlvar:

   if a system or library call fails, it sets this variable.
   This means that the value of $! is meaningful only *immediately*
   after a failure:

Since there was no failure, the value of $! isn't meaningful.

-mjc


------------------------------

Date: Sun, 13 Jul 2008 02:51:25 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: printing envelops from perl
Message-Id: <xJydnZXdUP-CTeTVnZ2dnUVZ_rXinZ2d@comcast.com>

joe wrote:
> Can the web browser read page breaks?

No, there are no page breaks in HTML.
	-Joe


------------------------------

Date: Sun, 13 Jul 2008 14:49:06 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: printing envelops from perl
Message-Id: <g5d4mk.19s.1@news.isolution.nl>

Joe Smith schreef:
> joe wrote:

>> Can the web browser read page breaks?
>
> No, there are no page breaks in HTML.

See also

http://lists.w3.org/Archives/Public/www-html-editor/1998JulSep/0131.html

For printing, you can get close with a CSS definition like this:

HR {
    page-break-after: always;
}

So yes, many a web browser can read page breaks.

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Sun, 13 Jul 2008 11:32:41 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: printing envelops from perl
Message-Id: <9ec6dff7-afb7-4710-a8f2-0f79068f8bde@k13g2000hse.googlegroups.com>

On Jul 13, 8:49=A0am, "Dr.Ruud" <rvtol+n...@isolution.nl> wrote:
> Joe Smith schreef:
>
> > joe wrote:
> >> Can the web browser read page breaks?
>
> > No, there are no page breaks in HTML.
>
> See also
>
> http://lists.w3.org/Archives/Public/www-html-editor/1998JulSep/0131.html
>
> For printing, you can get close with a CSS definition like this:
>
> HR {
> =A0 =A0 page-break-after: always;
>
> }
>
> So yes, many a web browser can read page breaks.
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."

I've done this before (the page breaks). I usually use the H1 tag and
a page break before it, that way H1 is the header for the next page.

Bill H


------------------------------

Date: Sun, 13 Jul 2008 10:33:40 +0200
From: Dave B <daveb@addr.invalid>
Subject: Re: remove previous lines of a log file
Message-Id: <g5cekq$gga$1@registered.motzarella.org>

Leon Timmermans wrote:
> On Sat, 12 Jul 2008 18:34:53 +0200, Dave B wrote:
> 
>> $f=~s/(?:.*\n){2}.*keyword.*\n//g;
>>
>> should do what you want. (Note that the last line in the file should be
>> correctly terminated by a newline).
> 
> I think that last issue can be solved by the /m modifier
> 
> $f =~ s/ (?:.*\n){2} .* keyword .* $ //xmg;

That will take care of the corner case, but will leave an unnecessary \n in
the file in the regular cases.

This should do the job:

$f=~s/(?:.*\n){2}.*keyword.*(?:\n|$)//g;

-- 
D.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 1716
***************************************


home help back first fref pref prev next nref lref last post