[13591] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1001 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 6 12:10:38 1999

Date: Wed, 6 Oct 1999 09:10:26 -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: <939226226-v9-i1001@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 6 Oct 1999     Volume: 9 Number: 1001

Today's topics:
    Re: print errors (M.J.T. Guy)
        Project Management System <yves.thommes@interact.lu>
        pulling out a paricular DB Hash entry mandersjones@my-deja.com
    Re: Pulling positional data from a string <cpc999@lzwg02-na.comm.mot.com>
        Question on Traversing through a File <stockerj@bellsouth.net>
    Re: regexp question - last occurrence of an expression  <aqumsieh@matrox.com>
    Re: Response appreciated but.... (Greg Bacon)
    Re: Response appreciated but.... <jb4mt@verbatims.com>
    Re: Response appreciated but.... <jb4mt@verbatims.com>
    Re: Response appreciated but.... <kbandes@home.com>
    Re: To Abigail re: reading current threads <msalter@bestweb.net>
    Re: To Abigail re: reading current threads <uri@sysarch.com>
    Re: To Abigail re: reading current threads <jb4mt@verbatims.com>
    Re: To Abigail re: reading current threads <uri@sysarch.com>
    Re: To Abigail re: reading current threads <elaine@chaos.wustl.edu>
    Re: To Abigail re: reading current threads <ltl@rgsun5.viasystems.com>
    Re: To Abigail re: reading current threads <kperrier@blkbox.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 6 Oct 1999 13:51:51 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: print errors
Message-Id: <7tfk5n$hpg$1@pegasus.csx.cam.ac.uk>

In article <37FA7626.AAACD0C8@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>
>I haven't seen a situation where print() doesn't write to the
>file without there being an error on open() or on close().

You've obviously never suffered from a full partition.   In that case
(at least on Solaris 2.6 [1]), you get an error return
"No space left on device" from the print(), but no error on either
open() or close().

And no doubt there are other cases as well.   Quota, file size limit
and maximum file size come to mind.


[1]  This behaviour is certainly platform dependent.   For example,
     on SunOS 4.1.3, both the print() and the close() report failure,
     but $! is zero in both cases.


Mike Guy


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

Date: Wed, 06 Oct 1999 15:41:35 +0200
From: Yves Thommes <yves.thommes@interact.lu>
Subject: Project Management System
Message-Id: <37FB518F.F58E762E@interact.lu>

Greetings

Anybody knows where I can find a Project Management System/Solution that
runs on a Linux server ?
User will have to access from nearly any platform, Linux, Mac, Windows
to this System, so I guess it will have to be Web-Browser oriented,
which most project management systems are.
I was unable to find a good and suitable system until now. Can you help
?


Thanks a lot
Bye


Yves Thommes



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

Date: Wed, 06 Oct 1999 15:09:51 GMT
From: mandersjones@my-deja.com
Subject: pulling out a paricular DB Hash entry
Message-Id: <7tfong$t4b$1@nnrp1.deja.com>

Is it possible to pull out the nth value from a DB hash file i.e. so
that you can say 'for entries 10 to 20 get the value and keys'.
Otherwise I'll have to set up separate index file won't I?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 6 Oct 1999 08:23:22 GMT
From: "Ralph Grothe" <cpc999@lzwg02-na.comm.mot.com>
Subject: Re: Pulling positional data from a string
Message-Id: <01bf0fd3$78fd8560$480e7891@be14p072>

For cutting a specified number of characters from a string
you may use the 
substr(EXPR,OFFSET[,LEN]) 
function
read the POD (i.e. "perldoc -f substr")

The sorting could be done in a loop head in 
conjunction with the sort function and the
so called spaceship operater (i.e. <=>)
if numerals are involved,
or the cmp operator for literals.

For details consult the POD 
(e.g. "perldoc perlfunc" or "perldoc perl" to see
what chapters dealing with your sort of question
are appropriate)

Ralph

Kermit Lowry; III <ultrak@my-deja.com> wrote
>  The following code snippet is from a ksh script that I am trying to
> convert to Perl.
> The script pulls each line from a file, grabs digits from positions 21
> - 24 that determines the rest of the pertinent data on that line, and
> then truncates the line at ( 24 + cut -c21-24) positions.  $x is a
> count that gets appended to the beginning of each line to keep the
> sorted data in read sequence order during the sort.  This number is
> discarded after the sort is complete.
> 
> My first question is how to cut the positional data from the string?
> And second is how do accomplish the sort?
> 
> 
> **************************************
> while read iline
> do
>    datalen=`echo "$iline" | cut -c21-24 | tr -d ' '`
>    (( totreclen = datalen + 24 ))
>    echo "$iline" | eval cut -c1-${totreclen} | sed "s/^/$x /g" >>
> ${cashfile}f
>    (( x = x + 1 ))
> done
> 
> # sort by inode (ascii) then sequence (numeric)
> 
> sort -T /tmp -k2.1,2.9 -k1,1n ${cashfile}f | sed 's/^[0-9]* //' >
> ${cashfile}.yy
> y
> 
> TIA,
> -- Kermit Lowry, III
> ----------------
> "Only you can prevent forest fires!" -Smoky
> klowry@DELETEfhlbatl.com
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 


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

Date: Wed, 06 Oct 1999 11:46:16 -0400
From: Joe Stocker <stockerj@bellsouth.net>
Subject: Question on Traversing through a File
Message-Id: <37FB6EC8.ECF77546@bellsouth.net>

Hello.
I am trying  to open a file and read in one character at a time and then

print out the value to the screen after changing the value of the
character, but I'm not doing something right, someone help me please!

Here is the current output of the script :
Input File: test (where test is a text file containing the sentence
"abc")
Enter the algorythm: 1
,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
(Notice that it doesn't stop at ,1,2,3 it keeps going through the rest
of the IF statements)


What I want to happen is this:
Input File:test (where test is a text file containing the sentence
"abc")
Enter the algorythm:1
,1,2,3


#!/usr/bin/perl
#This script changes the value of a letter to a number and then
multiplies it by  $ALG
print "Written By: joe (stockerj\@bellsouth.net)\n\n";
print "Input File: ";
chomp($input=<STDIN>);
print "Enter the algorythm: ";
chomp($ALG = <STDIN>);
open(FILE,"$input");
while(<FILE>)
{
$line = $_;
if ($line = "a")
{$result = 1;
print ",";
print $result * $ALG;}
if ($line = "b")
{$result = 2;
print ",";
print $result * $ALG;}
if ($line = "c")
{$result = 3;
print ",";
print $result * $ALG;}
if ($line = "d")
{$result = 4;
print ",";
print $result * $ALG;}
if ($line = "e")
{$result = 5;
print ",";
print $result * $ALG;}
if ($line = "f")
{$result = 6;
print ",";
print $result * $ALG;}
if ($line = "g")
{$result = 7;
print ",";
print $result * $ALG;}
if ($line = "h")
{$result = 8;
print ",";
print $result * $ALG;}
if ($line = "i")
{$result = 9;
print ",";
print $result * $ALG;}
if ($line = "j")
{$result = 10;
print ",";
print $result * $ALG;}
if ($line = "k")
{$result = 11;
print ",";
print $result * $ALG;}
if ($line = "l")
{$result = 12;
print ",";
print $result * $ALG;}
if ($line = "m")
{$result = 13;
print ",";
print $result * $ALG;}
if ($line = "n")
{$result = 14;
print ",";
print $result * $ALG;}
if ($line = "o")
{$result = 15;
print ",";
print $result * $ALG;}
if ($line = "p")
{$result = 16;
print ",";
print $result * $ALG;}
if ($line = "q")
{$result = 17;
print ",";
print $result * $ALG;}
if ($line = "r")
{$result = 18;
print ",";
print $result * $ALG;}
if ($line = "s")
{$result = 19;
print ",";
print $result * $ALG;}
if ($line = "t")
{$result = 20;
print ",";
print $result * $ALG;}
if ($line = "u")
{$result = 21;
print ",";
print $result * $ALG;}
if ($line = "v")
{$result = 22;
print ",";
print $result * $ALG;}
if ($line = "w")
{$result = 23;
print ",";
print $result * $ALG;}
if ($line = "x")
{$result = 24;
print ",";
print $result * $ALG;}
if ($line = "y")
{$result = 25;
print ",";
print $result * $ALG;}
if ($line = "z")
{$result = 26;
print ",";
print $result * $ALG;}
}
close(FILE);



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

Date: Wed, 6 Oct 1999 10:54:35 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: regexp question - last occurrence of an expression before another
Message-Id: <x3yg0zo7d5g.fsf@tigre.matrox.com>


gerry@xmission.com (Gerry JJ Dyn-O-Myte Walker) writes:

> How do I extract the last occurrence of an expression occurring before
> another expression.  For example in the following string:
> 
> A <b> lot </b> of <b> html </b> text, some of it in <b> bold </b>.  I
> want to extract the last <b> bold </b> section of <b> text </b> prior
> to a list of items - <ul> <li> item one </ul> - maybe more <b> bold </b> 
> still.
> 
> I want to to extract only the last bold item (which is "text" in this
> example) which occurs before the list <ul>.*<\/ul>

This is probably not the best way to do it, but it works:

% perl -wl
$_ = 'A <b> lot </b> of <b> html </b> text, some of it in <b> bold </b>.  I
want to extract the last <b> bold </b> section of <b> text </b> prior
to a list of items - <ul> <li> item one </ul> - maybe more <b> bold </b> 
still.';

($x) = m|.*<b>(.*?)</b>.*?<ul>|s;
print $x;
__END__
 text 



HTH,
--Ala



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

Date: 6 Oct 1999 14:53:45 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Response appreciated but....
Message-Id: <7tfnpp$4gv$3@info2.uah.edu>

In article <V3vK3.787$ry3.8160@news.rdc1.ne.home.com>,
	"George Jempty" <jb4mt@verbatims.com> writes:

: > No one is so helpful as he who helps himself.
: 
: I suppose you crank out perfect code in a vacuum

Suppose again.  When I have questions, I turn to Perl's documentation
or I play with simple test cases.

: > By sharing with us your belief that the primary source of information
: > is previous posts, you betray your cluelessness.
: 
: That would actually be Abigail's cluelessness then

Maybe you should take a look at gnat's periodic post:

    <URL:http://www.deja.com/getdoc.xp?AN=532489803&fmt=text>

Labelling Abigail as clueless also betrays your own cluelessness. :-)

Greg
-- 
Facts do not cease to exist because they are ignored. 
    -- Aldous Huxley


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

Date: Wed, 06 Oct 1999 15:02:03 GMT
From: "George Jempty" <jb4mt@verbatims.com>
Subject: Re: Response appreciated but....
Message-Id: <LvJK3.842$ry3.8843@news.rdc1.ne.home.com>

> : > By sharing with us your belief that the primary source of information
> : > is previous posts, you betray your cluelessness.
> :
> : That would actually be Abigail's cluelessness then
>
> Maybe you should take a look at gnat's periodic post:
>
>     <URL:http://www.deja.com/getdoc.xp?AN=532489803&fmt=text>
>
> Labelling Abigail as clueless also betrays your own cluelessness. :-)
>
This all began because HOURS (using all caps to emphasize an occasional word
is NOT shouting regardless of what the ultra-legalists say) a couple of the
reasonable people in this group helped me out, Abigail complained that I
hadn't read through previous posts, so I was just applying someone else's
faulty logic to the situation to make a point, obviously missed by you




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

Date: Wed, 06 Oct 1999 15:08:48 GMT
From: "George Jempty" <jb4mt@verbatims.com>
Subject: Re: Response appreciated but....
Message-Id: <4CJK3.845$ry3.8832@news.rdc1.ne.home.com>

> This all began because HOURS (using all caps to emphasize an occasional
word
> is NOT shouting regardless of what the ultra-legalists say)
AFTER (oops, forgot a word, but hey it just gave me another opportunity to
SHOUT)
> a couple of the
> reasonable people in this group helped me out, Abigail complained that I
> hadn't read through previous posts, so I was just applying someone else's
> faulty logic to the situation to make a point, obviously missed by you





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

Date: Wed, 06 Oct 1999 11:28:58 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: Response appreciated but....
Message-Id: <37FB6ABA.7D619FD6@home.com>

Henry Penninkilampi wrote:
> > HTH, HAND,
> 
> Alright, I give up.  What do these acronyms stand for?  No idea bout the
> first.  Would the last be "Have A Nice Day"?

Hard Times, Huh?
Hey! That Hurts!
(too) Hot To Hold
Have To Hurry
Hear That Horn?
How's This, Henry?


Ken Bandes


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

Date: Wed, 06 Oct 1999 14:31:30 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: To Abigail re: reading current threads
Message-Id: <Pine.BSF.4.05.9910061036220.27930-100000@monet.bestweb.net>



On Tue, 5 Oct 1999, Elaine -HFB- Ashton wrote:

> The cabal approach is obviously _not_ teaching people anything other
> than that the Perl community is a bunch of pedantic assholes who have
> nothing better to do than beat idiots senseless as blood sport. 

"They mostly come out at night...mostly."
Newt, Aliens




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

Date: 06 Oct 1999 10:41:48 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <x77ll0sg9f.fsf@home.sysarch.com>

>>>>> "GJ" == George Jempty <jb4mt@verbatims.com> writes:

  GJ> Whatever.  I'll be back in the near future from a different IP
  GJ> address with a different email and will thus circumvent
  GJ> everybody's much-vaunted killfiles.  I will pay more attention to
  GJ> the group before I post and behave better when I come back.  That
  GJ> way the group can be the resource it's supposed to be.  Actually I
  GJ> got my answer quite quickly and was very happy.  I just couldn't
  GJ> resist tweaking Abigail and Uri and their insufferable egos.

you won't be able to hide your own smug punim, twit. even with dodging
around with aliases, you will be spotted and hunted down like the snake
you are. go away and use php or whatever. perl is too good for you.

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


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

Date: Wed, 06 Oct 1999 15:05:53 GMT
From: "George Jempty" <jb4mt@verbatims.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <lzJK3.844$ry3.8947@news.rdc1.ne.home.com>


> you won't be able to hide your own smug punim, twit. even with dodging
> around with aliases, you will be spotted and hunted down like the snake
> you are. go away and use php or whatever. perl is too good for you.

That's why with less than 100 hours using Perl I identified the problem with
closing a here document, and the solution;  that would make ME too good for
Perl




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

Date: 06 Oct 1999 11:12:22 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <x7vh8kr0a1.fsf@home.sysarch.com>

>>>>> "GJ" == George Jempty <jb4mt@verbatims.com> writes:

  >> you won't be able to hide your own smug punim, twit. even with dodging
  >> around with aliases, you will be spotted and hunted down like the snake
  >> you are. go away and use php or whatever. perl is too good for you.

  GJ> That's why with less than 100 hours using Perl I identified the
  GJ> problem with closing a here document, and the solution; that would
  GJ> make ME too good for Perl

oh, boy! we have a guru who knows here docs. if you knew anything like
shells then here docs would be a nobrainer. oh frabjous day! he solved a
problem on his own. so why post here?

at least this wasn't a jeopardy post. so he CAN learn his way around his
rat maze.

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


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

Date: Wed, 06 Oct 1999 11:24:17 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: To Abigail re: reading current threads
Message-Id: <37FB68D8.9DAE559B@chaos.wustl.edu>

Uri Guttman wrote:
> oh, boy! we have a guru who knows here docs. if you knew anything like
> shells then here docs would be a nobrainer. oh frabjous day! he solved a
> problem on his own. so why post here?

Take this to email oh pretty please? Please?

e.


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

Date: 6 Oct 1999 15:24:13 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <7tfpit$5dh$1@rguxd.viasystems.com>

George Jempty <jb4mt@verbatims.com> wrote:
:>I just couldn't resist tweaking Abigail and Uri and their insufferable egos.

You can get away with that if you show a little cleverness or use
humor.  But raw nastiness is just ugly.  Repent your ways and come
back reborn as a nicer person (or at least a more entertaining one:-)

I've been cut by Abigail's razor.  It stings a bit and isn't always
completely deserved.  One reason that she isn't ostracized by many
long timers here may be that her sharp edge is usually supported by
the weight of a strong logical argument.  And though her dialog isn't
usually funny, her Perl is hillarious.  uri on the other hand just
uses a club.  :-)

Ohhh.  That brings another picture to my mind of those poor innocent
newbies as fluffy white baby seals and the mean ol' denizens of
c.l.p.m clubbing them bloody as they wade through the carnage.  Oh,
the horror!  Have pity on the baby seals.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: 06 Oct 1999 10:55:39 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <F76848BCE12ECCA3.D2090DF186F7D276.C0B15CE1652539AB@lp.airnews.net>

mgjv@comdyn.com.au (Martien Verbruggen) writes:

> 
> I never used to have a killfile. A few months ago, I started one. I
> actually switched software to have better kill control. It's making my
> life a lot easier on this group. And not replying to certain articles
> now happens automatically.

Killfiles, like good fences, make good neighbors....

Kent
-- 
You think your Commodore 64 is really neato
What kinda chip you got in there, a Dorito?
Weird Al -- All about the Pentiums


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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