[13350] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 760 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 10 14:07:19 1999

Date: Fri, 10 Sep 1999 11:05:17 -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 Sep 1999     Volume: 9 Number: 760

Today's topics:
    Re: back for more sorting abuse <uri@sysarch.com>
    Re: batch in Perl? <rootbeer@redcat.com>
    Re: buying perl book (Help me) <neil@pacifier.com>
        Configuring Personal Web Server with Active state Perl  <Paul.Foran@analog.com>
    Re: Configuring Personal Web Server with Active state P <robertf@emerald.oz.net>
    Re: Configuring Personal Web Server with Active state P <rootbeer@redcat.com>
    Re: Disk writing Problem (Kragen Sitaker)
        help with BNF <jsun01@scully.vill.edu>
    Re: HELP!! Regular Expression GRU: Extract Text between <shades__@mitec.net>
    Re: How to perform nslookup functions in perl? <blair.kissel@mts.mb.ca>
    Re: How to perform nslookup functions in perl? (Mitchell Morris)
        HTML Parser 2.23 TokenParser without a file handle or f <ef@kwinternet.com>
        I finally created a counter with 1 small problem <al@milford2000.com>
    Re: I finally created a counter with 1 small problem <robertf@emerald.oz.net>
    Re: I finally created a counter with 1 small problem <rootbeer@redcat.com>
        I want to exit my script without sending anything back  <taylor@dynamical.org>
    Re: I want to exit my script without sending anything b <robertf@emerald.oz.net>
    Re: MSQL.pm Please Help <cnspots@mindspring.com>
    Re: Perl Compilation Roblems on RedHat 6.0 <rootbeer@redcat.com>
    Re: Perl Compilation Roblems on RedHat 6.0 <dckinder@hgo.net>
    Re: perl objects and hashes of hashes <aqumsieh@matrox.com>
    Re: perl script problem (Abigail)
    Re: Printing characters in reverse-video to screen (Abigail)
    Re: Regex Question (Abigail)
    Re: Regex Question <rootbeer@redcat.com>
    Re: Regex Question eric_poulsen@my-deja.com
    Re: Removing a line from a text file (Abigail)
    Re: Unix Trouble <AgitatorsBand@yahoo.com>
        using SSI command or howto merge many files in 1 output <pasde@geocities.com>
    Re: Win32::ODBC help <jeff@vpservices.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 10 Sep 1999 12:13:43 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: back for more sorting abuse
Message-Id: <x73dwmn3rc.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> In article <7rau9r$b0q$1@lublin.zrz.tu-berlin.de> on 10 Sep 1999 
  LR> 12:41:31 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
  >> Uri Guttman  <uri@sysarch.com> wrote in comp.lang.perl.misc:
  >> 
  >> >well, you want to eliminate that slow sort sub. time for some more
  >> >reading and studying. check out this award winning paper <gloat!> on
  >> >faster sorting:
  >> >
  >> >http://www.sysarch.com/perl/sort_paper.html
  >> 
  >> Award?  Do tell.

  LR> OK, I'll tell.  Award for the best paper on software development 
  LR> submitted to the Perl Conference 3.0.  In addition to the text in 
  LR> several formats, the slides are also at 
  LR> <URL:http://www.hpl.hp.com/personal/Larry_Rosler/sort/>.

we won in the largest category too. we got/get lots of compliments in
person and over the net. full house at our presentation and no tomatoes
were thrown. gonna be very hard to top it next year but i am
already thinking about it.

  LR> Uri has already spent his half of the prize money.  I'm still 
  LR> considering...

visiting nordstrom's with your wife will do that to you.

and we haven't received our checks yet. real soon now i hear!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 10 Sep 1999 10:23:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: batch in Perl?
Message-Id: <Pine.GSO.4.10.9909101016530.16999-100000@user2.teleport.com>

On Thu, 9 Sep 1999, Tom Kralidis wrote:

> system("batch < $file"); # $file points back to file0.tmp in this case.
> 
> ...afterwhich the system (and display) just hangs forever, 

I'm unable to replicate this behavior. Does something resembling this work
for you?

    $ cat >tempo
    echo "The batch is back!"
    ^D
    perl -lwe '$file = "tempo"; system "batch < $file"; print "Done"'
    commands will be executed using /usr/local/bin/bash
    job 936983990.b at Fri Sep 10 10:19:50 1999
    Done

 ...and then I get mail telling me the output of my batch job. Cheers!

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



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

Date: 10 Sep 1999 10:06:30 PST
From: Neil <neil@pacifier.com>
Subject: Re: buying perl book (Help me)
Message-Id: <37d93a96.0@news.pacifier.com>

sine2117@my-deja.com wrote:
> Hello, anyone have a good tip of a nice perl book. like perl cookbook or
> something ?

These are the standard introductory books:

"The Perl Cookbook" is an introductory learn-by-example book.

"Learning Perl" is a gentle introduction to Perl, for those with little
programming experience.

"Programming Perl" is an introduction for those with programming experience.

Neil


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

Date: Fri, 10 Sep 1999 17:50:24 +0100
From: Paul Foran <Paul.Foran@analog.com>
Subject: Configuring Personal Web Server with Active state Perl (win32)
Message-Id: <37D936D0.B7CCBD7A@analog.com>

How can I do it?
Thanks ,
paul.




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

Date: 10 Sep 1999 17:36:48 GMT
From: "Robert Front" <robertf@emerald.oz.net>
Subject: Re: Configuring Personal Web Server with Active state Perl (win32)
Message-Id: <7rbfjg$7pj$0@216.39.133.88>


Paul Foran <Paul.Foran@analog.com> wrote in message
news:37D936D0.B7CCBD7A@analog.com...
> How can I do it?
> Thanks ,
> paul.
>

Just follow the installation instructions.  If you have specific problems,
then post them.  I am running Microsoft personal Web Server and Active state
perl and I didn't have any problems installing.  Its all automatic.




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

Date: Fri, 10 Sep 1999 10:52:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Configuring Personal Web Server with Active state Perl (win32)
Message-Id: <Pine.GSO.4.10.9909101050160.16999-100000@user2.teleport.com>

On Fri, 10 Sep 1999, Paul Foran wrote:

> Subject: Configuring Personal Web Server with Active state Perl (win32)
> 
> How can I do it?

The docs, FAQs, and newsgroups about that server and related issues should
be able to help you. If you (or someone else reading this) don't know what
those things are or how to find them, please contact me. Cheers!

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



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

Date: Fri, 10 Sep 1999 16:19:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Disk writing Problem
Message-Id: <PcaC3.2003$N77.135430@typ11.nn.bcandid.com>

In article <19990910113531.01517.00000401@ng-ca1.aol.com>,
Jimtaylor5 <jimtaylor5@aol.com> wrote:
>>>I am having a problem with my pearl program occasionally sending multiple
>>files
>>>when a user finishes using it. I've traced the problem to users pressing the
>>>back button which of course takes them to the previous preview screens. Then
>>>when they forward again, pearl writes another file.
>>
>>Where is your Perl program writing the file?  Is it sending the file to
>>the user over HTTP, or is it writing it on the disk on your server?
>
>It is writing their inputed information to disk. I assume they hit the back key
>to reread or recheck something, but this causes a second and sometimes third
>write of their information. I don't want them to be able to go back. ...or not
>allow a second writing.

Well, you can't stop them from going back.  (Well, not easily,
ethically or reliably, anyway.  There are various methods you could use
to take control of their browser and their whole machine; rigging the
browser to crash after they hit 'submit' would probably work.  There's
probably some dirty trick you could play with JavaScript too.)

(Oh, and you should make sure you're using POST for the form
submission, not GET.  GET's semantics demand that it be idempotent;
POST's don't.  Browsers typically ask you if you really want to repost
the form data if you go to an uncached form result with 'Forward'.)

What you *can* do is avoid writing the information to two separate
files.  Some possibilities:

- When you send the form, include a hidden field that has a unique
value for each time you send the form.  Then, if someone sends the same
form twice, you can distinguish this from sending a new form.  You can
take one of several actions:
	- don't write the data, but give the user no indication of
	  this.  (Not recommended.  If the user went back, changed
	  something, submitted the change, and got an indication of
	  success, they're going to kick your ass when they find out
	  the indication of success was a lie.)
	- don't write the data, and give the user an error message.
	  (Slashdot.org does this for comment submissions, for
	  example.) This is frustrating, but sometimes it may be
	  necessary -- e.g. if submitting the form was a request to
	  bill their credit card.
	- modify the previously-written data, and tell the user what
	  you did.  (Recommended when possible.)
	- write another copy, which is what you're doing now.

Hope this helps.  (I know this isn't really a Perl question.)

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Thu Sep 09 1999
60 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Fri, 10 Sep 1999 12:51:02 -0500
From: cornmuffin <jsun01@scully.vill.edu>
Subject: help with BNF
Message-Id: <37D94506.F191229B@scully.vill.edu>

I'm not sure where to ask this question.
I need to create a set of grammar to describe the syntax of
Backus-Naur-Form, using BNF, so that any further constructs I make using
BNF, like for <integer>, <real number>, <expression>, etc. would parse
completely.  appreciate any feedback.

     x ^_^
--cornmuffin



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

Date: Fri, 10 Sep 1999 12:28:49 -0700
From: "Daniel Ulrich" <shades__@mitec.net>
Subject: Re: HELP!! Regular Expression GRU: Extract Text between two HTML Tags
Message-Id: <37d940ac_3@news5.newsfeeds.com>

$_=$yourhtml
/\<body\>([\n|\r|.]*)\<\/body\>/i;

The results will be found in the $1 variable. That should work if it doesn't
try using the ( ) insted of the [ ].

Have Fun,

Shades__

<smansoor@my-deja.com> wrote in message news:7r9bio$4hd$1@nnrp1.deja.com...
> I need some help writing a regular expression that can extract text
> between two HTML tags. For example I need to extract <BODY><IMG SRC ....
> (Some other HTML)...</BODY> the resulting text will be <IMG SRC ...
> (Some other HTML)...
>
> I am new to regular expression and by reading other posts on this
> group, I think it is very powerful tool for manipulating text. I am
> still learning and at this point not sure if this is big task or just
> a  single expression. I will appreciate your help.
>
> Thanks
>
> Shariq
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.




  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 10 Sep 1999 11:07:28 -0500
From: Blair Kissel <blair.kissel@mts.mb.ca>
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <37D92CBF.927954CA@mts.mb.ca>

Yes, I just realized that it is a zone transfer that I need to perform.  I used
the following and it worked great!  Thank you very much!!  :)

Blair

use Net::DNS;
$res = new Net::DNS::Resolver;
$res->nameservers("ns.foo.com");
@zone = $res->axfr("foo.com");
foreach $rr (@zone)
{
    next unless $rr->type eq "A";
    $rr->print;
}

Kragen Sitaker wrote:

> In article <slrn7ti8r5.8mb.jdporter@min.net>,
> John Porter <jdporter@min.net> wrote:
> >In article <37D9170C.9C6380F9@mts.mb.ca>, Blair Kissel wrote:
> >>ls -t a foo.com
> >
> >(Looks like someone needs to read the perl docs again.)
> >
> >There is a built-in function for doing what you want, called
> >gethostbyname.
>
> If you're going to flame people for asking stupid questions, please
> make sure you understand the question they're asking first.  He's not
> asking how to get the IP addresses for a particular node in the DNS
> space; he's asking how to do a zone transfer.
>
> You have accused this guy of not reading the Perl docs (because he
> asked a question -- a question, as it happens, that is not answered
> therein), and then supplied an obviously incorrect answer.
>
> Maybe you should wear a paper bag over your head for a while.
>
> Kragen
> --
> <kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
> Thu Sep 09 1999
> 60 days until the Internet stock bubble bursts on Monday, 1999-11-08.
> <URL:http://www.pobox.com/~kragen/bubble.html>



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

Date: 10 Sep 1999 16:38:50 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <slrn7tid0p.nne.mgm@unpkhswm04.bscc.bls.com>

In article <37D9170C.9C6380F9@mts.mb.ca>, Blair Kissel wrote:
>I need to perform the following:
>
>nslookup
>ls -t a foo.com
>
>This returns a list of A records for the domain.  I need to do this in
>perl and then store the resulting A records (hostname and ip address) in
>a hash.  I have looked at the Net::DNS module but can't seem to find a
>way to do it.  Can somebody help me please?
>
>Thank you,
>
>Blair

Maybe you need a newer Net::DNS module. I'm using verion 0.12, available from
CPAN (as always), and my install includes the exact code you're asking about
in the lovely "examples" section.

% perldoc Net::DNS
 ...

          Find the nameservers for a domain.

            use Net::DNS;
            $res = new Net::DNS::Resolver;
            $query = $res->query("foo.com", "NS");
            if ($query) {
                foreach $rr ($query->answer) {
                    next unless $rr->type eq "NS";
                    print $rr->nsdname, "\n";
                }
            }
            else {
                print "query failed: ", $res->errorstring, "\n";
            }

 ...

          Perform a zone transfer and print all the records.

            use Net::DNS;
            $res = new Net::DNS::Resolver;
            $res->nameservers("ns.foo.com");
            @zone = $res->axfr("foo.com");
            foreach $rr (@zone) {
                $rr->print;
            }

 ...



Using my mouse (mostly), and a little supplementary typing, I get:

	use strict;
	use Net::DNS;

	my %fwd;
	my %rev;
	my @ns;

	my $res = new Net::DNS::Resolver;
	my $query = $res->query("foo.com", "NS");
	if ($query) {
		foreach my $rr ($query->answer) {
			next unless $rr->type eq 'NS';
			push @ns, $rr->nsdname;
		}
	} else {
		die "query failed: ", $res->errorstring, "\n";
	}
	$res->nameservers(@ns);
	die "how did *THAT* happen?\n" unless @ns;
	my @zone = $res->axfr("foo.com");
	foreach my $rr (@zone) {
		next unless $rr->type eq 'A';
		print "name=@{[$rr->name]}, ip=@{[$rr->address]}\n";
		$fwd{$rr->name} = $rr->address;
		$rev{$rr->address} = $rr->name;
	}




That wasn't so bad, now was it? I hope that your need hasn't expired. Perhaps
in the future you will find "perldoc" to be a more timely assistant than
comp.lang.perl.misc can be.


HTH.


-- 
Mitchell Morris

This mind intentionally left blank.


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

Date: Fri, 10 Sep 1999 17:53:44 GMT
From: Eric Frazier <ef@kwinternet.com>
Subject: HTML Parser 2.23 TokenParser without a file handle or file name
Message-Id: <37D9449D.C554524B@kwinternet.com>

Hi,

I am not sure if I am understanding the documentation. It sounds like I
should be able to use something other than a file handle or file name in
the new() of TokenParser

I can do..
my $par = HTML::TokeParser->new("savepage.tmp") or die "fuck $!";

It but I can't seem to figure out how to do it with a scalar and have
TokeParser treat it as HTML instead of a file name. 

In one of the test programs it has something like

my $par = HTML::TokeParser->new(<<HTML) or die "fuck $!";

lines of HTML
 .. 
 ..
 ..
 ..
and 
HTML

Almost but I still am not getting it.
I tried this and couldn't get it to work. 
So my question: I have a page of HTML in $pagehtml how do I send it to
Tokeparser? I am getting tempted to change the new sub, but I know that
is bad :) And I guess woudn't matter anyway since the rest of the module
uses read.

I guess you could rephrase this question as what kind of object can I
create that you can do reads from? 

Thanks,

Eric


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

Date: Fri, 10 Sep 1999 12:56:17 -0700
From: "VC" <al@milford2000.com>
Subject: I finally created a counter with 1 small problem
Message-Id: <rtidulda1iv94@corp.supernews.com>

I created a counter that works with lots of help from many wonderfull
people.

Question:  This code prints the counter results to a different html page
how can I set it to read on the same page??

#!/usr/bin/perl
print "Content-type: text/html\n\n";
open (COUNT, "<counter.dat"); # opens the file puts into COUNT buffer the
data
$count = <COUNT>;
close COUNT;
$count++;
open (COUNT, ">counter.dat");
print COUNT $count;

close COUNT;
print $count;


Best Regards
Vin




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

Date: 10 Sep 1999 17:39:24 GMT
From: "Robert Front" <robertf@emerald.oz.net>
Subject: Re: I finally created a counter with 1 small problem
Message-Id: <7rbfoc$8c8$0@216.39.133.88>


VC <al@milford2000.com> wrote in message
news:rtidulda1iv94@corp.supernews.com...
> I created a counter that works with lots of help from many wonderfull
> people.
>
> Question:  This code prints the counter results to a different html page
> how can I set it to read on the same page??
>

You'd need to use Server Side Includes.  If your server doesn't allow that,
then you could return an image, and call the script with an image tag.




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

Date: Fri, 10 Sep 1999 10:42:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: I finally created a counter with 1 small problem
Message-Id: <Pine.GSO.4.10.9909101034120.16999-100000@user2.teleport.com>

On Fri, 10 Sep 1999, VC wrote:

> Newsgroups: alt.comp.perlcgi.freelance, comp.lang.perl.misc

Some of those alt.* names are getting seriously out of hand.

> I created a counter that works with lots of help from many wonderfull
> people.

They might have been wonderfulll if they'd directed you to the FAQ.

> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> open (COUNT, "<counter.dat"); # opens the file puts into COUNT buffer the
> data

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> $count = <COUNT>;
> close COUNT;

Uh, oh. This smells like...

> $count++;
> open (COUNT, ">counter.dat");
> print COUNT $count;

 ...a concurrency problem. Yes, this program only _pretends_ to work. Of
course, hit counters only pretend to count the number of readers of a web
page, so maybe that's all you want anyway. But see the FAQ, please, before
going any further with this. Thanks!

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



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

Date: Fri, 10 Sep 1999 09:32:38 -0700
From: Taylor <taylor@dynamical.org>
Subject: I want to exit my script without sending anything back to the users  browser
Message-Id: <37D93292.E375F3ED@dynamical.org>

I'm a graphic designer not a programmer.  I know HTML but I've only just
begun with PERL.  This may sound tike a very basic question to some of
you but none of my  friends have a clue as to what I'm talking about.

I have a script that emails form data to me.  I wrote it from a
tutorial.  It sends the email fine but it insists upon sending a
confirmation URL back to the users browser.  I do not want this because
I am using Flash and my Flash file is nearly 300k which takes a long
time to reload.  I tried deleting the part of my script that sends the
confirmation URL but now I get an error message from the server saying
the script failed to execute.  I know it's executing because I am
receiving the email.

Is it possible to make my script send the email and die?  Does my script
have to send a URL back to the users browser?  I just don't want the
page to reload.

Any suggestions would be greatly appreciated.

Taylor
sine_wave@earthlink.net




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

Date: 10 Sep 1999 17:43:18 GMT
From: "Robert Front" <robertf@emerald.oz.net>
Subject: Re: I want to exit my script without sending anything back to the users  browser
Message-Id: <7rbfvm$8t4$0@216.39.133.88>


Taylor <taylor@dynamical.org> wrote in message
news:37D93292.E375F3ED@dynamical.org...
<snip>
> Is it possible to make my script send the email and die?  Does my script
> have to send a URL back to the users browser?  I just don't want the
> page to reload.
>

I do not know how, but there was another post about this a couple days ago,
and it was answered, you may try searching.

They did not recomend doing it though, because without some feedback that
something happened, the user may just keep clicking, thinking its not
working.




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

Date: Fri, 10 Sep 1999 12:50:58 -0400
From: "CNspots" <cnspots@mindspring.com>
Subject: Re: MSQL.pm Please Help
Message-Id: <7rbdkh$v9k$1@nntp9.atl.mindspring.net>

I used print statements to tell when the program stopped.. The error logs
unfortunately arent giving me SQL error info

Kragen Sitaker <kragen@dnaco.net> wrote in message
news:6G9C3.1945$N77.131824@typ11.nn.bcandid.com...
> In article <7rb4vo$vrn$1@nntp4.atl.mindspring.net>,
> CNspots <cnspots@mindspring.com> wrote:
> >I Aplologize I'm still pretty much a novice with Perl but My error log
shows
> >no errors and I dont know how to grab the error besides that. How would I
do
> >that?
>
> Error logs are the usual place to look; I don't know what to tell you
> beyond that.
>
> What is the indication that your program does not work?
>
> Kragen
> --
> <kragen@pobox.com>       Kragen Sitaker
<http://www.pobox.com/~kragen/>
> Thu Sep 09 1999
> 60 days until the Internet stock bubble bursts on Monday, 1999-11-08.
> <URL:http://www.pobox.com/~kragen/bubble.html>




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

Date: Fri, 10 Sep 1999 10:16:07 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Compilation Roblems on RedHat 6.0
Message-Id: <Pine.GSO.4.10.9909101011120.16999-100000@user2.teleport.com>

On Fri, 10 Sep 1999, Duncan Kinder wrote:

> I am using gdbm, but I see no item in the configure routine that
> addresses this issue.

Near the end of configuration, Configure says something like this:

    Press return or use a shell escape to edit config.sh:

That's your chance to tell it that, say, i_gdbm should be 'undef' and
i_ndbm should be 'define'. Or maybe some other combination will work for
you. Good luck with it!

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



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

Date: Fri, 10 Sep 1999 13:59:54 -0700
From: "Duncan Kinder" <dckinder@hgo.net>
Subject: Re: Perl Compilation Roblems on RedHat 6.0
Message-Id: <37d946d2@News>

Yeah, but since this is a virgin RedHat install and since there is no reason
why Perl should not be able to compile perfectly under these circumstances,
I have ordered Caldera and Mandrake from Linuxmall. (A big $4.00).


A pity, because RedHat 6.0 otherwise seems like a nice distribution.  But
this sort of bug is unacceptable and I have other things to do with my time
(like study Python <g>.)

--
Regards,

Duncan C. Kinder
dckinder@mountain.net



Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.9909101011120.16999-100000@user2.teleport.com...
> On Fri, 10 Sep 1999, Duncan Kinder wrote:
>
> > I am using gdbm, but I see no item in the configure routine that
> > addresses this issue.
>
> Near the end of configuration, Configure says something like this:
>
>     Press return or use a shell escape to edit config.sh:
>
> That's your chance to tell it that, say, i_gdbm should be 'undef' and
> i_ndbm should be 'define'. Or maybe some other combination will work for
> you. Good luck with it!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Fri, 10 Sep 1999 11:55:39 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: perl objects and hashes of hashes
Message-Id: <x3yaequhibp.fsf@tigre.matrox.com>


duane powell <duane@blur.com> writes:

> The question was "But how do I define a hash of hashes within a class?"

The same way you define hash of hashes outside a class. Checkout
perldsc for lots of examples.

> A hash within a class is easy:
> 
> my $self  = {
>     _hashREF =  {};
> }

Hmmm.. you seem to use the word class when you refer to your
object. OO terminology is so confusing, even to the experts, so I will
excuse you on this one :)

In Perl, your object is basically a blessed reference to a data
structure. This data structure is usually a hash, but it can be an
array, or even a scalar (which is not that useful, but still
possible).

So, $self above is actually a hashref. And since it contains another
hashref, you have a hash of hashes already (but you need to change the
= into a => and the ; into a , first). If you need one more level of
nesting, then go ahead and do it:

	my $self = {
		_hashREF => {
			_h1 => { },
			_h2 => { },
		},
	};

As long as you remember that your object is simply a hash, you'll be
fine. Just treat it as one.

> but how do you go deeper and represent a hash of hashes?

Typing them in usually works for me :)

> Now I realize you don't have to define it in the constructor.

You don't have to. But you definitely can.

> You just code something like
> 
>   $self->{_hashREF}->{$var}->{_deeperHashREF}->{$someOtherVar}++;
> 
> in a method and it springs into existence.

This works too. But I wouldn't do that myself. I try to define my
object ASAP (ie in the constructor). Then again, I am not an OO
expert, so don't assume my approach is the best.

> Damn, perl is amazing.

Oh yeah! Just capitalize the 'p' if you refer to the language.

HTH,
--Ala



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

Date: 10 Sep 1999 11:10:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl script problem
Message-Id: <slrn7tibh4.pg8.abigail@alexandra.delanet.com>

knoxy.com (gobbly@aol.com) wrote on MMCCI September MCMXCIII in
<URL:news:19990910075507.08451.00004411@ng-fr1.aol.com>:
;; Hi there,
;; I'm having trouble getting a particular script to run on my web site. It's
;; supposed to be a message board. The URL of the message board is supposed to b
;; www.knoxy.com/cgi-local/config.pl
;; I have chmod 755'd the .pl files and uploaded them in ASCII format. But all I
;; get is the server hangup error message, and other people have reported
;; different error messages. I have pasted the script below for anyone to look a
;; to see if it's my mistake... though it probably is <g>. Any ideas? If you nee
;; more information, don't hesistate to post or email me back. Thanks, Andrew
;; 
;; #!/usr/bin/perl

There is no -w.
There is no -T.
There is no use strict;
There is no use CGI;

;; ## (1) Define the location of your files:
;; 
;; require "/cgi-local/webbbs.pl";
;; require "/cgi-local/webbbs_text.pl";

Does the server do a chroot(), or does it have a weird filesystem layout?

;; $dir = "/cgi-local";
;; $cgiurl = "http://www.knoxy.com/cgi-local/config.pl";
;; 
;; ## (2) Tailor the appearance and functionality of your BBS:
;; 
;; $UseLocking = 1;
;; 
;; $bodyspec = "BGCOLOR=\"#ffffff\" TEXT=\"#000000\"";

Eeew. Why not use different quotes?

;; $maillist_address = "gobbly/@aol.com";

Do you really want that forward slash there?

;; &WebBBS;

Well, all what the code that you showed us does is setting up variables,
and requiring libraries. We don't know what the libraries do, and we don't
know what &WebBBS does.

Do *you* know what you are doing? Or did you just got the program from
someone else? In that case, complain to the vendor/author of the program,
not here.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Sep 1999 11:11:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Printing characters in reverse-video to screen
Message-Id: <slrn7tibj0.pg8.abigail@alexandra.delanet.com>

Kushagra Vaid (kvaid@mipos2.intel.com) wrote on MMCCI September MCMXCIII
in <URL:news:37D88653.1B82B99A@mipos2.intel.com>:
<> 
<> Is it possible to use a sequence of escape characters (or some other method) 
<> Perl, to print out
<> a string of characters in reverse-video?


Only if your monitor/terminal can handle that.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Sep 1999 11:12:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regex Question
Message-Id: <slrn7tibl9.pg8.abigail@alexandra.delanet.com>

Steve Miles (smiles@wfubmc.edu) wrote on MMCCI September MCMXCIII in
<URL:news:37D920A7.637E6508@wfubmc.edu>:
{} 
{} My question is that I want to use a regular expression to remove
{} anything in the url past, say, 100 characters.


You can do that with a regex, but that would be silly. Use substr.



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 10 Sep 1999 09:11:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Regex Question
Message-Id: <Pine.GSO.4.10.9909100906410.16999-100000@user2.teleport.com>

On Fri, 10 Sep 1999, Steve Miles wrote:

> My question is that I want to use a regular expression to remove
> anything in the url past, say, 100 characters.

You could do that with s///, but it sounds like a job for substr. 

    substr($url, 100) = "...";		# Maybe like this?

> For example, if you had the url:
> $url =
> "http://www.yoursite.com/test/dir/stuff/mine/programs/dreamcast.html";
> 
> How can use use a regex to shorten it to 30 characters?
> $url = "http://www.yoursite.com/test/d";   #for example.

Of course, in general that's not going to yield a useful URL. But you knew
that. Cheers!

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



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

Date: Fri, 10 Sep 1999 17:03:21 GMT
From: eric_poulsen@my-deja.com
Subject: Re: Regex Question
Message-Id: <7rbdkf$k35$1@nnrp1.deja.com>

In article <37D920A7.637E6508@wfubmc.edu>,
  Steve Miles <smiles@wfubmc.edu> wrote:
> Hi!
>
> I have a series of entries (urls) that I'm sorting and putting on a
> dynamic web page. My problem is that some of the urls are so large
that
> they run off the browser window and the user has to scroll to see
them.
> It makes the whole page look funny.
>
> My question is that I want to use a regular expression to remove
> anything in the url past, say, 100 characters.
>
> For example, if you had the url:
> $url =
> "http://www.yoursite.com/test/dir/stuff/mine/programs/dreamcast.html";
>
> How can use use a regex to shorten it to 30 characters?
> $url = "http://www.yoursite.com/test/d";   #for example.
>
> I've looked through the docs and some books, but I can't figure it
out.
>
> Thanks for the help!
> Steve
>
> --
> =============================================
> Steve Miles (smiles@wfubmc.edu)
> ----> http://www.groundbreak.com  <----
> Wake Forest University School of Medicine
> 5019 Hanes, Medical Center Blvd.
> Winston-Salem, NC 27157
> Phone: 336.716.0454     FAX: 336.716.7200
> =============================================
>
>

Using a regexp to do this is like using a sledgehammer to swat a fly.
Try substr:

print substr($url,0,30);

If you must use a regexp:

if ($url =~ /^(.{0,30})/i)
{
 print $1;
}
else
{
 print $url;
}


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


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

Date: 10 Sep 1999 11:15:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Removing a line from a text file
Message-Id: <slrn7tibpl.pg8.abigail@alexandra.delanet.com>

Marc Haber (Marc.Haber-usenet@gmx.de) wrote on MMCCI September MCMXCIII
in <URL:news:7ra9qt$ccp$1@news.rz.uni-karlsruhe.de>:
[] ebohlman@netcom.com (Eric Bohlman) wrote:
[] >
[] >Except that, especially if they're on a GUI system, they're aware that 
[] >they have to explicitly save the file they're editing, which ought to 
[] >suggest that the changes are actually done by rewriting the whole file.
[] 
[] If we had a file system that would support the opposite of sparse
[] files, deleting lines would be possible without rewriting the entire
[] file.


Doesn't VMS allow this?



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 10 Sep 1999 16:24:20 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Unix Trouble
Message-Id: <UgaC3.3$r42.628@news.shore.net>

ljl_ljl@my-deja.com wrote:
: i have telnet access, but i'm not sure where to connect it to.
: i also dun really know how to use telnet.
: could u explain more in detail to me??

Launch your telnet program. Tell it which machine to telnet to (this
varies from program to program). Once you are connected, you will be asked
for your user name and password and then dumped into a Unix shell (most
likely). From there you're on your own! If you don't know Unix at all,
O'Reilly has a good introductory book (very slim, just the essentials).

--Art
-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Fri, 10 Sep 1999 12:46:14 -0400
From: "Pascal Deschenes" <pasde@geocities.com>
Subject: using SSI command or howto merge many files in 1 output
Message-Id: <BBaC3.688$EP3.27731@wagner.videotron.net>

Hi,
I am trying to use SSI command within a perl script. But it looks like
perl or the server can't handle the SSI prior to post it as the code
works but does not output my SSI command stuff. My goal is to
output html from many files. Say I have a header file, a core file and
a footer file each contenaining html tags, I wanna merge the whole thing
in one output. Any idea? Below is my test snippet:

#!/usr/bin/perl
print "Content-type:text/html\n\n";
print <<EndOfHTML;
<html>
<head>
<title>Test Page</title>
</head>
<body>
<h2>Hello, world!<BR>
Last modified: <!--#echo var="LAST_MODIFIED" -->
</h2>

<!--#include virtual="/logs/banner"-->
</body>
</html>
EndOfHTML
;

--
íciao!

Pascal Deschênes
mailto:pasde@geocities.com





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

Date: 10 Sep 1999 15:33:37 GMT
From: Jeff Zucker <jeff@vpservices.com>
To: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Win32::ODBC help
Message-Id: <37D923D2.CCFA04A9@vpservices.com>

"Harlan Carvey, CISSP" wrote:
> 
> > > > >       $stmt = "INSERT INTO ITEST1 (HostID,RegKey,Value,Data)".
> > > > >                 "VALUES ('$server','$rkey','$valkey','$value')";
> > > >
> > > > There is an SQL syntax error in the contents of $stmt
> > >
> > > Where?
> >
> > Try printing out $stmt to see what it actually looks like.  Hint: white
> > space!
> 
> I've tried that...

Hmm, then perhaps you are just suffering from
"trivial-error-blindness"**.  When you use the string concatenation
operator "." it does not insert a space, it just puts the two strings
together.  So in your example for $stmt, there is no space between the
end parens of your column list and the word "VALUES" and $stmt ends up
looking like this:

	INSERT INTO ITEST1 (a,b)VALUES ('$a','$b')
	                       ^^

Notice the lack of white space between the ")" and the "V".

-- 
Jeff

**A form of blindness which lets you look for big things that are wrong
but make you blind to those little itty bitty things that are wrong.  I
personally don't suffer from this form of blindness on *this* error
because I have been biten by it enough times to remember the pain of the
last time it happened.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 760
*************************************


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