[7776] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1401 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 2 10:18:24 1997

Date: Tue, 2 Dec 97 07:00:43 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 2 Dec 1997     Volume: 8 Number: 1401

Today's topics:
     Re: Confused about regex <zenin@best.com>
     Re: Confused about regex (Bart Lateur)
     Re: each() does not work?! <mortensi@idt.ntnu.no>
     Re: each() does not work?! <mortensi@stud.ntnu.no>
     Re: each() does not work?! <zenin@best.com>
     Guaranteed Profits!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <noone@nowhere.com>
     HELP WWW Program!!!!  Need help fast!!! (Rob King)
     Re: IIS 3.0 seems to ignore #EXEC directive <nima.m@tannberg.lycksele.se>
     Re: Need to know how to somehow limit file sizes in fil <zenin@best.com>
     Opening files in a Perl/Win32 script <l.boot@exacomm.nl>
     Pattern matching (or not....) <Falcon@darkwave.org.uk>
     Re: Pattern matching (or not....) (Honza Pazdziora)
     Re: Pattern matching (or not....) <ckc@dmi.dk>
     Re: Pattern matching (or not....) (brian d foy)
     Performance problem with Selena Sol's Webstore 4.0 sgoeldi@pidas.com
     Re: Performance problem with Selena Sol's Webstore 4.0 (brian d foy)
     Re: Perl Plug-In for Netscape? (Eric Hilding)
     Re: Set $0 (for ps) with Perl 5.003/Solaris 2.5? (Casper H.S. Dik - Network Security Engineer)
     simple perl problem <ngyat@isu.edu>
     Re: size of a DB <mortensi@idt.ntnu.no>
     Re: size of a DB <Harald.Joerg@mch.sni.de>
     some good perl-sites (Johan Dalstrom)
     Re: strange thing <raconway@atos-group.com>
     What's the problem with this regex? <andyc@dircon.co.uk>
     Re: What's the problem with this regex? (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 2 Dec 1997 08:05:53 GMT
From: Zenin <zenin@best.com>
Subject: Re: Confused about regex
Message-Id: <881050125.602558@thrush.omix.com>

Mark666769 <mark666769@aol.com> wrote:
: Just curious, why wasn't ! chosen instead of ^ ? Wouldn't that be more
: consistent, since ! is already the Not operator?

	Because it isn't shell friendly, and since regexps grew up in the
	world of Unix shell tools this would be problem.  Also, C code uses
	the bang quite a bit, and since the original use (or projected
	usage) of regexps was to scan for C code strings, one would have
	been double escaping them all the time (once for shell, once for the
	tool to not think it special).  This is reason the original syntax
	had () and {} excaped to be special, since it was thought that
	people would more oftin be using the literal meening to find C code
	then they would be the special meening.

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 02 Dec 1997 12:08:25 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Confused about regex
Message-Id: <3485eda5.5725821@news.tornado.be>

mark666769@aol.com (Mark666769) wrote:

>Just curious, why wasn't ! chosen instead of ^ ? Wouldn't that be more
>consistent, since ! is already the Not operator?

I would tend to agree. It would be more consistent. But then again, Perl
must be the most inconsistent programming language around. Larry
designed it this way, because it's more "natural" (as opposed to
"orthogonal") ;-).

All poking fun aside, Perl borrowed a lot of its syntax from other
languages and tools. The "!" comes from C, and the "^" from some other
regex crunching tools, like grep and awk.

HTH,
Bart.


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

Date: 2 Dec 1997 08:32:50 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Re: each() does not work?!
Message-Id: <660h3i$gb2$1@due.unit.no>

brian d foy <comdog@computerdog.com> wrote:
: >
: >No, because you can't. :-)  You can't change a key in a hash of any kind. 

: he was talking about the value, not the key, i think :)

That is correct, but I clearly see that this could be misunderstood.

Morten Simonsen


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

Date: Tue, 2 Dec 1997 09:27:32 +0100
From: Morten Simonsen <mortensi@stud.ntnu.no>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: each() does not work?!
Message-Id: <Pine.GSO.3.95.971202091534.1194A-100000@james.stud.ntnu.no>

On Mon, 1 Dec 1997, Tom Phoenix wrote:

> On 1 Dec 1997, Morten Simonsen wrote:
> 
> > I tried the same program on a UNIX-machine, running perl 5.003 with
> > EMBED, and the error did NOT occur there. So i guess I must have found a
> > bug in the database code?
> 
> Sounds likely. If the database code is using library routines on your
> machine, you may have found a bug in those. In that case, you'd need to
> get replacements for those library routines, of course. Good luck! 

I got the latest distribution of Perl for Win95 (perl5.004_02), but that
seemed to make things even worse.:-( I tried the same program again
this morning on another UNIX-machine too, and it is absolutly clear that
the each() works fine on perl5.003 with EMBED (under Solaris). Anyhow, I
cannot think of anything I could have done to produce these errors, so
I hope somebody will take affair and find that bug.

Morten Simonsen




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

Date: 2 Dec 1997 11:31:23 GMT
From: Zenin <zenin@best.com>
Subject: Re: each() does not work?!
Message-Id: <881062455.437936@thrush.omix.com>

Morten Simonsen <mortensi@stud.ntnu.no> wrote:
: I got the latest distribution of Perl for Win95 (perl5.004_02), but that
: seemed to make things even worse.:-( I tried the same program again
: this morning on another UNIX-machine too, and it is absolutly clear that
: the each() works fine on perl5.003 with EMBED (under Solaris). Anyhow, I
: cannot think of anything I could have done to produce these errors, so
: I hope somebody will take affair and find that bug.

	What DB lib are you using?  Berkeley DB, GNU DBM, New DBM, or?  What
	version?  What's the output of perl -V?

	I've had similar problems with Berkeley DB when running under IRIX. 
	I could add and select records directly without problem, however the
	listing functions (each(), keys(), values()) would "miss" huge parts
	of the database.  I have up on Berkeley DB for SysV boxes after
	that. -GDBM works well on SysV trash, if it is slow and disk heavy.
	Berkeley DB works fine under BSD (eg, real) derived systems from
	what I can tell.

-- 
-Zenin
 zenin@best.com


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

Date: 1 Dec 1997 04:56:28 GMT
From: AMM Agent <noone@nowhere.com>
Subject: Guaranteed Profits!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <65tg1s$1rk$1685@joe.rice.edu>

                        BRAND NEW !
                       International
                     Absolutely NOT MLM!

  The only "Hands-Off" Opportunity that 100% GUARANTEES
     you a positive cash flow or YOUR MONEY BACK!
* Launching World-wide Now!
* Potential to be one of the fastest growing projects on
  AND off the Internet
* No Sponsoring, No Selling, No Prospecting, No Postcard
  Mailing!
* One time out of pocket cost, but system can develop
  monthly residual income!
* Once you submit YOUR enrollment, YOUR JOB IS DONE!
* We have combined OUR system with an extremely powerful
  pay plan that can create a $10,000.00 per month, or more,
  RESIDUAL income for you inside of eight to 12 months.
  http://www.dreambiz.com/chart.html
* We are so confident that this system WILL create a
  positive cash flow for you in 90 days, that we are willing
  to back it up with a complete, 100% Money Back Guarantee if
  it doesn't!

  There is no other company in this industry that can or will
  offer a guarantee that strong.  Why do we?  Because what we
  have here works, and we know it works for EVERYONE!!!
Since your income system is operated almost completely on
"Auto-Pilot", which is serviced by us, there is absolutely
NO WAY for you to throw a monkey wrench into the system.
With the Auto-Pilot, you do not get involved with any of
the crucial elements of success.
This would be fatal in any other business, but with the
Auto-Pilot, we have automated a three step process that
completely covers all of the vital elements.
Simply plug in and watch your business and income grow,
month after month.

We have implemented probably the strongest guarantee
this industry has ever seen.  If you haven't seen it,
hold on - because this is going to be one of the reasons
we will explode on to the scene!  Our guarantee is
simple, and we have the only opportunity that guarantees a
positive cash flow or sends your money back if it doesn't.
            WRITE DOWN THIS CONTROL CODE -
        YOU WON'T BE ABLE TO PROCEED WITHOUT IT
               CONTROL CODE: HO827711
Are you willing to spend just a few minutes to learn how to
retire wealthy in 2 years, or less, with a growing monthly
income, if we can PROVE to you that everything here is
completely true?  If so,
             For domestic readers, you can get a quick
         overview, call toll free 888 - 693 - 5490  24 hours
                   (Have Paper & Pen Handy)
                   Or call Customer Service at
                          (940) 383 - 1233
    9am-9pm CST Monday - Friday, 9am-5pm Saturday,
                        or 12pm-6pm Sunday
  Then, for enrollment forms, detailed info, and the proof that
  it works on automatic, call the Fax on Demand from your fax
           machine    703 - 736 -1600, DOC #825
         (be prepared for the lines to be busy)
                        OR,
The fastest way to get info and lock in an early position is to
visit our website at  http://www.dreambiz.com  or to quickly
           apply at http://www.dreambiz.com/ap.html
(This will be the most convenient for overseas readers)
You can print the forms you will need, and enroll by fax, phone,
email or snail mail. Your Auto pilot starts working for you the
week after your enrollment is received.

        You'll need the control code there:  HO827711
           (Note:  The system can't process entries
                     without a valid control code)
You'll also be given the phone # to talk to a live customer service rep.
This IS an International Project -- available anywhere in the world



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

Date: Tue, 02 Dec 1997 07:55:06 GMT
From: rmk1825@cs.tamu.edu (Rob King)
Subject: HELP WWW Program!!!!  Need help fast!!!
Message-Id: <3483beb9.1585932@news.tamu.edu>

Hello,

I am trying to make a program that interacts with a database and shows
the information on a web page.  If anyone knows of any web pages with
information on how to do this or if anyone has some sample files
(code) that would help me, would you please send them to me?  They
don't only have to be in PERL, I am willing to try any language that
will make it easier for me to get this done soon.


Thanks,



Rob King


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

Date: Tue, 2 Dec 1997 11:03:26 +0100
From: "Nima Mortazavi" <nima.m@tannberg.lycksele.se>
Subject: Re: IIS 3.0 seems to ignore #EXEC directive
Message-Id: <660m3a$svr$1@zingo.tninet.se>

Hi

Kerry Peterson skrev i meddelandet <3479DCA6.D11453F2@cns.uni.edu>...
>In trying to execute a perl script from within a .htm document, it seems
>
>to ignore the line <!--#exec cgi="testit.pl"-->, as if I'm running IIS
>2.0. We're running NT 4.0 with IIS 3.0. I've renamed the doc with a .stm

Do you use IIS 3.0 in NT workstation or NT Server ?






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

Date: 2 Dec 1997 08:09:31 GMT
From: Zenin <zenin@best.com>
Subject: Re: Need to know how to somehow limit file sizes in file uploads with Perl
Message-Id: <881050344.357273@thrush.omix.com>

Bryan Jones <jonesb@wam.umd.edu> wrote:
: I'm trying to put together a perl script which will allow me to upload
: files to a Msql database.  I need to know how I might be able to limit
: the size of the files which are being uploaded to the server.  I
: understand that it might probably take uploading it first then looking
: at the file size.  BUT HOW DO YOU DO THIS IN PERL?

	This HIGHLY depends on what protocal you're using to upload the
	files.  HTTP/CGI, FTP, RCP, ZMODEM, et al?

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 02 Dec 1997 12:28:26 +0100
From: Leon Boot <l.boot@exacomm.nl>
Subject: Opening files in a Perl/Win32 script
Message-Id: <3483F0DA.D2C6AF1A@exacomm.nl>

<HTML>
Hi!

<P>I'm having this particular problem:

<P>Within a Perl Script I want to open a file, which contains the line
<B>string1:string2</B>.
<BR>I use the following script:

<P>open FILE, "c:\file.txt";

<P>while ($myline = &lt;FILE>) {
<BR>&nbsp; @myarray = split /:/, $myline;
<BR>&nbsp; print "[" . @myarray[1] . "] [" . @myarray[2] . "]";
<BR>}

<P>close FILE;

<P>The only output the program returns are the brackets I placed ([] []),
without the strings
<BR>between them. Does anyone know what I'm doing wrong here?

<P>Greetins, Leon Boot
<BR>(leonboot@zeelandnet.nl)

<P>P.S.: Please respond by e-mail, since I haven't got much time to check
newsgroups!</HTML>



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

Date: Tue, 02 Dec 1997 11:22:43 +0000
From: -=Falcon=- <Falcon@darkwave.org.uk>
Subject: Pattern matching (or not....)
Message-Id: <3483EF83.5775@darkwave.org.uk>

With Perl4 (yes I know it's not 5, but what can you do when the
management
won't upgrade?) why won't a simple m// style pattern match NOT find ++
chars?

With a substring 

$word = "C++";		

And a larger string

$Description = "This is a test to find and match C++ in a large string";

Why doesnt 

if ($Description =~ /$word/i) {
	print "Found it\n";
} else {
	print "Nope!\n";
}

work?

If I use /[$word]/i it works but then matches c, + and + as separate
entities,
and with multiple word searches this is a problem!

How can I get it to find $word "C++" as one WHOLE entity?

-- 
      .---.        .-----------     Peter James Truman
     /     \  __  /    ------           -=Falcon=-
    / /     \( -`-,   -----           
   //////    '~ (    ---          Falcon@darkwave.org.uk
  //// / // :    ; ---      http://www.falcon.darkwave.org.uk/      
 // /   /  /)   / --        
/          //..\\ 
==========UU====UU===========================================================
          '//||\\`    And if you bore me...you lose your soul to me...
            ''``



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

Date: Tue, 2 Dec 1997 12:13:57 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Pattern matching (or not....)
Message-Id: <adelton.881064837@aisa.fi.muni.cz>

-=Falcon=- <Falcon@darkwave.org.uk> writes:

> With Perl4 (yes I know it's not 5, but what can you do when the
> management
> won't upgrade?) why won't a simple m// style pattern match NOT find ++
> chars?
> 
> With a substring 
> 
> $word = "C++";		
> 
> And a larger string
> 
> $Description = "This is a test to find and match C++ in a large string";

[...]

> If I use /[$word]/i it works but then matches c, + and + as separate
> entities,
> and with multiple word searches this is a problem!
> 
> How can I get it to find $word "C++" as one WHOLE entity?

You might want to check perlre man page, or whatever was coming with
perl4 distribution as documentation about regular expression. Or see
docs on web.

Anyway, the problem is not with perl4, the problem is that you do not
give it a correct regexp. Since + is matachar in regular expressions
meaning positive number of previous entity, you will probably want to
quote it $word = "C\\+\\+";

Also, /[$word]/i does exactly what you told it to do, [ and ] are also
documented.

Another way might be using function index that searches for substrings.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 02 Dec 1997 13:22:05 +0100
From: Casper Kvan Clausen <ckc@dmi.dk>
Subject: Re: Pattern matching (or not....)
Message-Id: <wvp67p8djf6.fsf@hobbes.ejoper.dmi.min.dk>

-=Falcon=- <Falcon@darkwave.org.uk> writes:

> With Perl4 (yes I know it's not 5, but what can you do when the
> management won't upgrade?) why won't a simple m// style pattern
> match NOT find ++ chars?

Because a + is a regex metacharacter, and such beasts must be escaped
if they're meant literally.

Regards,
Kvan.,
-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- | unattempted is impossible.'
           Lokal 544		 |
I do not speak for DMI, just me. | - Lord Mhoram, Son of Variol.


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

Date: Tue, 02 Dec 1997 07:44:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Pattern matching (or not....)
Message-Id: <comdog-ya02408000R0212970744580001@news.panix.com>

In article <3483EF83.5775@darkwave.org.uk>, Falcon@darkwave.org.uk wrote:

>With Perl4 

> why won't a simple m// style pattern match NOT find ++
>chars?

>$word = "C++";          

>if ($Description =~ /$word/i) {
>        print "Found it\n";
>} else {
>        print "Nope!\n";
>}


the + character is a meta-character, so it isn't doing what you think it
is when used as a pattern.  some options:

   * change the pattern:  $word = 'C[+][+]'; and so on.

   * quote the meta-characters: $word = 'C\+\+';

   * rewrite quotemeta so you can use it with Perl4

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 2 Dec 97 11:22:31 GMT
From: sgoeldi@pidas.com
Subject: Performance problem with Selena Sol's Webstore 4.0
Message-Id: <3483ef77.0@news.datacomm.ch>

We installed and modified the webstore.cgi from Selena Sol.
We have about 2600 articles. Performance is very slow. At this
point of the script, the server is idle for about 2 minutes:

------------------ begin of the part ------------------------

    open (DATABASE, "$data_file") || &CgiDie ("I am very sorry, but I was 
	unable to open the database, $data_file.  Please make sure that
	you have defined the correct path and set the permissions of the
	file to be readable by the web server and that the directory it is
	in is executable and readable.  Note:  This error occurred in the
	Add to Shopping Cart Routine");
    while (<DATABASE>)
      {

# We will go through the database line by line splitting each database row
# at the delimiter (|) and assigning it to @database_row

      @database_row = split (/\|/, $_);

# Then we will find out what the database id number associated with that
# row is by "popping" it off the end of the row.  Notice that it is
# crucial that unique database id number is ALWAYS the last field in every
# database row.  Then we will take off the hard return at the end of the
# database id number, and add it back to the end of the @database_row
# array again.  Afterall, we have grabbed the number for our own uses, but
# want the database row array to be intact.  Popping it out actually
# removes it...pushing it back in is the answer.

      $db_id_number = pop (@database_row);
      chop $db_id_number;
      push (@database_row, $db_id_number);

# Now we need to get a unique number for the clients shopping cart
# database.  Afterall, if the client wants to modify items or delete
# items, the script will need to identify her items absolutely.  So...we
# will assign them their own id number with the counter subroutine in
# cgi-lib.sol.  However, so that no-one else uses the counter file at the
# exact same time, we will temporarily lock it with the lock routines in
# cgi-lib.sol.

      &GetFileLock("$counter_file.lock");
      &counter($counter_file);
      &ReleaseFileLock("$counter_file.lock");

# Now, start checking the list of add_items.

      foreach $item (@add_items)
        {

# If it happens that the $item from @add_items is the same as the dbase id
# number we popped off the current row, then we know that we have found
# one of the items that the client has ordered.

        if ($item eq $db_id_number)
          {

# So we are going to create a variable called $shopper_row which will be
# used to store a database row that will be added to the client's shopping
# cart.  In this case, the first field for this new row will be the
# quantity submitted by the cleint ($field).  We will use the same pipe
# (|) delimitation we used for the store database.

          $shopper_row .= "$form_data{$item}\|";

# Now, add to the new database row all of the information from the store
# database row.  append (.=) each field in the store's database row to the
# $shopper_row variable.  BTW, we will also create a flag variable called
# $something_ordered which will remember that the current database row
# actually ended up being one of the ones we wanted.  More on that in a
# bit.

          foreach $field (@database_row)
            {
            $something_ordered = "yes";
            $shopper_row .= "$field\|";
            }

# Finally, let's tag on the value of $item_number gathered from our
# counter program to the end of the shopping cart database row.  This will
# be the unique db id number that we will use to modify and delete cart
# items.  Also, tag on a new line character so that we know we are done 
# with one database row.  The after we are done going through the
# database, close it up.

          $shopper_row .= "$item_number\n";
          } # End of if ($item eq $db_id_number)
        } # End of foreach $item (@add_items)
      } # End of while (<DATABASE>)
    close (DATABASE);

------------------ end of the part ------------------------

Has anyone an idea, how i can speed up the process?
mail to 
sgoeldi@pidas.com
or
stephan_goeldi@hotmail.com

Thanx in advance


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

Date: Tue, 02 Dec 1997 07:30:10 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Performance problem with Selena Sol's Webstore 4.0
Message-Id: <comdog-ya02408000R0212970730100001@news.panix.com>

In article <3483ef77.0@news.datacomm.ch>, sgoeldi@pidas.com wrote:

>We installed and modified the webstore.cgi from Selena Sol.
>We have about 2600 articles. Performance is very slow. At this
>point of the script, the server is idle for about 2 minutes:

>Has anyone an idea, how i can speed up the process?

moving away from the flat file database would be a good start :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 2 Dec 1997 08:18:50 GMT
From: eric@garlic.com (Eric Hilding)
Subject: Re: Perl Plug-In for Netscape?
Message-Id: <660g9a$c36$1@bulb.garlic.com>

Tad McClellan (tadmc@metronet.com) wrote:
: Eric Hilding (eric@hilding.com) wrote:
: : I've looked around but just can't seem to find the
: : info on an alleged Perl 'Plug-In' for Netscape.  Any
: : references would be appreciated.  Tnx.

: Where did you hear the allegations?

It was on a Tcl related website somewhere...can't remember where,
but sent an inquiry to an e-mail link on the page in the wee hours
of the morning.  After several days, still no response so I posted.

: I've not heard of such a thing.

Someone had apparently asked them (I think now it was one of the
Sun websites) the same question before, and reference was made to
the *alleged* existence of a Perl plug-in for Netscape...and that
info was available via "the web".  That started my quest...but so
far it's been nada zippo squato.

: What do you want to do that you need a plugin for?

Unless I'm in outer space, a creative little project to be able
to use Netscape as a graphical front-end for doing some perl
script processing locally on my PC (NON web stuff).

In response to my post, someone else mentioned that maybe it
was perlscript that I was in search of.  Ummh, perhaps *that* is
what the website text meant to refer to instead of Perl itself.
But the text said Perl... *not* perlscript.  

Darn...I wish I knew where the heck that website was now ;(


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

Date: 2 Dec 1997 07:26:05 GMT
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Set $0 (for ps) with Perl 5.003/Solaris 2.5?
Message-Id: <casper.881048020@uk-usenet.uk.sun.com>

[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

Ed Kubaitis <ejk@uiuc.edu> writes:

>On porting the app to a Solaris 2.5.1 system though,
>I find this nifty feature no longer works. Am I
>missing something, or just SOL on Solaris?


Jyst SOL on Solaris.

You could use /usr/ucb/ps.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

Date: Tue, 02 Dec 1997 01:17:30 -0700
From: Ann <ngyat@isu.edu>
Subject: simple perl problem
Message-Id: <3483C41A.9680F18F@isu.edu>

Hi,I am a beginner of perl. I tried to write a perl program to fix a
text file (input file) with
                     some broken paragraphs. In that execise, I was
asked to input a file, like the following, with
                     some "tab" and "blank line" between the paragraph.
When I see either "tab" or a "blank
                     line", I will take it as another paragraph.

    XXXXXXXXXXXXX. XXXXXXXXXX,XXXXXXXXXXX. XXXXXXXX.
XXXXXXX.
YYYYYY. YYYY,YYY.

YYY,YYY. YYYY.
ZZZZ.ZZZZ.

XXXX,XXXX.

                     And I will get the output to another file like
that:
    XXXXXXXXXXXXX. XXXXXXXXXX,XXXXXXXXXXX. XXXXXXXX.
XXXXXXX. YYYYYY. YYYY,YYY.

    YYY,YYY. YYYY. ZZZZ.ZZZZ.

    XXXX,XXXX.

                     However, after several tries on the perl, I still
get stucked. If anyone know how to do this  problem just let me know, I
will appreciate! thanks,



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

Date: 2 Dec 1997 08:42:17 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Re: size of a DB
Message-Id: <660hl9$gb2$2@due.unit.no>

Morten Simonsen <mortensi@idt.ntnu.no> wrote:
: Hi

: I have made a DB which consists of a key: <a_number:name> and
: a attribute <a_name>. Together each tuple is about 30 byte. 50000
: entries of this makes me a DB of 32 740 352 byte, which is way beyond 
: (30 * 50000) = 1.5 MB. I am using SBM_File (I think (using dbmopen)),
: if that has anything to do with it.. The dir-file is small (4K).

Another comment on this subject: In my doc it says that SDBM_File has
"small" database size. Is this supposed to be a joke? Unfortunantly I
have not tested this anywhere else than on my own personal computer
running perl5.004 for win95(32), but if this is "small", then I wonder
what size "large" is...

Morten Simonsen 


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

Date: Tue, 02 Dec 1997 10:45:35 +0100
From: Harald Joerg <Harald.Joerg@mch.sni.de>
Subject: Re: size of a DB
Message-Id: <3483D8BF.7E42@mch.sni.de>

Morten Simonsen wrote:
> : I have made a DB which consists of a key: <a_number:name> and
> : a attribute <a_name>. Together each tuple is about 30 byte. 50000
> : entries of this makes me a DB of 32 740 352 byte, which is way beyond
> : (30 * 50000) = 1.5 MB. I am using SBM_File (I think (using dbmopen)),
> : if that has anything to do with it.. The dir-file is small (4K).
> 
> Another comment on this subject: In my doc it says that SDBM_File has
> "small" database size. Is this supposed to be a joke? Unfortunantly I
> have not tested this anywhere else than on my own personal computer
> running perl5.004 for win95(32), but if this is "small", then I wonder
> what size "large" is...

 ...and be aware that SDBM_File is broken on FAT (i.e. non-NT) file
systems, and hence on Windows95. The activeware release notes said
so, but the problem apparently persists with 5.004.
Try the following code:
-----------------------------------------------------------------
use Fcntl;
use SDBM_File;

tie %db,"SDBM_File","/tmp/test_Sdb",O_RDWR | O_CREAT,0666;
$i = 0;
$next = 10;
while (++$i) {                   # always true
    $db{$i}  =  $i;              # add key/value pair $i
    if (keys %db  !=  $i) {
        print "$i keys added, ", scalar keys %db, " keys found\n";
        last;                    # quit if "keys" returns wrong number
    }
    if ($i >=  $next) {          # show progress
        print "$i keys processed\n";
        $next *= 2;
    }
}
----------------------------------------------------------------
This code should run forever, but it doesn't on Win95: On
my PC it terminates with "429 keys added, 377 keys found".
You don't actually *lose* the records, just the keys() and
values() function returns wrong values.

That's why I am grateful for the DB_File port, which seems
to work on Windows95 as far as I can say (>50000 records).
--
Oook,
--haj--


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

Date: 2 Dec 1997 10:05:05 GMT
From: sap1d@canit.se (Johan Dalstrom)
Subject: some good perl-sites
Message-Id: <660mgh$l19@dos.canit.se>

Hey..

I'm learning perl and I'd like to know if there are any good
tutorials and FAQ's etc..

If you know any good sites.. Please mail me or post it in the
group.


/ sap1d

-- -
sap1d@xy.org    /             - perl -                    
sap1d@canit.se / There's more than one way to do it
                                               - --


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

Date: Tue, 2 Dec 1997 09:45:24 +0100
From: "R. Allen Conway" <raconway@atos-group.com>
Subject: Re: strange thing
Message-Id: <14953E9BAF17D111926800805FA66B7126778A@hermes.atos-group.com>

Perhaps such a line comes from a subroutine and is used to return a value.

Jeremy D. Zawodny a icrit dans le message
<34848910.209327466@woody.wcnet.org>...
>[original author automagically cc'd via e-mail]
>
>On 1 Dec 1997 20:48:46 GMT, woltetch@aol.com (WOLtetch) wrote:
>
>>I have encountered satatements like this:
>>$variable if /pattern/
>>
>>could someone explain how this works? Do only the matches end up in
&variable?
>
>Taken out of context like that, it's hard to imagine why one would do
>that. But my lack of imagination probably has little bearing on the
>original programmer's intent.
>
>I would have expected a change to the variable or some other action
>based on the pattern match.
>
>Maybe: $var++ if /^increment$/oi;
>
>Who knows...
>
>Jeremy
>--
>Jeremy D. Zawodny                 jzawodn@wcnet.org
>Web Server Administrator          www@wcnet.org
>Wood County Free Net (Ohio)       http://www.wcnet.org/



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

Date: Tue, 02 Dec 1997 11:38:21 +0000
From: Andrew Collington <andyc@dircon.co.uk>
Subject: What's the problem with this regex?
Message-Id: <3483F32C.342C@dircon.co.uk>

Hi there.

I have a few lines in a program of mine that is meant to extract the
META content tag in an HTML file.
However, when I come to display this content it doesn't appear to have
worked.  And I think the problem lies with it not extracting the content
correctly.
The code looks like:

    if (($line =~ /<[^>]*META[^>]+NAME\s*=[ "]*description[
"]+CONTENT\s*=\s*"(([^>"])*)"[^>]*>/i) && ($use_metas==1)) {
      $content{$FILE}=$1;
      $line=$1;
      }

The $user_metas is set to 1, yet it still doesn't print out the
$content{$FILE};
In my HTML file I have:

<meta http-equiv="Description" content="This page shows the different
names." name="Description">

And I ahve also tried it with name="" before the content, but this also
had no effect.
If anyone could point out what I'm doing or suggest anything I'd
appreciate it. 

Thanks very much.

Andy


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

Date: Tue, 02 Dec 1997 07:38:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: What's the problem with this regex?
Message-Id: <comdog-ya02408000R0212970738110001@news.panix.com>

In article <3483F32C.342C@dircon.co.uk>, avert@dial.pipex.com wrote:

>I have a few lines in a program of mine that is meant to extract the
>META content tag in an HTML file.

>The code looks like:
>
>    if (($line =~ /<[^>]*META[^>]+NAME\s*=[ "]*description[
>"]+CONTENT\s*=\s*"(([^>"])*)"[^>]*>/i) && ($use_metas==1)) {
>      $content{$FILE}=$1;
>      $line=$1;
>      }

><meta http-equiv="Description" content="This page shows the different
>names." name="Description">

it really would be much easier if you used the extended format (with
comments) when you asked about a complex or long regex.  in this case,
the match fails (at least) because NAME is after CONTENT, whereas your
pattern has NAME before CONTENT.

perhaps you should use an HTML parser, or if you want to do it 
yourself, parse the tag into attributes and values, then pick out the
bits that you need rather than trying to foresee every possible
pattern.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
wonders what http-equiv="Description" does


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 1401
**************************************

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