[11027] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4629 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 12 11:38:05 1999

Date: Tue, 12 Jan 99 08:00:20 -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, 12 Jan 1999     Volume: 8 Number: 4629

Today's topics:
        @INC - Path on Win32 <joerg.dolle@de.origin-it.com>
        A really easy string question info@gadnet.com
    Re: A really easy string question (Clay Irving)
    Re: Active State package questions <ludlow@us.ibm.com>
    Re: grep with boundaries and regex (Tad McClellan)
    Re: grep with boundaries and regex (Jason Q.)
    Re: grep with boundaries and regex <jdf@pobox.com>
    Re: grep with boundaries and regex (Abigail)
    Re: grep with boundaries and regex (Abigail)
    Re: If Larry Wall's listening out there.... <samuel.patton@wichita.boeing.com>
    Re: looking for perl programmer (Bbirthisel)
    Re: Making perl do tasks at specific times.. (FirstAGYG)
    Re: Need comforting before Solaris Perl install, ruxfounder@my-dejanews.com
    Re: Newbie desperation <dropzone@mail.utexas.edu>
        Perl and LDAP <brians@meetingbywire.com>
    Re: Perl Criticism (I R A Aggie)
    Re: Perl Criticism (I R A Aggie)
    Re: Perl Criticism (I R A Aggie)
    Re: PGP system call <dropzone@mail.utexas.edu>
    Re: Problem with PerlScript on PWS <cdkaiser@delete.these.four.words.concentric.net>
        regulart expression <arpin@adan.kingston.net>
        Text manipulation icebeerberg@my-dejanews.com
    Re: URGENT: Array of arrays... <jdf@pobox.com>
    Re: URGENT: Array of arrays... <Brett.Diamond@lmco.com>
        usertools-0.1 <konrad.holzbauer@spa.schulen.regensburg.de>
    Re: Using a Form in HTML and a Perl Script. (Tad McClellan)
    Re: Vexing Regex problem? dave@mag-sol.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 12 Jan 1999 15:29:53 +0100
From: "Jvrg Dolle" <joerg.dolle@de.origin-it.com>
Subject: @INC - Path on Win32
Message-Id: <0E16861EE7BCD111BE9400805FE6841F0629A288@c1s5x001.cor.srvfarm.origin-it.com>

Who can help me with this entry?

C:\>perl -e "print (@INC)"
C:\PERL\5.005\lib/MSWin32-x86-objectC:\PERL\5.005\libC:\PERL\site\5.005\lib/
MSWi
n32-x86-objectC:\PERL\site\5.005\libC:\PERL\site\lib.

How could I change "/" to "\" in the @INC variable?

Thanks Joerg




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

Date: Tue, 12 Jan 1999 19:44:55 GMT
From: info@gadnet.com
Subject: A really easy string question
Message-Id: <369ba4f0.9065131@news.newsguy.com>

I'm new to this perl lark and struggling to do the following:

I have a variable ($variable) which contains:

$pathname = "/path-of-indeterminate-length/myfile.txt";

I want to end up with a variable that contains:

myfile.txt

I can do it as follows:

$variable = substr($variable,12);
chop($variable);
chop($variable);

But there has to be a neater way.

Any ideas?




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

Date: 12 Jan 1999 15:52:57 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: A really easy string question
Message-Id: <77fr4p$5pq$1@news.panix.com>

In <369ba4f0.9065131@news.newsguy.com> info@gadnet.com writes:

>I'm new to this perl lark and struggling to do the following:

>I have a variable ($variable) which contains:

>$pathname = "/path-of-indeterminate-length/myfile.txt";

>I want to end up with a variable that contains:

>myfile.txt

>I can do it as follows:

>$variable = substr($variable,12);
>chop($variable);
>chop($variable);

>But there has to be a neater way.

Using split:
    
    #!/usr/local/bin/perl -w
    
    $pathname = "/path-of-indeterminate-length/myfile.txt";
    
    @foo = split /\//, $pathname;   # split on `/'
    
    print "$foo[$#foo]\n";          # print the last element in the array
    
Using File::Basename (included in the Perl distribution):
    
    #!/usr/local/bin/perl -w
    
    use File::Basename;
    
    $pathname = "/path-of-indeterminate-length/myfile.txt";
    
    $name = (fileparse($pathname))[0];
    
    print "$name\n";    

-- 
Clay Irving
clay@panix.com


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

Date: Tue, 12 Jan 1999 09:44:35 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Active State package questions
Message-Id: <369B6DE3.4EE796AE@us.ibm.com>

Charles Wilt wrote:
> 
> In article <369A6F8E.523E6FE7@us.ibm.com>, ludlow@us.ibm.com says...
> > Brian Lavender wrote:
> >
> > > Where do I find what modules have been compiled into packages for the PPM
> > > (Perl Package Manager)? I can't find a list on the http://www.ActiveState.com
> >
> > http://www.activestate.com/packages/zips/
 
> THANK YOU, THANK YOU, THANK YOU.  I have been wondering how I could
> install ActiveState Packages on two of my PC's that don't have Internet
> access.  How did you find this?  I could find no mention of it in the
> manuals or on the web site.

It's not really obvious, but it's in the ActivePerl documentation:
http://www.activestate.com/activeperl/docs/

Under "PPM and Firewalls" there's a link to the "ActiveState Repository
Zipfile archive."  The first time I followed that link, it was like I'd
found the promised land.

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Tue, 12 Jan 1999 06:47:05 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: grep with boundaries and regex
Message-Id: <98gf77.oee.ln@magna.metronet.com>

Jason Q. (pigs_can_fly@mindless.com) wrote:

: From @temp, I need to grep $word, which might be "=F".
: It works fine with this line,
: @temp = grep(/$word/,@temp);


: However, when I want to restrict to only whole word greps using this:
: @temp = grep(/\b$word\b/,@temp);
: it fails to identify "=F"

: I suppose it's due to the \b 


   It is.


: and think I need to specify $word as a
: regex because of the "=".


   If you want to test for equality, rather than test for
   matching a pattern, then a regex is not what you want.

   In that case you want the equality operator  ;-)


: How do I achieve this?


   @temp = grep( $_ eq $word, @temp);


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 12 Jan 1999 15:00:43 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: grep with boundaries and regex
Message-Id: <369e5d44.5853113@news.cyberway.com.sg>

>   @temp = grep( $_ eq $word, @temp);

Does this allow me to grep whole words only AND recognise "=" at the
same time? I tried it out but it failed to grep anything at all.

The line itself is in a foreach loop, and I believe $_ is already
being used.

I just started learning Perl and have reservations posting my
primitive perl lines in this newsgroup (which can be quite
unforgiving). But that's the only way I'd learn, so here goes....

What I'm trying to do is
1. grep multiple keywords from several databases.
2. grep only whole words, which might include "=" (equal signs)

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

foreach (@database)
	{
	open(DATABASE, $_);
	@temp = <DATABASE>;
	close(DATABASE);
		foreach $word (@keywords)
			{
			@temp = grep(/$word/,@temp);
			}
	push @confirm, @temp;
	}

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

Tell me where I'm going wrong, or better still, tell me how I can
better it.

Thanks,



Jason Q.


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

Date: 12 Jan 1999 16:37:40 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: grep with boundaries and regex
Message-Id: <m3g19g5wor.fsf@joshua.panix.com>

pigs_can_fly@mindless.com (Jason Q.) writes:

> >   @temp = grep( $_ eq $word, @temp);
> 
> Does this allow me to grep whole words only AND recognise "=" at the
> same time? I tried it out but it failed to grep anything at all.

Your question doesn't make sense.  The answer is that if a given
element of @temp matches whatever is in $word *exactly*, then it will
pass grep.  That means, for example, that if $word contains "foo=bar"
then only those elements of @temp which contain "foo=bar" will be left 
in @temp.

> The line itself is in a foreach loop, and I believe $_ is already
> being used.

That's okay, because $_ is implicitly localized in grep.  It says so
in the documentation:

   Evaluates the BLOCK or EXPR for each element of LIST (locally setting
   C<$_> to each element) and returns the list value consisting of those
   elements for which the expression evaluated to TRUE.

To read the documentation for a perl builtin (such as grep, or print,
or join, etc.), you can do this:

   $ perldoc -f grep

> I just started learning Perl and have reservations posting my
> primitive perl lines in this newsgroup (which can be quite
> unforgiving).

Think of it as tough love.

> 1. grep multiple keywords from several databases.

I don't think you're ready for it yet, but the FAQ addresses problems
like this.  perlfaq6, "How do I efficiently match many regular
expressions at once?".  Also, your use of the word "grep" is
confusing.

> 2. grep only whole words, which might include "=" (equal signs)

That really depends on your definition of a "word".  The FAQ addresses 
this problem in several places.  You'll find some of them with the
command 
 
    $ perldoc -q word

> foreach (@database)

Okay, so @database is a list of files, right?

> 	{
> 	open(DATABASE, $_);

D'oh.  You didn't check to see whether you actually managed to open
the file.  You must ALWAYS do so.

    open(DATABASE, $_) || die "Can't open $_ for read: $!\n";

Go ahead and

    $ perldoc perlvar

and read about the $! variable.

> 	@temp = <DATABASE>;

Okay, so you've taken the contents of the file $_ and thrown them into 
@temp.  But there's a very crucial step you're forgetting.

> 	close(DATABASE);

Check the success of *all* system calls.

> 		foreach $word (@keywords)
> 			{
> 			@temp = grep(/$word/,@temp);

Okay, three problems here.  

The big problem: as soon as you check the first $word in @keywords,
@temp will either be empty (if it didn't contain $word) or or only
contain instances of $word.  I doubt very much that's what you want.

The as-big problem: you're asking if any substring of a given element
of @temp matches $word.  You need to use the eq operator, as was
suggested to you in the sample code you quote, above.

The real killer: each element of @temp still has (probably) a newline
at the end, since each line of your DATABASE file had (probably) a
newline at the end.  You need to chomp them off.

   chomp(@temp = <DATABASE>);

> 	push @confirm, @temp;

Instead of that line where you destroy @temp, above, you can just

   push @confirm, grep($_ eq $word, @temp);

> Tell me where I'm going wrong, or better still, tell me how I can
> better it.

You asked for it!

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 12 Jan 1999 15:40:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: grep with boundaries and regex
Message-Id: <77fqds$36a$1@client3.news.psi.net>

Jason Q. (pigs_can_fly@mindless.com) wrote on MCMLX September MCMXCIII in
<URL:news:369ceb52.24440256@news.cyberway.com.sg>:
## Hi,
## 
## From @temp, I need to grep $word, which might be "=F".
## 
## It works fine with this line,
## 
## @temp = grep(/$word/,@temp);
## 
## However, when I want to restrict to only whole word greps using this:
## 
## @temp = grep(/\b$word\b/,@temp);
## 
## it fails to identify "=F"
## 
## I suppose it's due to the \b and think I need to specify $word as a
## regex because of the "=".


Get the idea out of your head that grep takes only a regex as first
argument. It doesn't. Any expression, or block for that matter, works.

        grep {$_ eq '=F'} @temp;

That should be faster as well.



Abigail


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

Date: 12 Jan 1999 15:53:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: grep with boundaries and regex
Message-Id: <77fr4t$3h8$1@client3.news.psi.net>

Jason Q. (pigs_can_fly@mindless.com) wrote on MCMLX September MCMXCIII in
<URL:news:369e5d44.5853113@news.cyberway.com.sg>:
// 
// What I'm trying to do is
// 1. grep multiple keywords from several databases.
// 2. grep only whole words, which might include "=" (equal signs)
// 
// -----------------------------------------------------------------------
// 
// foreach (@database)
// 	{
// 	open(DATABASE, $_);
// 	@temp = <DATABASE>;
// 	close(DATABASE);
// 		foreach $word (@keywords)
// 			{
// 			@temp = grep(/$word/,@temp);
// 			}
// 	push @confirm, @temp;
// 	}
// 
// -----------------------------------------------------------------------
// 
// Tell me where I'm going wrong, or better still, tell me how I can
// better it.


I assume that 1) and 2) have to occur simultaniously, and that you
don't want to match "plate" on the keywords "at". I'll also assume
that each database can contain multiple words on a line; where a
"word" is any sequence of non-spaces.

    my %keywords = map {$_ => 1} @keywords;  # Use a hash.
    foreach my $database (@databases) {
        local *DATABASE;
        open DATABASE, $database or die "Opening database $database failed: $!";
        my $line;
      LINE:
        while (defined ($line = <DATABASE>)) {
            foreach my $word (split /\s+/, $line) {
               if ($keywords {$word}) {
                   push @confirm, $line;
                   next LINE;
               }
           }
       }
       close DATABASE;
   }
            


Abigail


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

Date: Tue, 12 Jan 1999 15:02:30 GMT
From: "Sam Patton" <samuel.patton@wichita.boeing.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <F5GCG1.2A4@news.boeing.com>


Ronald J Kimball wrote in message
<1dladrd.n0uc301e8lt86N@bay1-324.quincy.ziplink.net>...
>Andrew Mayo <andrew@geac.co.nz> wrote:
>
>> Those of us working in a Windows environment generally will use notepad
as a
>> text editor. Simple-mindedly, notepad does *not* display line numbers.
(it
>> also doesn't do brace matching, but this I can live with)



Heres a strange suggestion for you.

I use the editor that came with my C++ 5.0.  I can have multiple windows
with it and it give me all the line numbers I
need.






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

Date: 12 Jan 1999 15:31:12 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: looking for perl programmer
Message-Id: <19990112103112.18420.00001033@ng107.aol.com>

Hi Ethan:

>>"Think Smart, Think BIG! - Big Software) Corp."
>
>Actually, I kinda like this attempt to 'copyright' a business name.

He located the 'copyright' as if it was a trademark. But, based on
common usage, the 'copyright' applies to "Corp."

Must be time to send in the Marines...;-)

(a short form of United States Marine Corps)

-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: 12 Jan 1999 15:32:01 GMT
From: firstagyg@aol.com (FirstAGYG)
Subject: Re: Making perl do tasks at specific times..
Message-Id: <19990112103201.18732.00004462@ng-ft1.aol.com>

Thanks for all the suggestions. the server's on linux.

someone asked for a specific task or reason...mostly for sending mail on a day
to day basis from a files already specified to go out that day.




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

Date: Tue, 12 Jan 1999 15:28:27 GMT
From: ruxfounder@my-dejanews.com
Subject: Re: Need comforting before Solaris Perl install,
Message-Id: <77fpmo$vuv$1@nnrp1.dejanews.com>

Hi,

Yes, pkgadd will be as simple as you have red.
And very probably all will be fine.

I know that gcc precompiled distributions are sometimes sucks,
nether noted about Perl ones :-)

But, if you have compiler installed, especially gcc
it is better to compile Perl, IMHO.
On Solaris it is not so hard as read 25 pages :-)
Suppose, you have actually red it.
You may to give a hint that it is Solaris, yes?
and most questions during install will have a correct answer
automagically, just click <enter>

-Dima.

In article <369A0CE5.E6F28276@bt.com>,
  hamlinm@boat.bt.com, mark@dimitrinet.demon.co.uk wrote:
> Dear All,
>
> I have little unix admin experience and none with Solaris.  I think I've
covered
> all the bases but would like some assurance that I'm going about this the
right
> way.
>
> My build of perl on the local web server is completely shot, so i'm going to
> reinstall it, here's why:  I tried to find Perls source/lib directory - the
> locations
> confirmed with a print -e 'print' "@INC"' did not even exist.  When I
	run
>
> perldoc perldoc
>
> I get the 'can't locate Getopt/Std.pm in @INC at /usr/bin/perldoc line 27
> .......  Its possible the Perl files on the server in the /bin directory were
> simply copied there rather than installed so I only have a bare bones build,
> just the 4 files in /bin --
>
> perl, perldoc, perlbug, perl5.004
>
> Definately shot?? Alright then, now about the re-install:
>
> I'm installing on a Sun Sparc box with Solaris 2.6.  At Sun's
> http://www.sunfreeware.com/ they have the following perl build which is
> specifically for a Sparc running 2.6:
>
> "perl-5.005_02-sol26-sparc-local.gz
> the Perl system installs in /usr/local. "
>
> The 4 page generic package installation instructions from Sun are very short
&
> clear, easier than the 25 pages of standard installtion instructions from the
> CPAN.  Does pkgadd negate all the make & configure steps one needs to carry
out
> normally.  Is it really unzip/pkgadd/& play .????  I've already done the
> prelimenaries for pkgadd, theres definately enough space in the critical
> locations.
>
> This all seems very simple, have I missed any steps/procedures.  Thanks for
your
> help
>
> Thanks for your help and hopefully a bit of assurance,
> Cheers,
> Mark Hamlin 01473 646703
> Systems Engineer
> BT - ACR MCA SIT (don't ask!)
>
> --
>
>         ___....-----'---'-----....___
>   =========================================
>          ___'---..._______...---'___
>         (___)      _|_|_|_      (___)
>           \\____.-'_.---._'-.____//
>             ~~~~'.__'---'__.'~~~~
>                    ~~~~~~~
> 	'More speed'
> 		  Sisco
>
> Work: mailto:mark.c.hamlin@bt.com
> Personal: mailto:mark@dimitrinet.demon.co.uk
>
> Please use you auto reply where possible to distribute to both mailboxes.
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 12 Jan 1999 09:16:39 -0600
From: Forrest Reynolds <dropzone@mail.utexas.edu>
Subject: Re: Newbie desperation
Message-Id: <369B6759.A04514D6@mail.utexas.edu>

Thomas Klinger wrote:
> 
> I'm really desperated!
> I already read "Learning Perl" twice but I can't get into this stuff.
   Definitely don't give up Thomas! If you play with input programs like the
one at the beginning of "Learning Perl",
you can pick up the basics. If you have something you can't figure out after
trying for awhile, post it--- someone else might have the same question. Make
sure you put the subject of your question on the subject line--- you'll get
more responses!!
        Hang in there, FOrrest


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

Date: Tue, 12 Jan 1999 14:15:12 GMT
From: "Brian Sullivan" <brians@meetingbywire.com>
Subject: Perl and LDAP
Message-Id: <QNIm2.6082$Uv.974@news.rdc1.va.home.com>

I have been confused by all the LDAP modules for Perl that seem to be
around.

What I would like is a Perl only module/code that  would allow me to do
some simple monitoring of an LDAP server ( is it up, how many current
entries). Does such a beast exist ? Most of what I have seen seems to
require addition of a .dll in windows. I would like to avoid that and
keep as portable as possible. Am I dreaming here?

Brian Sullivan (mailto:brians@meetingbywire.com)
Meeting by Wire (http://www.meetingbywire.com)

--
Brian Sullivan (mailto:brians@meetingbywire.com)
Meeting by Wire (http://www.meetingbywire.com)




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

Date: Tue, 12 Jan 1999 09:48:57 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-1201990948570001@aggie.coaps.fsu.edu>

In article <369A8396.A75FF78@mail.utexas.edu>, Forrest Reynolds
<dropzone@mail.utexas.edu> wrote:

[quoting someone else]
+ > Comprehension is not my major complaint. Abusability is.
+ > You should have known that if you have been following.
+ > Programmers are not altruistic--they don't give flying
+ > fudge about who has to maintain and fiquire out their
+ > software. Therefore, the language has to protect the
+ > future because programmers wont.

+ A language protecting the future? That sounds pretty interesting--- good short
+ story material. Perhaps your energy is misplaced.

No wonder he has a problem with perl.

Many computer scientists have fallen into the trap of trying to define
languages like George Orwell's Newspeak, in which it is impossible to
think bad thoughts. What they end up doing is killing the creativity
of programming.
 -- Larry Wall

I dunno about the rest of y'all, but usually the person who has to figure
out and maintain my code is...ME. Ergo, it's in my own best interests to
be disciplined and use proper programming practices.

Even so, there are times when I mutter "what was I thinking? what was I
DRINKING??"... :)

James


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

Date: Tue, 12 Jan 1999 10:40:16 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-1201991040160001@aggie.coaps.fsu.edu>

In article <77e7vo$mtk$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:

+ That is utterly ridiculous! Why is a working implimentation so
+ important? 

Ummm...'cause I can't try out your strategies and see if they'll work for
me?

+ It is like saying that only great performers can compose
+ music. Even cartooning is split between the concept
+ people and the actual animators (usually done in Korea).

Ah, so you're more of a "idea rat", eh?

James - apologies to Scott Adams...


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

Date: Tue, 12 Jan 1999 10:45:40 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-1201991045410001@aggie.coaps.fsu.edu>

In article <slrn79lphr.mtj.dformosa@godzilla.zeta.org.au>,
dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:

+ In article <77e84l$n10$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
+ >You call it what you want, and I will call it what I want.

+ Yes humpty dumpty.

He shoots, he SCCCCCCOOOOOOOOORRRRRRRRRRRREEEEEEEEESSSSSSSSS. And the
crowd goes wild...

James


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

Date: Tue, 12 Jan 1999 09:07:42 -0600
From: Forrest Reynolds <dropzone@mail.utexas.edu>
Subject: Re: PGP system call
Message-Id: <369B653F.56942DD6@mail.utexas.edu>

Abigail wrote:
> 
> Forrest Reynolds (dropzone@mail.utexas.edu) wrote on MCMLVI September
> MCMXCIII in <URL:news:36968B31.1EE9A09D@mail.utexas.edu>:
> **
> ** system "/local/trew/.pgp/pgp -f +batch -z $pass < $temp >> $perm";
> **
> ** Can anyone explain to me what these parms are:
> ** -f, -z, +batch, and maybe a little about how this works
> 
> RTFM. The PGP manual that is. This is not at all a Perl question.
> 
> Abigail
  Abigail,
   Learning does not have to be doled out nun-style. I didn't know this wasn't
a perl question until I posted this, esp. because I found it in a Perl program.
              Sorry for the intrusion, Forrest


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

Date: 12 Jan 1999 07:22:10 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: Problem with PerlScript on PWS
Message-Id: <77fpb2$4rh@chronicle.concentric.net>

Mike Timmins <mat3q@erwin.phys.virginia.edu> writes:

>I'm using PerlScript in active server pages and running them with MS
>Personal Web Server as a development platform.  Problem is, the scripts
>only run correctly the first time through and then won't run again until
>I restart the server.  This problem seems to mainly affect the
>Date::Manip module.  Any suggestions?

Hmm, I use PWS on my desk machine, but the critical difference is that
I'm using the ISAPI PerlIS.dll. In

My Computer\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\ \
	Parameters\Script Map

add a key

 .pl

with value

"C:\Perl\bin\PerlIS.dll"

or wherever your ISAPI DLL happens to reside. I have had no difficulties
running scripts under this setup, other than the usual hoops Winhosed makes
me jump through. One day I'll have HTTPi ported to Win32.

--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
  -- supporting the Commodore 64/128:  http://www.armory.com/~spectre/cwi/ --
   head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"


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

Date: Tue, 12 Jan 1999 10:53:16 -0500
From: Andre Arpin <arpin@adan.kingston.net>
Subject: regulart expression
Message-Id: <369B6FEC.C0F40AEA@adan.kingston.net>

I have an array and would like to find out if any element of the array
does not contain the word 'not'

what I would like is the eqivalent of
grep -v not

Thanks Andre





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

Date: Tue, 12 Jan 1999 14:24:32 GMT
From: icebeerberg@my-dejanews.com
Subject: Text manipulation
Message-Id: <77flut$sj0$1@nnrp1.dejanews.com>

I am attempting to parse through a comma delimited text file to take each
component and print out the components in a different format based on string
length. Does anyone have a simple program example that is able to do this,
or a module which may be able to accomplish this task.

Any help would be appreciated.
Spencer

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 12 Jan 1999 16:09:10 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: corruptor@terry.org.uk
Subject: Re: URGENT: Array of arrays...
Message-Id: <m3iuec5y09.fsf@joshua.panix.com>

corruptor@terry.org.uk (The Corruptor) writes:

> Please Help! I'm getting desperate...

Good!  Soon your desperation will lead you to the documentation.

> I'm trying to create an array of arrays, and can't figure out the
> syntax to do so.

You will find what you need (at increasing levels of detail) in the
following documents, all of which come with perl: perllol, perlref,
perldsc.

> If I have a (say) three element array ($row[0],$row[1],$row[2]) how
> do I assign this array to (say) $parent_array[0]?

Okay, this one's a freebie.  If you want a reference to @row in
@parent_array, then say so with the reference constructor:

    push @parent_array, \@row;

If you want a copy of @row in @parent_array, use the anonymous array
ref constructor:

    push @parent_array, [ @row ];

> I ideally want to index $parent_array[0] to pull out the $row array
> at a later date.

You mean the @row array.  I think you should read perldata, too. 

    @copy_of_row = @{$parent_array[0]};
    $reference_to_row = $parent_array[0];

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf
Off to donate blood.


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

Date: Tue, 12 Jan 1999 10:02:15 -0500
From: Brett Diamond <Brett.Diamond@lmco.com>
Subject: Re: URGENT: Array of arrays...
Message-Id: <369B63F1.7893C701@lmco.com>

Multi-dimentional arrays work just the way you'd want them to.

$parent_array[0][0] = $row[0];
$parent_array[0][1] = $row[1];
$parent_array[0][2] = $row[2];

Or, to do it in one step:

@{$parent_array[0]} = @row; # the braces around $parent_array[0] are needed

You can now do crazy things like:

print $parent_array[0][1];

If you want to get the row back, you can do it the long way (as the first
example above) or like so:

@row = @{$parent_array[0]};

You are dealing with references; the syntax hides it a bit.  This should get
you started, but you'll want to check out perlref and perllol for details.

The Corruptor wrote:

> Please Help! I'm getting desperate...
>
> I'm trying to create an array of arrays, and can't figure out the
> syntax to do so.
>
> If I have a (say) three element array ($row[0],$row[1],$row[2]) how do
> I assign this array to (say) $parent_array[0]?
>
> I ideally want to index $parent_array[0] to pull out the $row array at
> a later date.



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

Date: Tue, 12 Jan 1999 16:18:20 +0100
From: Konrad Holzbauer <konrad.holzbauer@spa.schulen.regensburg.de>
Subject: usertools-0.1
Message-Id: <369B67BC.44429545@spa.schulen.regensburg.de>

Hello,

I created some perl scripts for adding and deleting users by large lists
including E-mail aliases in virtusertable and genericstable, setting
diskquotas and random passwords.

For everyone that4s interested I put my usertools on
http://www.schulen.regensburg.de/software/usertools-0.1.tar.gz.
License is GPL.

Feel free to play with it. I4d appreciate recommendations and
improvements.

Konrad
-- 

------------------------------------------------------------
Konrad Holzbauer konrad.holzbauer@spa.schulen.regensburg.de
                 http://mail.schulen.regensburg.de
------------------------------------------------------------


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

Date: Tue, 12 Jan 1999 06:30:24 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Using a Form in HTML and a Perl Script.
Message-Id: <09ff77.oee.ln@magna.metronet.com>

Jamie Bekkers (jtb@bekkers.com.au) wrote:

: I can get this to run from the console, but I can not work out the code to
: put this in a web page. 


   Perl FAQ, part 9:

      "My CGI script runs from the command line but not the browser.
       (500 Server Error)"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 12 Jan 1999 13:51:16 GMT
From: dave@mag-sol.com
Subject: Re: Vexing Regex problem?
Message-Id: <77fk0j$r10$1@nnrp1.dejanews.com>

In article <77e9ug$39l@hsun27.chevron.com>,
  "Ian Clark" <ifcl@chevron.com> wrote:
> I am attempting to parse an address line which contains the following:
>
> Ian+Clark$%%Chevron+Information+Technology$%%CA+94583
>
> where + is actually chr(32)
>             $ is chr(10) and
>             % is chr(9)
>
> Can some kind peson enlighten me how I can pick out the "Ian Clark" as (say)
> address 1..."Chevron Information Technology" as address 2 and so on...

Look up the split function in perldoc perlfunc.

perldoc -f split


hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

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


Administrivia:

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

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

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4629
**************************************

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