[12292] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5891 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 4 19:07:21 1999

Date: Fri, 4 Jun 99 16:00:23 -0700
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, 4 Jun 1999     Volume: 8 Number: 5891

Today's topics:
    Re: \n doesn't work on NT4 SP4 <amonotod@netscape.net>
    Re: Copying any files <cassell@mail.cor.epa.gov>
        Dating service script needed -matchmaker script <mto@render.es>
    Re: Efficient way to extract form tags from an HTML pag (Jamie Jackson)
    Re: Efficient way to extract form tags from an HTML pag <rootbeer@redcat.com>
        Help extracting form fields from saved html file <jwchism@BLANK.com>
        Help Killing Zombies <ra9031@email.sps.mot.com>
    Re: how to track users (w/out cookies) and write to the (brian d foy)
    Re: let me be more specific... <aqumsieh@matrox.com>
    Re: MIME-QuotedPrint Module <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 04 Jun 1999 21:03:01 GMT
From: Amonotod <amonotod@netscape.net>
Subject: Re: \n doesn't work on NT4 SP4
Message-Id: <7j9etv$nrg$1@nnrp1.deja.com>

Hey, all, good news!  Got it figured out.

Last night on my way home, I thought about a few things,
and checked out my path statement this morning.  The
first Perl.exe in my path was c:\reskit\Perl\Perl.exe.
What a crapper!  Perl version 3.something apparently was
not as stable/robust/reliable as the current KickAss
Perl we have now.  As for my script, it does all work
except for the "lc $user;".  That should have been
"$user =~ tr/A-Z/a-z/;", which works just fine.  Now if
I can just figure out how to use open(), print FILEHANDLE,
and close() successfully, I'll be all set.  Not counting
the fact that I don't know how to use modules.  But that's
something else, I'll work on it after I get productive.

Thank you all for the replies,
William


In article <3757F900.F6D28B1@mail.cor.epa.gov>,
  David Cassell <cassell@mail.cor.epa.gov> wrote:
> Fadel wrote:
> >
> > Just try print("bla bla\n");
> >  instead of print "bla bla\n";
>
> Errm, that's not necessary.  print() takes a list [after an
> optional filehandle] and is smart enough to recognize a list
> when it sees one.  So you don't need parens there.  In fact,
> parens immediately following 'print' are one of the few ways
> to confuse the print() function, as explained in the docs.
> [See perlfunc.]
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
>

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 04 Jun 1999 14:56:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Copying any files
Message-Id: <37584B70.8B03E0E5@mail.cor.epa.gov>

Alar Pandis wrote:
> 
> Hi again!
> 
> I did that, but result is that by example Word-files or ZIP-files is copied
> not correctly. I got the same result if I did this via OPEN FILE and PRINT
> etc.
> What I am doing wrong? (With TXT-files is OK!, as usually.)

Oh!  Now I see what you meant.  You need to look up the
binmode() function.  That way you can read/write binary [not 
straight text] files without ruining them.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 04 Jun 1999 23:35:48 +0200
From: Mateo Byler <mto@render.es>
Subject: Dating service script needed -matchmaker script
Message-Id: <375846B4.A43E7C47@render.es>

I need something that would work as a dating service script.
I need people to be able to ad/update/delete records.
Simple password for updating.
Special password for viewing hidden fields.
Automatic email confirmation.
All subscribed email addresses should be on a list for the webmaster
to inform of changes.
Search by different fields.
Upload of images.
Unlimited records to be able to be added (only limited by webserver
space).
And just about anything you can think of that would be needed in
something like this.

I'd like to know your bid's.  If you need more info please ask.
I need to decide within one or two days, so please reply as soon as
possible.

Thanks.

Mateo Byler




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

Date: Fri, 04 Jun 1999 22:45:02 GMT
From: wasteNOSPAMbasket@bigfoot.com (Jamie Jackson)
Subject: Re: Efficient way to extract form tags from an HTML page.--Suggestions?
Message-Id: <37585534.94319854@news.erols.com>

On Fri, 4 Jun 1999 14:07:00 -0700, Tom Phoenix <rootbeer@redcat.com>
wrote:
>Try HTML::Parser, from CPAN. Cheers!

I'd like to stay away from a module for this, and use standard Perl.
I'm trying to learn more about regular expressions, matching, etc.

Thanks, Tom,  for the suggestion.

Any other takers?  :)

Thanks,
Jamie Jackson


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

Date: Fri, 4 Jun 1999 14:07:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Efficient way to extract form tags from an HTML page.--Suggestions?
Message-Id: <Pine.GSO.4.02A.9906041406320.10794-100000@user2.teleport.com>

On Fri, 4 Jun 1999, Jamie Jackson wrote:

> Subject: Efficient way to extract form tags from an HTML page.--Suggestions?

> I am new to Perl, and I have come up with a bunch of ways to do this,
> but they are horribly unattractive and inefficient.

Try HTML::Parser, from CPAN. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 04 Jun 1999 16:23:05 -0500
From: Jeff Chism <jwchism@BLANK.com>
Subject: Help extracting form fields from saved html file
Message-Id: <375843B9.3220DEE8@BLANK.com>

I am trying to extract all of the form fields in a saved html file. What
I have so far is listed below (inspired by some of Tom Christiansen's
scripts). This code prints...

 ...
checkbox" name="highlight" value="on
checkbox" name="highlight2" value="on
 ...

My questions are this...

A. How could I change the expresssion to only print the field type (i.e.
text, textarea, checkbox) and nothing else?
B. Are my expression comments accurate?
C. Can I make this same expression generic enough to look for all form
field types (i.e. select)?

JC




while (<>) {
	$html = $_;
}

$_ = $html;

$regexpn = '
 <          # starts with a less than
 \s*        # match a single whitespace character 0 or more times
 INPUT          # match a starting INPUT
 \s+        # match a single whitespace character 1 or more times
 TYPE       # match TYPE
 \s*        # match a single whitespace character
 =          # match equals sign
 \s*        # match a single whitespace character. 
   #The component must be present 0 or more times
 ([\"\'])   # Affect order of pattern evaluation and 
   # act as pattern memory
            # create charcter class 
            # consiting of double quote or single quote
 (.*?)      # Affect order of pattern evaluation act as pattern memory
            # match any non newline character 1 or 
            # more times. Be non greedy and match smallest
            # possible string
 \1         # back reference for $1
 \s*        # match a single whitespace character. The component must be
present 0 or 
more times
  >         # a href always starts with a less than
 ';

print "$2\n" while m/$regexpn/gsix


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

Date: Fri, 04 Jun 1999 13:22:11 -0400
From: Eric Hawkins <ra9031@email.sps.mot.com>
Subject: Help Killing Zombies
Message-Id: <37580B43.A3BB136D@email.sps.mot.com>

This is a multi-part message in MIME format.
--------------35FFF2717276796A6B64ACFF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi everyone,

I am a newbie Perl programmer, and I was wondering if someone could give
me some slick way to kill zombie processes from within Perl. I have
written a Perl program that has to call some other programs (that others
have written) that do not exit gracefully. I use the following code to
invoke these external processes:

systemcall(*array_handle) = @_;

        $rc = 0xffff & system @array_handle;
        printf "system(%s) returned %#04x: ", "@array_handle", $rc;
        if ($rc == 0) { print "ran with normal exit\n"; }
        elsif ($rc == 0xff00) { print "command failed: $!\n"; }
        elsif ($rc > 0x80) { $rc >>= 8; print "ran with non-zero exit
status $rc\n"; }
        else {
                print "ran with ";
                if ($rc & 0x80) {
                        $rc &= ~0x80;
                        print "coredump from ";
                }
                print "signal $rc\n";
        }
        $ok = ($rc != 0);

}

this code does nothing as far as eliminating zombie processes is
concerned, it only checks status upon return to the parent. I use the
next set of code to kill the zombies:

open (killFILE, ">kprocs") || die "cannot open kprocs \n";
system "ps -a | grep $ARGV[0] > kprocs" || die "Failed ps -a | grep
$ARGV[0]";
close (killFILE);
open (killFILE, "<kprocs") || die "$ARGV[0] process file absent\n";
while ($line = <killFILE> ) {
    @proc = split(/ +/, $line);
    system "kill -9 $proc[1]";
    print "Killed $ARGV[0] process $proc[1] \n";
}
close (killFILE);

This is not a very elegant solution.

I thought about using some sort of signal call, but am unsure really how
to implement it. Any help here would be greatly appreciated. Please
email to:

ra9031@email.mot.com

Eric Hawkins
Senior Electrical Engineer
Motorola

--------------35FFF2717276796A6B64ACFF
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Eric Hawkins
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Eric Hawkins
n:              Hawkins;Eric
org:            Motorola
adr:            2100 Riveredge Parkway;;Suite 600;Atlanta;GA;30328;USA
email;internet: ra9031@email.sps.mot.com
title:          Senior Electrical Engineer
tel;work:       770-937-4522
tel;fax:        770-937-4534
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------35FFF2717276796A6B64ACFF--


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

Date: Fri, 04 Jun 1999 18:24:56 -0400
From: brian@pm.org (brian d foy)
Subject: Re: how to track users (w/out cookies) and write to them individually
Message-Id: <brian-ya02408000R0406991824560001@news.panix.com>

In article <4RR53.3161$5a.5681@news20.bellglobal.com>, dragnet@internalysis.com (Marc Bissonnette) posted:

> In article <brian-ya02408000R0406991102460001@news.panix.com>, brian@pm.org 
> says...
> >
> >> Only cookies or using the HIDDEN tag will work
> >> for session tracking, unless you install clickstream
> >> module for Apache or something similar.
> >
> >that's not right.  there are other ways to do it, but none of
> >them are specifically Perl.
> 
> Wouldn't you be able to do it if the navigation of each page were a form, 
> parsed by Perl?

sure, but why?  i challenge the use of "only", not the cited examples.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Fri, 4 Jun 1999 15:51:02 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: let me be more specific...
Message-Id: <x3yu2sn3ftl.fsf@tigre.matrox.com>


jamiemw@my-deja.com writes:

> So I want a script that presents a form where the user enters their
> username and password and clicks, log-in.  The script would query the
> flat-file database and return their account balance.

Ok.

> That's it.  Maybe they would be able to change their password.

Ok.

> Thanks again,

What is it that you tried to do but couldn't? Did you attempt to write
any code? If so, show us. If not, then try to.



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

Date: Fri, 04 Jun 1999 15:11:26 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: MIME-QuotedPrint Module
Message-Id: <37584F0E.240ECBE6@mail.cor.epa.gov>

[Yes, I am replying to my own message.  It was wrong.  So sue me.]

David Cassell wrote:
> 
> [snip]
> I think that if you go to the command prompt and type:
> 
>   ppm install MIME-tools

Oops.  That's MIME-Base64, not MIME-tools.. as Gisle Aas
just pointed out in another message in this thread.  D'oh.
 
> [snip of other stuff which wasn't quite so wrong]

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5891
**************************************

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