[25944] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8163 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 10 21:05:22 2005

Date: Fri, 10 Jun 2005 18:05:07 -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           Fri, 10 Jun 2005     Volume: 10 Number: 8163

Today's topics:
    Re: (Ilya?) cperl-mode.el and strings like ||""$foo""|| (David Combs)
    Re: book "perl medic": any good? (David Combs)
    Re: chown recursively <apeiron+usenet@coitusmentis.info>
    Re: chown recursively <abigail@abigail.nl>
    Re: chown recursively <abigail@abigail.nl>
    Re: chown recursively <abigail@abigail.nl>
    Re: chown recursively <abigail@abigail.nl>
    Re: chown recursively <abigail@abigail.nl>
    Re: chown recursively <timodonovan@localhost.com>
        DBD for MS SQL sever? <john@castleamber.com>
    Re: DBD for MS SQL sever? <john@castleamber.com>
        does anyone know a working ticker/parser for stocks <Oliver-Bleckmann@freenet.de>
    Re: does anyone know a working ticker/parser for stocks <john@castleamber.com>
        how to format a $htmlpage without form feed <Oliver-Bleckmann@freenet.de>
    Re: how to format a $htmlpage without form feed <john@castleamber.com>
    Re: how to format a $htmlpage without form feed <Oliver-Bleckmann@freenet.de>
    Re: how to format a $htmlpage without form feed <tadmc@augustmail.com>
    Re: how to format a $htmlpage without form feed <tadmc@augustmail.com>
    Re: how to format a $htmlpage without form feed <jurgenex@hotmail.com>
    Re: how to format a $htmlpage without form feed <john@castleamber.com>
    Re: how to format a $htmlpage without form feed <Oliver-Bleckmann@freenet.de>
    Re: how to format a $htmlpage without form feed <1usa@llenroc.ude.invalid>
    Re: increase performance <abigail@abigail.nl>
    Re: OT:  Article re Ashes vs. Potato Chips <69-no-spam@69.69.69.69.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 10 Jun 2005 18:52:58 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: (Ilya?) cperl-mode.el and strings like ||""$foo""|| *within a string*?
Message-Id: <d8cnia$5tj$1@reader1.panix.com>

In article <d7p72m$in6$1@ns.felk.cvut.cz>,
Radomir Hejl <rh62121@yahoo.com> wrote:
>> Again, would be nice if your (well, all!) versions of cperl-mode had
>> a setq-variable that showed the version-number (and last-modified-date?)
>> for the version.
>
>Type C-h v cperl-mode, at least for my GNU emacs 21.3.1 on windows.
>Or through menu Perl/Micro-docs/CPerl version.
>
>Radek H.
>
>

Thanks!



I do that, and get these 4 possible completions (to cperl-mode-)
  cperl-mode-{abbrev-table,map,hook,syntax-table} --
nothing for just plain cperl-mode.

For those four, C-h v finds nothing like a version-number -- just
that I can customize it, etc.

David




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

Date: Fri, 10 Jun 2005 18:55:14 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: book "perl medic": any good?
Message-Id: <d8cnmi$6cu$1@reader1.panix.com>

In article <pan.2005.06.06.06.03.51.589248@dave.org.uk>,
Dave Cross  <dave@dave.org.uk> wrote:
>On Sat, 04 Jun 2005 13:39:39 -0400, David Combs wrote:
>
>> Saw a reference to a new-to-me book "Perl Medic".  Anyone seen it?
>> Anyone have it?
>> 
>> What opinion?
>
>It's _very_ good.
>
>See http://books.perl.org/book/212
>
>Dave...

Thanks, guys!

I'll order it now.

David




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

Date: 10 Jun 2005 18:41:33 GMT
From: Christopher Nehren <apeiron+usenet@coitusmentis.info>
Subject: Re: chown recursively
Message-Id: <slrndajnmt.1a7a.apeiron+usenet@prophecy.dyndns.org>

On 2005-06-10, Tim Hammerquist scribbled these
curious markings:
> For example, if you decide to shell out to an external chown(1) command,
> it will work on Linux, *BSD, Solaris, and even Mac OS X, and several
> others... 

 ... though it may fail if you use syntax supported in your programming
environment's chown but not in your deployment environment's chown. For
example, GNU chown accepts '.' as a separator for user and group, which
is a violation of POSIX (though at least the documentation tells you
this). FreeBSD's chown follows POSIX and explicitly disallows this. All
the more reason to use Perl when possible.

Best Regards,
Christopher Nehren
-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.


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

Date: 10 Jun 2005 22:20:43 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: chown recursively
Message-Id: <slrndak4hr.14f.abigail@alexandra.abigail.nl>

Christopher Nehren (apeiron+usenet@coitusmentis.info) wrote on MMMMCCC
September MCMXCIII in <URL:news:slrndahkba.18m.apeiron+usenet@prophecy.dyndns.org>:
''  On 2005-06-09, Tim O'Donovan scribbled these
''  curious markings:
'' > Quick newbie question! Could someone please point out how to use chown() 
'' > on directories recursively.
''  
''  Perhaps a bit of File::Find?
''  
'' > But mostly I'd like to know if there are actually any benefits over using:
'' >
'' > system("chown -R $uid:$gid $dir");
''  
''  Who says chown exists on the target system? Who says it's in your path?
''  It's generally a bad idea to "shell out" to external programs when you
''  can do what you need to do with Perl.


It's generally a bad idea to label something as a "general bad idea".
Not every Perl program needs to be run on different platforms. I estimate
that in the more than 10 years I've been programming Perl, 98% of the
programs I've written were written to run a specific system.

If I were to write a program that needed to recursively chown a directory,
I'd use 'system' to do the task. Why roll your own if there's a canned
solution readily available? Code reuse goes much further than using a
Perl module. Oh, sure, there's no chown on Windows or MacOS, but doing a
chown() on those systems doesn't make much sense, does it? And if people
want to set up their paths such they lack access to 'chown', they have to
blame themselves. It's not my task to prevent people shooting themselves
in their feet.



Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: 10 Jun 2005 22:23:16 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: chown recursively
Message-Id: <slrndak4mk.14f.abigail@alexandra.abigail.nl>

Tim Hammerquist (tim@vegeta.ath.cx) wrote on MMMMCCCI September MCMXCIII
in <URL:news:slrndajg4c.mt.tim@vegeta.saiyix>:
$$  Jürgen Exner <jurgenex@hotmail.com> wrote:
$$ > Where do you find chown on a Windows PC, on a Mac, or a any of the dozen and 
$$ > dozen OSs that are supported by Perl?
$$  
$$  kotoko:~>% uname -a
$$  Darwin kotoko 8.1.0 Darwin Kernel Version 8.1.0: Tue May 10 18:16:08
$$  PDT 2005; root:xnu-792.1.5.obj~4/RELEASE_PPC Power Macintosh powerpc
$$  kotoko:~>% which chown
$$  /usr/sbin/chown
$$  
$$  Of course, that's only Mac OS X (>= 10).
$$  
$$  The point still stands.  Native Perl functions should be used whenever
$$  possible and appropriate to maintain portability.
$$  
$$  For example, if you decide to shell out to an external chown(1) command,
$$  it will work on Linux, *BSD, Solaris, and even Mac OS X, and several
$$  others... but fail on Win32.  Whereas if you used Perl's chown(), the
$$  unimplemented function will return true and your script can continue as
$$  normal.


Yeah, but according to perlport, chown() isn't implemented on Plan 9.


Why would I care a script I write won't work on Windows? I bet the majority
of the Perl programs written aren't intended to run everywhere anyway.


Abigail
-- 
perl -wle 'print prototype sub "Just another Perl Hacker" {};'


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

Date: 10 Jun 2005 22:26:54 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: chown recursively
Message-Id: <slrndak4tb.14f.abigail@alexandra.abigail.nl>

Christopher Nehren (apeiron+usenet@coitusmentis.info) wrote on MMMMCCCI
September MCMXCIII in <URL:news:slrndajnmt.1a7a.apeiron+usenet@prophecy.dyndns.org>:
&&  On 2005-06-10, Tim Hammerquist scribbled these
&&  curious markings:
&& > For example, if you decide to shell out to an external chown(1) command,
&& > it will work on Linux, *BSD, Solaris, and even Mac OS X, and several
&& > others... 
&&  
&&  ... though it may fail if you use syntax supported in your programming
&&  environment's chown but not in your deployment environment's chown. For
&&  example, GNU chown accepts '.' as a separator for user and group, which
&&  is a violation of POSIX (though at least the documentation tells you
&&  this). FreeBSD's chown follows POSIX and explicitly disallows this. All
&&  the more reason to use Perl when possible.


Bullshit.

GNU chown also allows ':' as the separator. Which is the standard, and
which is what OP did as well.

Not using a tool because some implementations of the tool accept an
alternative method that isn't accepted on all implementation, while also
implementing the method that is accepted by all implementations isn't
a reason to not use a tool.


Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


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

Date: 10 Jun 2005 22:34:16 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: chown recursively
Message-Id: <slrndak5b6.14f.abigail@alexandra.abigail.nl>

Tim Hammerquist (tim@vegeta.ath.cx) wrote on MMMMCCCI September MCMXCIII
in <URL:news:slrndahn7h.mt.tim@vegeta.saiyix>:
<>  Tim O'Donovan <timodonovan@localhost.com> wrote:
<> >  Quick newbie question! Could someone please point out how to use
<> >  chown() on directories recursively.
<> >  
<> >  But mostly I'd like to know if there are actually any benefits over
<> >  using:
<> >  
<> >  system("chown -R $uid:$gid $dir");
<>  
<>  The chown() perl function is a direct interface to the system call.
<>  There is significantly less overhead using this method, as opposed to
<>  the one you describe above, which calls the OS to start a separate shell
<>  session, then having the shell session open a process for the chown(1)
<>  utility, which then makes a call to the same system function perl's own
<>  chown() calls.


Well, if the directory is large, I bet shelling out the chown is *faster*
than doing it in Perl. The system call doesn't handle the -R functionality,
and I bet the C-implementation of traversing a directory tree in chown is
faster than most, if not every, Perl solution using File::Find.

Of course, the strongest argument is: programmer time is more important
than CPU time. The time to program out 

    system "chown -R $uid:$gid $dir";

utterly dwarves the overhead of starting another process. (And note that
unless '$uid', '$gid' and '$dir' contain characters that are special to
shell, no shell will be started by perl - perl will call chown directly).



Abigail
-- 
perl -Mstrict='}); print "Just another Perl Hacker"; ({' -le1


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

Date: 10 Jun 2005 22:35:56 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: chown recursively
Message-Id: <slrndak5ec.14f.abigail@alexandra.abigail.nl>

Tim O'Donovan (timodonovan@localhost.com) wrote on MMMMCCCI September
MCMXCIII in <URL:news:d8asat$a59$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>:
()  Thanks for all your informative replies, much appreciated. From now on 
()  I'll be replacing 'shell outs' with the appropriate Perl, where applicable.
()  
()  So I can assume that using:
()  
()  open(FIND, "find $path -lname '/home/$username/*' |");
()  @links = <FIND>;
()  close(FIND);
()  
()  to find all the symbolic links in the given path to files in a users 
()  home directory is also not the most resourceful method?!


Indeed. I'd write that as:

    @links = `find $path -lname '/home/$username/*'`;



Abigail
-- 
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()


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

Date: Sat, 11 Jun 2005 00:58:39 +0000 (UTC)
From: Tim O'Donovan <timodonovan@localhost.com>
Subject: Re: chown recursively
Message-Id: <d8dcvv$g6a$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>

> Well, if the directory is large, I bet shelling out the chown is *faster*
> than doing it in Perl. The system call doesn't handle the -R functionality,
> and I bet the C-implementation of traversing a directory tree in chown is
> faster than most, if not every, Perl solution using File::Find.
> 
> Of course, the strongest argument is: programmer time is more important
> than CPU time. The time to program out 
> 
>     system "chown -R $uid:$gid $dir";
> 
> utterly dwarves the overhead of starting another process. (And note that
> unless '$uid', '$gid' and '$dir' contain characters that are special to
> shell, no shell will be started by perl - perl will call chown directly).


Thanks for the alternative angle, excellent stuff. I'm considering using 
the original system() function now because of what you said about speed. 
This is part of a background script on a webserving machine that takes 
instructions from a file written to by a CGI script so the time each 
request takes to execute is of the utmost importance as we want to keep 
the user waiting for as little as possible for the result of the 
request. I've yet to find a way to use the sleep() function to sleep for 
less than a second (although I'm sure to find a module that will do 
this), so even though using the system() function might only reduce the 
time by a millisecond, this could cause the CGI script to sleep for a 
second more than it really needs to. Well, just under a second than it 
*needs* to but...


> unless '$uid', '$gid' and '$dir' contain characters that are special to shell...

This is also good to know as it will only ever be passed variables from 
the calling CGI script like so:

system("chown -R 1100:80 /home/username/public_html");

The $uid value is taken directly from a passwd file, $gid is a constant 
of 80 and if $username is not alphanumeric the CGI script will return an 
error.



Tim


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

Date: 10 Jun 2005 22:22:17 GMT
From: John Bokma <john@castleamber.com>
Subject: DBD for MS SQL sever?
Message-Id: <Xns9671B0B039CF7castleamber@130.133.1.4>

Which one is the recommended one? DBD::ODBC? And where can I find a pre-
compiled one? I am using ActiveState, and ppm only shows the MySQL one

Thanks,

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: 10 Jun 2005 22:58:08 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: DBD for MS SQL sever?
Message-Id: <Xns9671B6C437583castleamber@130.133.1.4>

John Bokma wrote:

> Which one is the recommended one? DBD::ODBC? And where can I find a pre-
> compiled one? I am using ActiveState, and ppm only shows the MySQL one

Apologies: I did query instead of search :-$. Hence I found only 1 driver, 
one I recently installed.

*hits himself with Programming Perl 3 times on the head*

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Sat, 11 Jun 2005 00:30:23 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: does anyone know a working ticker/parser for stocks
Message-Id: <d8d4h1$mm7$1@newsserver.rz.tu-ilmenau.de>

does anyone know a working ticker/parser for stocks. perhaps for german 
stocks.
or a page easy to parse?




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

Date: 10 Jun 2005 23:00:38 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: does anyone know a working ticker/parser for stocks
Message-Id: <Xns9671B7307A24Ccastleamber@130.133.1.4>

Oliver Bleckmann wrote:

> does anyone know a working ticker/parser for stocks. perhaps for german 
> stocks.
> or a page easy to parse?

You want to swap it for a free recipe for quesadillas?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Sat, 11 Jun 2005 00:25:47 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: how to format a $htmlpage without form feed
Message-Id: <d8d48b$kjp$1@newsserver.rz.tu-ilmenau.de>

perhaps a simple question ;-)
how to format a html page without form feeds?
i thougt this would work, but it doesn't...
$htmlpage =~ s/\</\<\n/S;
replace the > of each tag with a > plus form feed
any idea? 




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

Date: 10 Jun 2005 22:59:51 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <Xns9671B70E5AFAcastleamber@130.133.1.4>

Oliver Bleckmann wrote:

> perhaps a simple question ;-)
> how to format a html page without form feeds?
> i thougt this would work, but it doesn't...
> $htmlpage =~ s/\</\<\n/S;
> replace the > of each tag with a > plus form feed
> any idea? 

[1] \n is not form feed
[2] what do you want to do? breaking lines? That's an HTML question

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Sat, 11 Jun 2005 01:03:46 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <d8d6fl$49m$1@newsserver.rz.tu-ilmenau.de>

sorry line feed and yes it is a html question if you view it in the browser 
but theres is no line feed in raw text at all
"John Bokma" <john@castleamber.com> schrieb im Newsbeitrag 
news:Xns9671B70E5AFAcastleamber@130.133.1.4...
> Oliver Bleckmann wrote:
>
>> perhaps a simple question ;-)
>> how to format a html page without form feeds?
>> i thougt this would work, but it doesn't...
>> $htmlpage =~ s/\</\<\n/S;
>> replace the > of each tag with a > plus form feed
>> any idea?
>
> [1] \n is not form feed
> [2] what do you want to do? breaking lines? That's an HTML question
>
> -- 
> John                   Small Perl scripts: http://johnbokma.com/perl/
>               Perl programmer available:     http://castleamber.com/
>            Happy Customers: http://castleamber.com/testimonials.html
> 




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

Date: Fri, 10 Jun 2005 18:07:50 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <slrndak7a6.ap2.tadmc@magna.augustmail.com>

Oliver Bleckmann <Oliver-Bleckmann@freenet.de> wrote:

> $htmlpage =~ s/\</\<\n/S;
> replace the > of each tag with a > plus form feed


You have those little >pointy< things going in 2 different 
directions there, so which is it?

\n is NOT a "form feed", it is a "line feed".

\f is a "form feed" character.


Whitespace does not matter in HTML, so even if you did make the
change I think you are attempting, it would not change how the
webpage was displayed in a browser.

Do you want to do this just so it is easier to read the raw HTML file,
or do you want to add <br>eaks that the browser will act on?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 10 Jun 2005 18:02:43 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <slrndak70j.ap2.tadmc@magna.augustmail.com>

Oliver Bleckmann <Oliver-Bleckmann@freenet.de> wrote:

> i thougt this would work, but it doesn't...
> $htmlpage =~ s/\</\<\n/S;


Of course not, it does not even compile...


> any idea? 


Writing actual Perl code would be a good idea.  :-)

You must get it to compile and run before it even has a chance to "work".



Have you seen the Posting Guidelines that are posted here frequently?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 10 Jun 2005 23:27:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <llpqe.254$9a1.139@trnddc01>

Oliver Bleckmann wrote:
> perhaps a simple question ;-)
> how to format a html page without form feeds?

You could use newlines instead of form feeds.

Joking aside, are you talking about formatting the HTML source code or about 
formatting the rendered result in a browser?

> i thougt this would work, but it doesn't...
> $htmlpage =~ s/\</\<\n/S;
> replace the > of each tag with a > plus form feed

Well, your text doesn't seem to have anything to do with your code fragment
Which one is it?

jue 




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

Date: 11 Jun 2005 00:05:12 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <Xns9671C2230AFCBcastleamber@130.133.1.4>

Oliver Bleckmann wrote:

> sorry line feed and yes it is a html question if you view it in the
> browser but theres is no line feed in raw text at all

[1] don't top post
[2] This is a Perl group, not an HTML group.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Sat, 11 Jun 2005 02:30:52 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <d8dbiv$8cs$1@newsserver.rz.tu-ilmenau.de>

ok guys,
i see that you don't understand what i mean.
at first: this has nothing to do with html rendering in a browser. italk 
about the raw text.
for i am german, my english isn't the best.
i mean a line feet - sorry my fault - which should be used to format a 
string without any line feed (the \n thing, you know)
again this has nothing to do with <br>.
the only thing is, that this string consists of html tags. it would be 
nice - just for reading - to break a line after every
closed tag - that means after a ">".

a substitution of the ">" by a ">" with following line feet doesn't work 
!!!!!!!!!!
ok, this is a shortend version - compiles and works, if you skip the 
supstitoution block

use LWP::Simple;
      $URL="http://de.finance.yahoo.com/q/cq?s=710000&m=a";
      $inh = get($URL);
      open (DATEI, ">c:/boerse.htm") or die "Couldn't open for writing: 
$!\n";

      if ( $inh =~ m/(.+)Tabellenansicht(.+)/s  )
      {
    $inh2 = $2;
      }
      if ( $inh2 =~ m/(.+)Kursdaten downloaden(.+)/s  )
      {
    $inh3 = $1;
      }

     if ( $inh3 = s/"\>"/"\>\n"/sgoi)
      {
    print DATEI $inh3;
      }
   close (DATEI);

"Oliver Bleckmann" <Oliver-Bleckmann@freenet.de> schrieb im Newsbeitrag 
news:d8d48b$kjp$1@newsserver.rz.tu-ilmenau.de...
> perhaps a simple question ;-)
> how to format a html page without form feeds?
> i thougt this would work, but it doesn't...
> $htmlpage =~ s/\</\<\n/S;
> replace the > of each tag with a > plus form feed
> any idea?
> 




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

Date: Sat, 11 Jun 2005 00:46:25 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <Xns9671D351F4128asu1cornelledu@127.0.0.1>

"Oliver Bleckmann" <Oliver-Bleckmann@freenet.de> wrote in news:d8dbiv$8cs
$1@newsserver.rz.tu-ilmenau.de:

> ok guys,
> i see that you don't understand what i mean.

See <URL: http://www.elektrolurch.com/lyrics/titel/154.html>

*PLONK* 

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: 10 Jun 2005 23:14:39 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: increase performance
Message-Id: <slrndak7mu.14f.abigail@alexandra.abigail.nl>

A. Sinan Unur (1usa@llenroc.ude.invalid) wrote on MMMMCCC September
MCMXCIII in <URL:news:Xns967090CEDDDasu1cornelledu@127.0.0.1>:
@@  
@@  However, the easiest way to speed this task up by an order of magnitude 
@@  is to avoid printing. As (I think) Anno says: Print rarely, print late.
@@  
@@  But to decide how rarely, and how late, one would have to know more.
@@  
@@  As a simple experiment, take the following script:
@@  
@@  #! /usr/bin/perl
@@  use strict;
@@  use warnings;
@@  
@@  my @months = qw(invalid
@@                  jan feb mar apr may jun
@@                  jul aug sep oct nov dec
@@                 );
@@  
@@  while(<DATA>) {
@@      next unless /^(\d\d)(\d\d)$/;
@@      print "$months[0 + $1]$2\n";
@@  }
@@  
@@  __END__
@@  
@@  In the version I will use illustrate, I have 10,000 lines of data 
@@  following __END__.
@@  
@@  I am on Windows XP Pro, perl v.5.8.6.811 (ActiveState), Acer AMD64 
@@  Laptop with 1 GB RAM:
@@  
@@  TimeThis :  Command Line :  perl ttt.pl
@@  TimeThis :    Start Time :  Wed Jun 08 23:46:14 2005
@@  TimeThis :      End Time :  Wed Jun 08 23:46:16 2005
@@  TimeThis :  Elapsed Time :  00:00:01.578
@@  
@@  Now, replace the script with the following:
@@  
@@  #! /usr/bin/perl
@@  use strict;
@@  use warnings;
@@  
@@  my @months = qw(invalid
@@                  jan feb mar apr may jun
@@                  jul aug sep oct nov dec
@@                 );
@@  
@@  my $result;
@@  
@@  while(<DATA>) {
@@      next unless /^(\d\d)(\d\d)$/;
@@      $result .= "$months[0 + $1]$2\n";
@@  }
@@  
@@  __END__
@@  
@@  On the exact same data set, we get:
@@  
@@  TimeThis :  Command Line :  perl ttt.pl
@@  TimeThis :    Start Time :  Thu Jun 09 00:02:31 2005
@@  TimeThis :      End Time :  Thu Jun 09 00:02:31 2005
@@  TimeThis :  Elapsed Time :  00:00:00.187



I ran the same programs on my machine (Linux), and I got the
following results:

For the first program:

    $ time perl prog1
    ...
    real    0m0.589s
    user    0m0.110s
    sys     0m0.040s


For the second program:

    $ time perl prog2
    real    0m0.085s
    user    0m0.060s
    sys     0m0.010s



So, similar figures. But why is the second program faster? Well, the
second program _does not print anything at all_. So, they are not 
equivalent. So, I made a third program, the same as the second, but with
a 'print $result' added before __END__. Running that gives as result:

    $ time perl prog3
    real    0m0.378s
    user    0m0.080s
    sys     0m0.010s


Still faster, but not by much. But why is it faster? Is it just because
of the single print? It's not that simple. A print is actually pretty
fast - except when it's actually flushing the data. And that's what is
happening if you are printing a line to the terminal. It all changes if
you print to a file, then prints are buffered, and only larger blocks 
are committed:

    $ time perl prog1 > out1
    real    0m0.082s
    user    0m0.060s
    sys     0m0.010s

    $ time perl prog3 > out3
    real    0m0.085s
    user    0m0.070s
    sys     0m0.000s


Not much difference anymore! There is a difference when the amount
of data gets larger. With 10_000_000 entries instead of 10_000:

    $ time perl prog1 > out1
    real    1m31.096s
    user    0m57.000s
    sys     0m8.400s


    $ time perl prog3 > out3
    real    2m52.186s
    user    1m2.530s
    sys     0m18.100s


The large string that gets constructed is the killer.



Abigail
-- 
A perl rose:  perl -e '@}-`-,-`-%-'


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

Date: Sat, 11 Jun 2005 01:49:26 +0200 (CEST)
From: "Agent 69" <69-no-spam@69.69.69.69.invalid>
Subject: Re: OT:  Article re Ashes vs. Potato Chips
Message-Id: <cDIzMTA=.8a2247e98fc76debb8c6f2a35c035f10@1118447366.nulluser.com>

ann hedonia wrote:

> I found this amusing--I should probably be ashamed of myself.
>
> http://www.chron.com/cs/CDA/ssistory.mpl/metropolitan/3219338

I found it very amusing myself...and as a journalist myself I commend 
the reporter on getting the whole story -- the flavour of the crisps!  
Sour Cream & Onion.

For example, I was incensed when the media failed to report the flavour 
of the pie thrown at Ann Coulter a while ago (and whether they were 100 
per cent sure if the white stuff sprayed all over her was indeed 
frosting.)

I also think Lays should consider doing an ad about this...have that 
nice looking lady from the most recent series on a stage saying "It's 
the next best thing to Mom!"

agent 69
Gonzo, Austria


-- 
Agent 69
alt.drugs.hydromorphone

"...some say true comedy is the work of genius. I disagree, the 
funniest shit I ever saw was all the work of halfwits."
-- Si, in alt.drugs.hard, 5. May 2005




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

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 V10 Issue 8163
***************************************


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