[13349] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 759 Volume: 9

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

Date: Fri, 10 Sep 1999 09:05:10 -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: 759

Today's topics:
    Re: Disk writing Problem (Jimtaylor5)
        Enable 8 Bit for Informix DBD?? <dieterly@olympus.fc.hp.com>
    Re: Extracting data from an HTML file (Abigail)
    Re: foreach oddity <aqumsieh@matrox.com>
    Re: Generating random numbers from an array <aqumsieh@matrox.com>
    Re: Help! HTTP500 error when running Perl script on Fro (Abigail)
    Re: How do I get Userid <ccarter@richmond.edu>
    Re: how to mkdir on NT with Perl (Kragen Sitaker)
    Re: How to perform nslookup functions in perl? (John Porter)
    Re: How to perform nslookup functions in perl? (Kragen Sitaker)
    Re: How to run a script from a script? <aqumsieh@matrox.com>
    Re: How to send control codes from Expect module <wpflum@my-deja.com>
    Re: How to send control codes from Expect module (Kragen Sitaker)
    Re: IPC daemonization (Bill Moseley)
        IRC:  internet anarchy done good. (Excession)
    Re: MSQL.pm Please Help <rhardicr@mail.ford.com>
    Re: MSQL.pm Please Help (Kragen Sitaker)
    Re: MSQL.pm Please Help <cnspots@mindspring.com>
    Re: Perl Compilation Roblems on RedHat 6.0 <dckinder@hgo.net>
    Re: Please help a newbe <cook@mediaone.net>
        Regex Question <smiles@wfubmc.edu>
    Re: Regex Question (Bill Moseley)
    Re: Sorting by mid-record without splitting? (Kragen Sitaker)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 10 Sep 1999 15:35:31 GMT
From: jimtaylor5@aol.com (Jimtaylor5)
Subject: Re: Disk writing Problem
Message-Id: <19990910113531.01517.00000401@ng-ca1.aol.com>

>>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.



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

Date: Fri, 10 Sep 1999 09:14:16 -0600
From: Duggan Dieterly <dieterly@olympus.fc.hp.com>
Subject: Enable 8 Bit for Informix DBD??
Message-Id: <37D92048.B6F4CDBD@olympus.fc.hp.com>

We can't load 8 bit European chars with Informix DBD.  We suspect it is
the
DBD that is rejecting the chars.  Does anyone know anything about this?
-- 
Duggan Dieterly                                    voice: (970) 898-7906
Software Design Engr                               fax:   (970) 898-3684
Hewlett-Packard Co.


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

Date: 10 Sep 1999 10:53:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Extracting data from an HTML file
Message-Id: <slrn7tiah4.pg8.abigail@alexandra.delanet.com>

David Taylor (David@YesYes.com) wrote on MMCCI September MCMXCIII in
<URL:news:7ravot$rf9$1@news.ksc.co.th>:
$$ Personal Perl Status: Fairly New
$$ To This NewsGroup: First Time
$$ Number of Perl Books to hand: 6 (including CD, all brilliant, but still
$$ absorbing...)
$$ 
$$ Question:
$$ I am trying to extract several sets of data from an html page
$$ that is located between <!--START--> and <!--END--> tags:
$$ 
$$ I am using:
$$ 
$$ open (MYFILE,"/info.html");

Always, always, always check the return value of open.

$$ $i = 1;
$$ print "Content-type: text/html\n\n";
$$ while (<MYFILE> ) {
$$   if ($i < 4) {
$$     print if (/<!--START-->/ ... /<!--END-->/ | $i++);
                                                 ^
                                                 |
                                        What is that supposed to do?

$$   }
$$ }
$$ 
$$ This works fine and prints out exactly what I want to
$$ extract from the html page. However, I want to put that
$$ same data into a variable, so changed the 'while' loop to:
$$ 
$$ while (<MYFILE> ) {
$$   if ($i < 4)
$$ 
$$     ($lines .= <MYFILE> ) if (/<!--START-->/ ... /<!--END-->/ | $i++);

That would append the *next* line to $lines.

$$   }
$$ }
$$ print $lines;  # To see what data is in $lines



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


  -----------== 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 10:12:06 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: foreach oddity
Message-Id: <x3yemg6hn49.fsf@tigre.matrox.com>


David Bradley <debr@hpesdebr.fc.hp.com> writes:

> Has anyone noticed that if you try
> to return the value of the foreach
> iterator in a function, you are screwed.

No. I do this all the time and it works fine.

> For example
> 
>    sub func {
>         foreach my $i (1..10) {
>             return $i if $i == 4; } }
>    print &func();
> 
> doesn't print anything out.  Doing the following

Hmm...

% perl -wl
   sub func {
        foreach my $i (1..10) {
            return $i if $i == 4; } }
   print &func();
__END__
4

% perl -v
This is perl, version 5.004_04 built for sun4-solaris

> seems to rectify the problem:
> 
>    sub func {
>         foreach my $i (1..10) {
>             return (my $retval = $i) if $i == 4; } }
>    print &func();
> 
> Questions:
> ----------
> 1) Is this a documented feature?

No. Because the behaviour you are witnessing seems to be special to
you only. What is your Perl version?

> 2) Can this be easily fixed?

Yes :)

> - Dave
> 
> P.S. For the cut and pasters out there:
> 
> perl5 -le 'sub junk { foreach my $i (1..10) { return $i if $i == 4; } }
> print &junk();'

% perl -le 'sub junk { foreach my $i (1..10) \
  { return $i if $i == 4; } } print &junk();'
4

> perl5 -le 'sub junk { foreach my $i (1..10) { return (my $retval = $i)
> if $i == 4; } } print &junk();'

% perl -le 'sub junk { foreach my $i ( 1..10 ) \
  { return ( my $retval = $i ) if $i == 4 ; } } \
  print & junk ( ) ; '
4


--Ala



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

Date: Fri, 10 Sep 1999 10:13:56 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Generating random numbers from an array
Message-Id: <x3yd7vqhn18.fsf@tigre.matrox.com>


tmcandr@sears.com writes:

> Would anyone happen to know how to generate a random number from
> a set of array elements?

Yes. We all know it since we all read the FAQs. From perlfaq4:

	How do I select a random element from an array?

Read it and be enlightened.

--Ala



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

Date: 10 Sep 1999 10:54:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help! HTTP500 error when running Perl script on Frontpage
Message-Id: <slrn7tiair.pg8.abigail@alexandra.delanet.com>

gilbert (gilbert@yahoo.com) wrote on MMCCI September MCMXCIII in
<URL:news:7ra5sl$pg1@imsp212.netvigator.com>:
## I found the error log. It says "httpd: could not create new process: 193"


That's not a Perl problem.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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 15:34:56 GMT
From: Coates Carter <ccarter@richmond.edu>
To: Omar Soto <rp7667@email.sps.mot.com>
Subject: Re: How do I get Userid
Message-Id: <37D924F4.73C7B025@richmond.edu>

$< and $> return the numeric uid and euid.

If you want the username, you must use getpwuid...

     $users_uid = $<;
     ($users_name)= getpwuid($users_uid);


getpwuid returns an array, the first field of which is the username.

Coates Carter
University of Richmond
carter@richmond.edu

 .............................
>I have been trying to get the userid and the effective userid thru a
>print of the variables:
>$< and $>.  I also tried using $EFFECTIVE_USER_ID and $REAL_USER_ID and

>it does not work.
>It returns an integer.  How do I get this value and then how do I
change
>it?  `setuid $value` is not working.



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

Date: Fri, 10 Sep 1999 15:16:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: how to mkdir on NT with Perl
Message-Id: <ih9C3.1820$N77.129343@typ11.nn.bcandid.com>

In article <37d8ac10.92012574@news.dowco.com>, Randy <randys@dowco.com> wrote:
>I would like to know if there is a way i could create or edit
>directories in NT with Perl?

perldoc -f mkdir?
-- 
<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 15:27:34 GMT
From: jdporter@min.net (John Porter)
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <slrn7ti8r5.8mb.jdporter@min.net>

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?

(Looks like someone needs to read the perl docs again.)

There is a built-in function for doing what you want, called
gethostbyname.

for (@ARGV){
  my($name,$aliases,$addrtype,$length,@addrs) = gethostbyname $_;
  my @ip_addresses = map { join '.', unpack 'C4', $_; } @addrs;

  local $" = ', ';
  print "$name: @ip_addresses \n";
}


-- 
John Porter



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

Date: Fri, 10 Sep 1999 15:51:35 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <bO9C3.1966$N77.133254@typ11.nn.bcandid.com>

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: Fri, 10 Sep 1999 10:07:03 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: How to run a script from a script?
Message-Id: <x3yg10mhncp.fsf@tigre.matrox.com>


abigail@delanet.com (Abigail) writes:

> Joe Frey (frey@saturn.med.nyu.edu) wrote on MMCC September MCMXCIII in
> <URL:news:37D82217.DAE99E2F@saturn.med.nyu.edu>:
> :: I'm using a file grepped fron ps to determine if I need to restart
> :: another script. All works well except #exec "home/joe/31donegone.pl";#
> :: How do I call a script from a script?
> 
> 
> exec, open, @ARGV/<>, system and qx.

For a second I thougth that the above was one of Abigail's infamous
one-liners, and I was staring at my screen as if I have just seen a
ghost. But then I realized the truth ...

/big BIG sigh

*phew*

--Ala



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

Date: Fri, 10 Sep 1999 14:56:21 GMT
From: Bill <wpflum@my-deja.com>
Subject: Re: How to send control codes from Expect module
Message-Id: <7rb66d$e0g$1@nnrp1.deja.com>

That did it, along with getting the correct wait for responce, I had an
extra space on the end so it never thought it got to the prompt!

Now the only thing left is to figure out how to dump the screen to a
variable so I can search for the message prompt, the prompt is 'MSG' at
the bottom of the screen, then I can send an email to the PC user.

Thanks for your help.


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


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

Date: Fri, 10 Sep 1999 15:57:04 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to send control codes from Expect module
Message-Id: <kT9C3.1970$N77.133456@typ11.nn.bcandid.com>

In article <7rb66d$e0g$1@nnrp1.deja.com>, Bill  <wpflum@my-deja.com> wrote:
>That did it, along with getting the correct wait for responce, I had an
>extra space on the end so it never thought it got to the prompt!

Ah!  Good to hear it.

>Now the only thing left is to figure out how to dump the screen to a
>variable so I can search for the message prompt, the prompt is 'MSG' at
>the bottom of the screen, then I can send an email to the PC user.

Dumping the screen, in general, requires that you have a terminal emulator.

If it's sufficient for your purposes, you can just take the last 24 or
25 lines received and call that the 'screen'.  But if you have a stream
of cursor-positioning, character-insertion, line-deletion, etc., codes
that update a screen, then to figure out what the screen looks like at
a particular point in this stream, you need a piece of hardware or
software that interprets all of those escape sequences.  Such a piece
of software is called a 'terminal emulator'.

Some terminals (and terminal emulators) have escape sequences you can
send to them to get a screen dump.  If you can't find one that does,
you'll need to incorporate a terminal emulator into your program so you
can read what it thinks the screen looks like at any given time.

Terminal emulators for Unix include iScreen (aka screen), rxvt, xterm,
Eterm, and the Linux kernel's console code.

Good luck!

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 08:42:00 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: IPC daemonization
Message-Id: <MPG.1242c6a4e0767579989732@nntp1.ba.best.com>

Tom Phoenix (rootbeer@redcat.com) helps by saying...

> On Thu, 9 Sep 1999, Bill Moseley wrote:
> > I want to fork a child and then let the parent exit with the child
> > running.  (The parent happens to be a CGI script.)
> 
> Make sure that the child closes the filehandles which connect it to the
> server, so that the server will know that the child is not going to
> contribute to the output.

I understood that from perlipc example, but I'm not clear on what 
happens with open files.  

STDERR is normally captured by the web server.  I have repoened it in 
the parent to a log file.

The child will inherit STDERR that's pointed to the log file, and I want 
this so the child can write to the same log file.  Is STDERR independent 
of the parent at this point, or will keeping this file open in the child 
prevent the parent from exiting?  If so, would I need to reopen STDERR 
to the log file again in the child?


> Generally, though, once your child process has closed STDIN and STDOUT and
> maybe used setpgrp, it should be fine.

Ya, that was my question also.  The perlipc example uses setsid and you 
mention using setpgrp.  Neither I'm clear on or when/why you would use 
them.

Thanks,


BTW - this is with Apache & Solaris.


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Fri, 10 Sep 1999 15:47:31 GMT
From: daccles@ozemail.com.au (Excession)
Subject: IRC:  internet anarchy done good.
Message-Id: <37da22c5.9132571@news.ozemail.com.au>

[followups set to alt.sysadmin.recovery]

>Excession wrote to Alan Rosenthal:

>> Who tweaked your miniscule dick anyway, fuckface.

and in response, 'Simple' Simon Cozens <pemb0468@sable.ox.ac.uk> wrote:

>Speaking of intelligent comment, this one's one of yours,
>isn't it?

>http://www.pcug.org.au/~dac/wheeler.txt

Sure.  

I guess you're a #perl addict too, eh?

[re: Excession in #perl]
[00:22] <Simon> Oh, this is the luser from the monastery, isn't it?
[00:23] <mendel> yuh huh
[00:23] <mendel> the guy with "his" (read gbacon's) stats program
[00:23] <Simon> furrfu
[00:23] <Simon> Dammit, and I was having a good day as well.

You whine so ineloquently.

>Remember, it's only IRC.  It doens't really matter.

Does IRC matter to you?  Or is it just a waste of time and effort?  

Personally, IRC is an escape from the trap of the free to air glass-teat.  Not
only can I keep myself awake, pondering inponderables, I can also drive entire
legions of wannabes into fits of hysteria just by -mentioning- my chosen
nickname in an IRC channel.  The big stick of kick-ban comes plonking down, and
the crowd roars with laughter, self-satisfied smugness bouncing around, and
karma distribution aplenty.  "If excession didn't exist, we'd had to invent
him!"

>> Please, plonk me in your killfile and be done with it. 

>Done that, but you still keep cropping up where you're not
>wanted. *sigh*

Yes, yes, you've made your moans audible before.  Aren't you satisfied with
your existing all-encompassing diet of predigested pap?  Do you HAVE to beg for
more? 

I find it telling that my entire home ISP (*!@*.pcug.org.au) is still banned on
#perl, 13 months after my original 'sin' of 'ban evading',  preventing some
2,500 potential "lusers" from facing the pleasures of being patronised by a
bunch of geeks with a well thumbed book of clues.  If that kind of idle fascism
doesn't twinge your sense of natural justice, then I guess no amount of
reasonable debate will sway your opinion.  

One can never successfully argue with the true believers -- because faith isn't
based upon any degree of rational thought.  #perl is a testament to that.

Dac


-- 
David Andrew Clayton     # Please remove NOSPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   # ICQ 6862357 : ObWierd 1999 / 3 = 666.33333333333


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

Date: Fri, 10 Sep 1999 16:16:07 +0100
From: Richard H <rhardicr@mail.ford.com>
Subject: Re: MSQL.pm Please Help
Message-Id: <37D920B7.53F85B4F@mail.ford.com>

CNspots 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?
> 

If it doesn't work, when does it stop working??, 
Have you run it from the command line??
If it falls over there should be some sort of error message,
helped by -w and use strict, which are always a good place to start
debugging from.
If that doesnt help print out the SQL your code generates and run it
against the database direct.
Litter your code with print statements to see how far it is going before
it breaks,
Then if you get an error message, it might be clearer to you and us what
the problem is??

Richard H


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

Date: Fri, 10 Sep 1999 15:42:58 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: MSQL.pm Please Help
Message-Id: <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 11:51:46 -0400
From: "CNspots" <cnspots@mindspring.com>
Subject: Re: MSQL.pm Please Help
Message-Id: <7rba5j$i3h$1@nntp9.atl.mindspring.net>

There is  a comment where it breaks but it is pretty much where I try to
write to the database.. Unfortunately I only have ftp access so I cant do a
command line.  I did originally littler it with print statements though..
thats How I knew where it broke..

BTW Thanks for the help...

Richard H <rhardicr@mail.ford.com> wrote in message
news:37D920B7.53F85B4F@mail.ford.com...
> CNspots 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?
> >
>
> If it doesn't work, when does it stop working??,
> Have you run it from the command line??
> If it falls over there should be some sort of error message,
> helped by -w and use strict, which are always a good place to start
> debugging from.
> If that doesnt help print out the SQL your code generates and run it
> against the database direct.
> Litter your code with print statements to see how far it is going before
> it breaks,
> Then if you get an error message, it might be clearer to you and us what
> the problem is??
>
> Richard H




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

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

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


--
Regards,

Duncan C. Kinder
dckinder@mountain.net



Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.9909100637300.16999-100000@user2.teleport.com...
> On Thu, 9 Sep 1999 dckinder@mountain.net wrote:
>
> > I consistently fail one "make test" when compiling perl5.005_03 on
> > RedHat 6.0:  "lib/anydbm FAILED at test 12"
>
> If that's your only trouble, and if you don't need the DBM routines, you
> could probably safely ignore that failure. But it's better to fix it, if
> you can.
>
> > This happens when I use all the defaults in the perl Configure.  I
> > have also attempted specifically to state that gcc rather than cc is
> > the compiler, but this makes no difference.
>
> I suspect that your cc is gcc. But it doesn't sound like a compiler issue
> in any case. I'd guess that there's a problem with the library routines
> you're using for the DBM, or the way Perl is interfacing to them. Are you
> using gdbm or ndbm? Maybe you should change that: Just because Configure
> thinks it's a good default doesn't mean it's correct. You way find out
> something with a command like 'ls -l /usr/include/*dbm.h'.
>
> > What is worse the CD-1.21 GD:pm will not compile.
>
> I don't know what that is. A module? But I'm suspecting that, once you get
> your new perl binary and related files properly installed (even if the DBM
> routines are busted) you'll have much better luck with installing new
> modules. If you try to install a module before you've got a working perl,
> you won't get a working module.
>
> 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:15:29 -0400
From: edgar <cook@mediaone.net>
Subject: Re: Please help a newbe
Message-Id: <37D92091.F927C98F@mediaone.net>

<snip>

> Will I be able to have my script read the specific numbers from the
> file and then provide a total to the user?
> Thanks
> JP

A couple of helpful hints are to use the perl documentation, and there are
many tutorials.
One that I used and like is
http://www.netcat.co.uk/rob/perl/win32perltut.html
for perl documentation take a  look at
d:>perldoc perlre
d:>perldoc perl
d:>perldoc -f open

and you havn't shown any code that you tried. Did you try the code from the
cookbook.
So at the next new post show code used and where you are haveing problems
and I'm sure  you will get help. Also try to be more descriptive on the
subject line.

hth
-cookie




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

Date: Fri, 10 Sep 1999 11:15:51 -0400
From: Steve Miles <smiles@wfubmc.edu>
Subject: Regex Question
Message-Id: <37D920A7.637E6508@wfubmc.edu>

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
=============================================




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

Date: Fri, 10 Sep 1999 08:41:12 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Regex Question
Message-Id: <MPG.1242c6776fb14a66989731@nntp1.ba.best.com>

Steve Miles (smiles@wfubmc.edu) seems to say...
> My question is that I want to use a regular expression to remove
> anything in the url past, say, 100 characters.

Are you sure you want to use a regular expression to simply extract a 
"sub string".

what's wrong with, say, extracting a substr?

> 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.

Yuck.  Why not place the data in a table with nowrap enabled?

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Fri, 10 Sep 1999 15:15:37 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Sorting by mid-record without splitting?
Message-Id: <tg9C3.1818$N77.126827@typ11.nn.bcandid.com>

In article <MPG.1242495e97772a77989f41@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <Qf%B3.1270$N77.77252@typ11.nn.bcandid.com> on Fri, 10 Sep 
>1999 03:52:16 GMT, Kragen Sitaker <kragen@dnaco.net> says...
>...
>> my @lines = map {chomp; [split /\|/]} <>;
>> print map { join ('~', @$_), "\n" } sort { $a->[2] cmp $b->[2] } @lines;
>
>How odd to chomp off the newlines before sorting the records, then glue 
>them back on.

The program groks the logical structure of the data: a list of lists of
strings.  The newlines are just separators; for religious purity, they
should not be put into @lines anywhere.  In this case, of course, it
doesn't matter at all, because what we do after sorting them is to
write them back out with newlines on the ends.

Maybe I should have changed them to \r\n as I changed | to ~ :)

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: 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 759
*************************************


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