[18720] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 888 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 13 14:05:40 2001

Date: Sun, 13 May 2001 11:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989777111-v10-i888@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 13 May 2001     Volume: 10 Number: 888

Today's topics:
    Re: AutoSplit gets line numbers wrong?? (M.J.T. Guy)
    Re: Cabal Guidelines for comp.lang.perl.misc ($Revision (Randal L. Schwartz)
    Re: Cabal Guidelines for comp.lang.perl.misc ($Revision <godzilla@stomp.stomp.tokyo>
    Re: Existing Script To Add Time (Anno Siegel)
    Re: Existing Script To Add Time <grasshopper99[no-spam]@hotmail.com>
    Re: Existing Script To Add Time <dodger@necrosoft.net>
    Re: Existing Script To Add Time (Anno Siegel)
        Help with my html to txt perl script <newuser@nospam.slip.net>
    Re: Help with my html to txt perl script <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: Help with my html to txt perl script (Tad McClellan)
    Re: Help with my html to txt perl script <newuser@nospam.slip.net>
    Re: Help with my html to txt perl script <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: Help with my html to txt perl script <newuser@nospam.slip.net>
        I remember. <smash@floodbox.com>
        looking for a Perl solution <b-sept@gmx.de>
    Re: Need Help: Pattern Matching Etc. (Anno Siegel)
    Re: Need Help: Pattern Matching Etc. <phookie@xmission.com>
        Numbers <bop@mypad.com>
    Re: Numbers <keesh@users.pleaseremovethisbit.sourceforge.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 13 May 2001 16:58:53 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: AutoSplit gets line numbers wrong??
Message-Id: <9dmegd$9d5$1@pegasus.csx.cam.ac.uk>

Paul D. Smith <psmith@baynetworks.com> wrote:
>[[ I'm using Perl 5.6.0 on Linux and Solaris ]]
>
>Is this a 5.6.0 bug?  I can't believe no one has noticed this... so
>maybe it's intended behavior?  I've checked Camel, perlmod, perlmodlib,
>perlfaq, Google, Deja, etc. and of course the AutoSplit and AutoLoader
>man pages, and couldn't find this mentioned anywhere.
>
>If I have an AutoLoader module with comments preceding a sub, then
>AutoSplit gets the line numbers wrong in the .al file:

Nice catch.   A definite bug  -  it's even provoked by the built-in
Storable module.

And of course there are no regression tests for AutoSplit.    :-(

I've sent a bug report and a patch to perl5-porters, so it should be
mended in perl5.6.2.


Mike Guy


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

Date: 13 May 2001 09:22:46 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <m1sni9z0a1.fsf@halfdome.holdit.com>

>>>>> "Kira" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

Kira> When will you be announcing a request for comments
Kira> and announcing a call for vote to sanction this
Kira> FAQ per long standing USENET guidelines?

There are no "long standing [sic] USENET [sic] guidelines" for
approving a charter after the fact.  Do your homework, Kira.  Read
news.admin.* for a few months.

What Tad will have created when the process is done is a set of
guidelines.  These guidelines codify the operating principles that
*we* have been following (or attempting to follow) since the group's
inception, and even before that in comp.lang.perl and the mailing list
before that.

By "we", I mean the people that answer the questions, day after day,
sometimes crankily but usually with near-infinite patience.

Guidelines that, if not followed, will slowly cause all the remaining
experts to leave, and you'll be left with a group of the near-blind
leading the blind.  Guidelines that because they haven't been followed
in the past have already caused experts to leave.

There's nothing to approve, because this is a statement of what
already *is*, not something new.  It's an assertion, not a
declaration.  But a powerful assertion, because we that answer the
questions can point at the document and say "this is the culture
here... please follow it, and when you don't, most or all of the
experts will likely ignore you."

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sun, 13 May 2001 10:21:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3AFEC2AA.72C3E08D@stomp.stomp.tokyo>

Randal L. Schwartz wrote:
 
>  "Kira" == Godzilla! wrote:

> Kira> When will you be announcing a request for comments
> Kira> and announcing a call for vote to sanction this
> Kira> FAQ per long standing USENET guidelines?
 
> There are no "long standing [sic] USENET [sic] guidelines" for
> approving a charter after the fact.  Do your homework, Kira.  Read
> news.admin.* for a few months.


Yes, it is a newsgroup charter, isn't it, Randal?


My presumption is you, as a seasoned USENET participant
and former USENET administrator, have forgotten the
sanctity of newsgroup charters.


There are both written and unwritten guidelines for USENET
just as there are written and unwritten guidelines for
appropriate societal behavior. I have been around USENET
for the same number of years as you Randal. I am quite
acquainted with long standing USENET customs. There are
no others here, whom I know of, as familiar with USENET
customs as you and myself. These others are uppity newcomers.

This FAQ is presented as the "voice of the majority" here
and yet speaks only for a very select few. Those of us who
are in disfavor of this self-proclaimed cabal here, are not
afforded an opportunity to provide input and opinion.

Clearly this is a display of fascist ideals by this cabal.

I find their and, in this instance, your attitude and
displayed behavior to be morally repugnant.

 
> What Tad will have created when the process is done is a set of
> guidelines.  These guidelines codify the operating principles that
> *we* have been following (or attempting to follow) since the group's
> inception, and even before that in comp.lang.perl and the mailing list
> before that.

What "Tad" is creating is a set of dictorial rules which will
be used as an excuse to increase the abuse of people here. This
document being created by "Tad" is exceptionally offensive and
I am embarrassed to have anyone presume I am associated with
this document. Rest assured I will periodically make this clear.

I have been refused any opportunity to participate in
the development of this newsgroup charter. Your use of
"we" is most hypocritical. It is equally clear "Tad"
is making any and all decisions regarding this FAQ
and is making iron clad fist decisions on its content.

This "Tad" is not the ruler of this group although
he envisions himself to be and consistently displays
behavior which reinforces his self-conceptualized
notion he is the king of this newsgroup surrounded
by a small crowd of ring kissing court jesters.


Others elect to be bootlickers. I do not.

 
> By "we", I mean the people that answer the questions, day after day,
> sometimes crankily but usually with near-infinite patience.

By "we" you mean those very few who have elected to place
themselves in authoritarian if not tyrannical control of
this newsgroup, as impotent as that may be. Their intent
is not to improve this newsgroup but rather to establish
a "legitimate" excuse to increase abuse of posters here.


Want to discuss my history of being abused by and ongoing
abuse by the cabal here?


> Guidelines that, if not followed, will slowly cause all the remaining
> experts to leave, and you'll be left with a group of the near-blind
> leading the blind.  Guidelines that because they haven't been followed
> in the past have already caused experts to leave.

My opinion is most experts, most of those who would post
worthy articles here, have left because of all the in-house
anal retentive sissified geek bickering and fighting between
those within this self-proclaimed cabal. Those few dictating
what will be and will not be in this group, are the very ones
who are contributing to the ruination of this newsgroup.

 
> There's nothing to approve, because this is a statement of what
> already *is*, not something new.  It's an assertion, not a
> declaration.  But a powerful assertion, because we that answer the
> questions can point at the document and say "this is the culture
> here... please follow it, and when you don't, most or all of the
> experts will likely ignore you."



I cannot and will not subscribe to your philosophy and the 
philosophy of these few others, a philosophy of, 

"We are the chosen few and speak for everyone. We are in charge."




My choice is to honor USENET traditions and customs.

Godzilla!


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

Date: 13 May 2001 13:41:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Existing Script To Add Time
Message-Id: <9dm2ur$1a5$2@mamenchi.zrz.TU-Berlin.DE>

[Newsgroups trimmed]

According to Dodger <dodger@necrosoft.net>:
> 
> "grasshopper" <grasshopper99[no-spam]@hotmail.com> wrote in message
> news:bNJK6.22617$Hk4.384649@news1.rdc1.ab.home.com...
> > Wondering if anyone has a script (bourne or perl) available which can
> > calculate the elapsed time between two given times such as: 08:00 16:30
> > which would be an elapsed time of  08:30.
> 
> #!/usr/bin/perl
> # I could have stored vars in hashes and cut out a lot of reps with fors,
> # but I did it this way to make it easy to see what's going on.
> 
> my $start = shift;
> my $stop = shift;
> my ($starth,$startm) = split /:/, $start;
> my ($stoph,$stopm) = split /:/, $stop;
> $stoph += 24 if $stoph < $starth or ($stoph == $starth and $stopm <
> $startm);
> $startm += $starth * 60;
> $stopm += $stoph * 60;
> my $diffm = $stopm - $startm;
> my $diffh;
> while ($diffm - 60 >= 0) {
>     $diffm -= 60;
>     $diffh++;}
> printf "%02d:%02d\n", $diffh, $diffm;
> 
> 
> # On the fly - Not tested, as usual.

Why not?  There are two reasons for posting untested code: either it
is trivial and you trust yourself to get it right, or it requires
an environment you don't have and can't be expected to set up.
Otherwise, test your code, or don't post.

Anno


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

Date: Sun, 13 May 2001 14:00:22 GMT
From: "grasshopper" <grasshopper99[no-spam]@hotmail.com>
Subject: Re: Existing Script To Add Time
Message-Id: <WrwL6.31731$Hk4.502849@news1.rdc1.ab.home.com>

Thanks to those who responded... I be able to use 'em all to some degree,
and about posting the 'untested, on the fly stuff', I don't mind, as it also
the ideas on how to acomplish a task which interest me.

Thanks all,

Pete




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

Date: Sun, 13 May 2001 16:54:52 GMT
From: "Dodger" <dodger@necrosoft.net>
Subject: Re: Existing Script To Add Time
Message-Id: <w%yL6.7742$LJ4.2650811@news1.rdc2.pa.home.com>

"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:9dm2ur$1a5$2@mamenchi.zrz.TU-Berlin.DE...
> According to Dodger <dodger@necrosoft.net>:
> > # On the fly - Not tested, as usual.
>
> Why not?  There are two reasons for posting untested code: either it
> is trivial and you trust yourself to get it right, or it requires
> an environment you don't have and can't be expected to set up.

The former, in two senses.

a) the problem itself is trivial, and I trust myself to get it right
b) since its a post in comp.lang.perl.misc, it's someone else's problem, and
as such, I can't be bothered if I'm not getting paid. I'm being nice
throwing the logic out there for someone who asked. I don't need to debug
any potential typoes, too.

> Otherwise, test your code, or don't post.

I'm afraid I can't accept your authority as a controlling one for me. That
is to say, I'm not going to do what you say.

No offense, but I will continue to post as I do, with on-the-fly code, for
simple tasks such as this. If I have reason to doubt either a logic flow or
a bit o' Perl that's particularly weird, I will log in and test it. If it's
just that it has a potential typo, a missing ->, or some other such trivial
bit, it's left 'as an exercise for the reader,' as the conceptual part wil
be sound. I do include disclaimers as above, and I do get past my first -cw
without anything being fatal at least 70% of the time on big things. Nothing
in here is a big thing (or if it is, I answer with some response like 'Sure,
my rates are $80/hour US...').

Rest assured, I test my code before making it live and letting a customer
use it--just, usenet ain't customers. More importantly, I make both managers
and CS people test it, because, as you should know, the concept of
'foolproof' is best proven by testing against -- well... B^)

--
Dodger
www.dodger.org
www.necrosoft.net
www.gothic-classifieds.com





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

Date: 13 May 2001 17:57:07 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Existing Script To Add Time
Message-Id: <9dmhtj$dp6$1@mamenchi.zrz.TU-Berlin.DE>

According to Dodger <dodger@necrosoft.net>:
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
> news:9dm2ur$1a5$2@mamenchi.zrz.TU-Berlin.DE...
> > According to Dodger <dodger@necrosoft.net>:
> > > # On the fly - Not tested, as usual.
> >
> > Why not?  There are two reasons for posting untested code: either it
> > is trivial and you trust yourself to get it right, or it requires
> > an environment you don't have and can't be expected to set up.
> 
> The former, in two senses.
> 
> a) the problem itself is trivial, and I trust myself to get it right
> b) since its a post in comp.lang.perl.misc, it's someone else's problem, and
> as such, I can't be bothered if I'm not getting paid. I'm being nice
> throwing the logic out there for someone who asked. I don't need to debug
> any potential typoes, too.

If you want to describe the logic of the problem, describe it.  If
you want to post a solution in code, test it.  And do think about it
a little before you present it as exemplary.  Your 15-line solution
includes a while loop that does nothing but integer division.  This
is just thoughtless.  The whole thing can be expressed in four lines
like this:

    my ($starth, $startm, $stoph, $stopm) = map split( /:/), @ARGV;
    my $minutes = 60 * ($stoph - $starth) + $stopm - $startm;
    $minutes += 24 * 60 if $minutes < 0; # not specified, but plausible
    printf "%02d:%02d\n", int $minutes / 60, $minutes % 60;

Except perhaps for the map() everything is absolutely straightforward
and, with a moment's thought, should have occurred to you as well.  A
little diligence is required.

> > Otherwise, test your code, or don't post.
> 
> I'm afraid I can't accept your authority as a controlling one for me. That
> is to say, I'm not going to do what you say.

Up to you.
 
> No offense, but I will continue to post as I do, with on-the-fly code, for
> simple tasks such as this. If I have reason to doubt either a logic flow or
> a bit o' Perl that's particularly weird, I will log in and test it. If it's

[snip]

You will be criticized.

Anno


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

Date: Sun, 13 May 2001 09:58:27 -0700
From: "newuser" <newuser@nospam.slip.net>
Subject: Help with my html to txt perl script
Message-Id: <K%yL6.3$kj4.131@news1.dnvrcoidc.firstworld.net>

Hello,
  I am still kind of new in this perl programming but I would like if some
might be able to help me out with this problem that I am having problems
with. Attached is a copy of a html to txt perl script that should convert
all the html pages to a nice clean txt page. The problem right know is when
I run it by itself as a test it just hangs for a long time (5 min.
at the most) and I don't get any errors from my errors.log. I am sure that
the path to the perl program is correct and the permission writes are set
correctly.

#!/usr/bin/local/perl
print "Content-type:text/html\n\n";
$oldSlash = $/;
#slurp mode
undef $/;
$wholeFile = <STDIN>;
#restore old value
$/ = $oldSlash;
#treat as single line...
$wholeFile =~ s/<[^>]*>//gs;
print $wholeFile;

If someone has a better script that works and if I can use it that sure
would be appreciated.
thanks for your help and time.





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

Date: Sun, 13 May 2001 18:13:22 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Help with my html to txt perl script
Message-Id: <9dmf7f$9r2$1@newsg2.svr.pol.co.uk>

In article <K%yL6.3$kj4.131@news1.dnvrcoidc.firstworld.net>, "newuser"
<newuser@nospam.slip.net> wrote:
> Attached is a copy of a html to txt perl script that should
> convert all the html pages to a nice clean txt page. [snip]
> If someone has a better script that works and if I can use it that sure
> would be appreciated.

Off the top of my head, this should read everything from STDIN, convert
it and stick it onto STDOUT (optimised for readability rather than
obscurity...):

#!/usr/bin/perl -w

while (<STDIN>) {
  s/&/&amp;/g;   # escape ampersands
  s/</&lt;/g;    # escape <
  s/>/&gt;/g;    # escape >
  print $_;
}

Your code seemed to have some bits of CGI floating around in it. Were you
after that, or are you running it from the command-line? If you're after
CGI, how are you supposed to be getting the input?

HTH,
Ciaran

-- 
Ciaran McCreesh
mail:    keesh@users.sourceforge.net
web:     http://www.opensourcepan.com/


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

Date: Sun, 13 May 2001 12:37:00 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Help with my html to txt perl script
Message-Id: <slrn9fte1c.caf.tadmc@tadmc26.august.net>

newuser <newuser@nospam.slip.net> wrote:

>  I am still kind of new in this perl programming 


There are lots and lots of new Perl programmers...


>but I would like if some
>might be able to help me out with this problem that I am having problems
>with. 


 ... so it is very likely that one of the tens of thousands that have
gone before you has already had the same problem.

Such questions are collected up into a document called a "FAQ"
(Frequently Asked Questions).

You are expected to check there *before* posting to the newsgroup.

   perldoc -q HTML

      "How do I remove HTML from a string?"


>Attached is a copy of a html to txt perl script that should convert
>all the html pages to a nice clean txt page. The problem right know is when
>I run it by itself as a test it just hangs for a long time (5 min.
>at the most) and I don't get any errors from my errors.log. I am sure that
>the path to the perl program is correct and the permission writes are set
>correctly.
>
>#!/usr/bin/local/perl

   #!/usr/bin/local/perl -w
   use strict;

>print "Content-type:text/html\n\n";
                          ^^^^


Here you are promising to feed HTML to the browser, but I thought
your whole purpose was to feed it plain text. You shouldn't lie
to the browser like that.

I think you need a space there somewhere too, but that has
nothing to do with Perl.


>$oldSlash = $/;
>#slurp mode
>undef $/;
>$wholeFile = <STDIN>;
>#restore old value
>$/ = $oldSlash;


Let perl save-and-restore it for you:

   {
      local $/;  # defaults to undef
      $wholeFile = <STDIN>;
   }
   # $/ has it's earlier value restored here


>#treat as single line...
>$wholeFile =~ s/<[^>]*>//gs;
                           ^
                           ^
That option does not do anything with the pattern you have.

The "s" option only affects dots in the pattern. You do not have
any dots in your pattern.


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


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

Date: Sun, 13 May 2001 10:35:06 -0700
From: "newuser" <newuser@nospam.slip.net>
Subject: Re: Help with my html to txt perl script
Message-Id: <7yzL6.4$kj4.60@news1.dnvrcoidc.firstworld.net>

Hello Ciaran,

    Thanks for your help and your fast reply. I was really going after cgi
and to get the input I was going to place in my html file a link to the
test.cgi script which would look some thing like this:
<a href="http://www.test.net/~tom/test.cgi">print-friendly</a>

    If I try your way would I call the script the same way in my html file
or how would I call it?

thank again for your help
Ciaran McCreesh wrote in message <9dmf7f$9r2$1@newsg2.svr.pol.co.uk>...
>In article <K%yL6.3$kj4.131@news1.dnvrcoidc.firstworld.net>, "newuser"
><newuser@nospam.slip.net> wrote:
>> Attached is a copy of a html to txt perl script that should
>> convert all the html pages to a nice clean txt page. [snip]
>> If someone has a better script that works and if I can use it that sure
>> would be appreciated.
>
>Off the top of my head, this should read everything from STDIN, convert
>it and stick it onto STDOUT (optimised for readability rather than
>obscurity...):
>
>#!/usr/bin/perl -w
>
>while (<STDIN>) {
>  s/&/&amp;/g;   # escape ampersands
>  s/</&lt;/g;    # escape <
>  s/>/&gt;/g;    # escape >
>  print $_;
>}
>
>Your code seemed to have some bits of CGI floating around in it. Were you
>after that, or are you running it from the command-line? If you're after
>CGI, how are you supposed to be getting the input?
>
>HTH,
>Ciaran
>
>--
>Ciaran McCreesh
>mail:    keesh@users.sourceforge.net
>web:     http://www.opensourcepan.com/




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

Date: Sun, 13 May 2001 18:55:25 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Help with my html to txt perl script
Message-Id: <9dmhm9$8qd$1@newsg4.svr.pol.co.uk>

In article <7yzL6.4$kj4.60@news1.dnvrcoidc.firstworld.net>, "newuser"
<newuser@nospam.slip.net> wrote (rewrapped):

> Thanks for your help and your fast reply. I was really going after cgi
> and to get the input I was going to place in my html file a link to the
> test.cgi script which would look some thing like this: <a
> href="http://www.test.net/~tom/test.cgi">print-friendly</a>
> 
> If I try your way would I call the script the same way in my html file
> or how would I call it?

You need some way of passing the file to display to the script. I don't
recommend using referer (one 'f' or two???), it's not reliable. You could
pass the filename as a parameter (as in blah/test.cgi?file=test), and
then do the following:

#!/usr/bin/perl

use CGI;
my $cgi = CGI::new(); # is this the approved way? not sure...

# change next line to match your server
my $filename = '/home/htdocs/' . $cgi->param("file") . '.html';

print $cgi->header('text/plain');

if (-e $filename) {
  open FILE, '/home/htdocs/' . $filename or die $!;
  flock FILE, LOCK_SH;
  while (<FILE>) {
    # same as before goes here
  }
  close FILE;
} else {
  print "ERROR: file does not exist";
}

Of course, you'll have to be extremely careful you don't let anyone see
any important files that way -- a certain bank which shall remain
nameless uses Java for their online stuff, and it isn't difficult to get
hold of their password file that way... The forcing .html and hard-coding
the directory helps, but you might want to put in a few more checks (easy
exercise for the reader...).

That's just a rough outline, anyway. Play around with it until it does
what you want -- it's a good way to learn.

-- 
Ciaran McCreesh
mail:    keesh@users.sourceforge.net
web:     http://www.opensourcepan.com/


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

Date: Sun, 13 May 2001 11:04:25 -0700
From: "newuser" <newuser@nospam.slip.net>
Subject: Re: Help with my html to txt perl script
Message-Id: <BZzL6.5$kj4.123@news1.dnvrcoidc.firstworld.net>

Thanks Tad for your help and suggestions. Do you happen to know where the
site is so I can find the faq perldoc -q HTML that you mention? Sorry I am
still a little bit confused with how the final changes would look like if
you have some time can you show me. In regards to the s pattern you
said,"This is only a pattern if you have a dot" but if your webpages has for
example a baseball.html then would not this be a dot pattern.
thanks again

Tad McClellan wrote in message ...
>newuser <newuser@nospam.slip.net> wrote:
>
>>  I am still kind of new in this perl programming
>
>
>There are lots and lots of new Perl programmers...
>
>
>>but I would like if some
>>might be able to help me out with this problem that I am having problems
>>with.
>
>
>... so it is very likely that one of the tens of thousands that have
>gone before you has already had the same problem.
>
>Such questions are collected up into a document called a "FAQ"
>(Frequently Asked Questions).
>
>You are expected to check there *before* posting to the newsgroup.
>
>   perldoc -q HTML
>
>      "How do I remove HTML from a string?"
>
>
>>Attached is a copy of a html to txt perl script that should convert
>>all the html pages to a nice clean txt page. The problem right know is
when
>>I run it by itself as a test it just hangs for a long time (5 min.
>>at the most) and I don't get any errors from my errors.log. I am sure that
>>the path to the perl program is correct and the permission writes are set
>>correctly.
>>
>>#!/usr/bin/local/perl
>
>   #!/usr/bin/local/perl -w
>   use strict;
>
>>print "Content-type:text/html\n\n";
>                          ^^^^
>
>
>Here you are promising to feed HTML to the browser, but I thought
>your whole purpose was to feed it plain text. You shouldn't lie
>to the browser like that.
>
>I think you need a space there somewhere too, but that has
>nothing to do with Perl.
>
>
>>$oldSlash = $/;
>>#slurp mode
>>undef $/;
>>$wholeFile = <STDIN>;
>>#restore old value
>>$/ = $oldSlash;
>
>
>Let perl save-and-restore it for you:
>
>   {
>      local $/;  # defaults to undef
>      $wholeFile = <STDIN>;
>   }
>   # $/ has it's earlier value restored here
>
>
>>#treat as single line...
>>$wholeFile =~ s/<[^>]*>//gs;
>                           ^
>                           ^
>That option does not do anything with the pattern you have.
>
>The "s" option only affects dots in the pattern. You do not have
>any dots in your pattern.
>
>
>--
>    Tad McClellan                          SGML consulting
>    tadmc@augustmail.com                   Perl programming
>    Fort Worth, Texas




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

Date: Sun, 13 May 2001 15:05:00 GMT
From: "smash" <smash@floodbox.com>
Subject: I remember.
Message-Id: <woxL6.29085$yw.751123@news20.bellglobal.com>

Using another computer the first time I sent a message here it sent me an
email.

I was wondering if anyone had the thing to do that.

Because there is a group where I am basically the only one who posts answers
and I can't help people because they don't follow a proper format.




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

Date: Sun, 13 May 2001 19:05:58 +0200
From: "Bernhard Sept, BHS Schulungen" <b-sept@gmx.de>
Subject: looking for a Perl solution
Message-Id: <9dmevi$fbd$03$1@news.t-online.com>

Hi there,
I am looking for a source of a Perl Script, that allows me to
1. admin a little database (using a admin_user and a admin_password)
2. that forwards known users (which have been given an ok by the admin (#1)
to a HTML page and
3. that offers a form to register for unknown (new) users.

After scanning several www pages - should I use (learn) PHP to do that job?

I think, that that could exist already.

Have a nice week

Bernd






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

Date: 13 May 2001 13:29:26 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need Help: Pattern Matching Etc.
Message-Id: <9dm27m$1a5$1@mamenchi.zrz.TU-Berlin.DE>

According to Jody Fedor <Jodyman@usa.net>:
> "phookie" <phookie@xmission.com> wrote in message
> news:3AFDF5E5.289C253C@xmission.com...
> > I have a record which begins with  "<" (excluding quotes) contains
> > alphanumeric, = & etc. ends with ">" (excluding quotes) has a value
> > e.g., 1415.23 followed by a similar character string of   "<" (excluding
> > quotes) contains alphanumeric, = & etc. ends with ">" (excluding
> > quotes).
> 
> Instead of explaining it, show us a few data lines.

No, not instead.  A few data lines with no explanation are never
enough to infer the underlying structure.  We see too many of these
already: 'Hey, I have "abc123xyz", how can i parse out "123"?'

The OP has made an effort to explain the data.  Even if the explanation
was less than perfect, this is more than many first-time posters do,
and it should be commended, not criticized.

I agree that a few examples might have helped the matter.

[...]

Anno


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

Date: Sun, 13 May 2001 11:04:56 -0600
From: phookie <phookie@xmission.com>
To: Jody Fedor <Jodyman@usa.net>
Subject: Re: Need Help: Pattern Matching Etc.
Message-Id: <3AFEBEB5.66EBAE44@xmission.com>

<TD LOTUS_VALUE="BLANK" ALIGN=LEFT><font color="#ffffff"
size="3">1234.56</font></TD>
<TD LOTUS_VALUE="ERR" ALIGN=CENTER><font color="#000000"
size="3">1234.56</font></TD>
<TD LOTUS_VALUE="ERR" ALIGN=RIGHT><font color="#ffffff"
size="3">1234.56</font></TD>
Etc....

I need to replace the "TD" tag data with simply, no matter what the
attributes/values are with simply <td class="abc"> remove the font tag data
completely, parse out the numeric, remove the ending font tag and keeping the
TD tag
sometimes i need to remove the entire line if the numeric is not in a specific
range

Thanks...

Jody Fedor wrote:

> "phookie" <phookie@xmission.com> wrote in message
> news:3AFDF5E5.289C253C@xmission.com...
> > I have a record which begins with  "<" (excluding quotes) contains
> > alphanumeric, = & etc. ends with ">" (excluding quotes) has a value
> > e.g., 1415.23 followed by a similar character string of   "<" (excluding
> > quotes) contains alphanumeric, = & etc. ends with ">" (excluding
> > quotes).
>
> Instead of explaining it, show us a few data lines.
>
> > how can I check substitute all between the first set of "<" and ">" with
> > a character string such as "test" (excluding the quotes)
> >
> > How can I parse the number 1415.23 out of the record (the number is
> > seldom the same)
>
> is the number alway in the format dddd.dd??
>
> >
> > how can I check substitute all between the last set of "<" and ">" with
> > a character string such as "test" (excluding the quotes)
>
> Jody



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

Date: Sun, 13 May 2001 16:33:29 GMT
From: "flash" <bop@mypad.com>
Subject: Numbers
Message-Id: <tHyL6.80061$_f3.1473777@news20.bellglobal.com>

Hello I need 6 numbers that when you add any individual combination you
always get a unique number

(like chmod numbers) (1,2,4)

If anyone knows of anymore, i could really use them, or if someone knows of
a mathematical way to find them.




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

Date: Sun, 13 May 2001 17:50:49 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Numbers
Message-Id: <9dmdt6$34i$1@news8.svr.pol.co.uk>

In article <tHyL6.80061$_f3.1473777@news20.bellglobal.com>, "flash"
<bop@mypad.com> wrote:

> Hello I need 6 numbers that when you add any individual combination you
> always get a unique number
> 
> (like chmod numbers) (1,2,4)
> 
> If anyone knows of anymore, i could really use them, or if someone knows
> of a mathematical way to find them.

1, 2, 4, 8, 16, 32

Just start with 1 and double each time to get the next one.

-- 
Ciaran McCreesh
mail:    keesh@users.sourceforge.net
web:     http://www.opensourcepan.com/


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

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.  

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 888
**************************************


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