[7421] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1046 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 18 22:07:17 1997

Date: Thu, 18 Sep 97 19:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 18 Sep 1997     Volume: 8 Number: 1046

Today's topics:
     5.005 Availability/Capability t_dhonci@qualcomm.com
     Advanced Perl Programming Tutorial (John Donnelly)
     Bad syntax check with perl -c <Brett.W.Denner@lmtas.lmco.com>
     Re: Calculating the week number (Clay Irving)
     Capacity Planning with NT Perl <cshupp@entergy.com>
     Re: DOS version of PERL 5? (Justin Masters - remove Y toreply)
     echo $status (David Zeng)
     Re: echo $status (David Zeng)
     Re: Help with indirect file handles (Andrew M. Langmead)
     help! ioctl problem ()
     Re: Impossible dbm size (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Memory leak? <admin2@inconnect.com>
     Re: Memory leak? (Jot Powers)
     Re: Nested subs and local vs my (Greg Bacon)
     Novell Web Server & sendmail program <gdoucet@ait.acl.ca>
     Re: Open or die is mostly fatal (Oops, forgot the code, <gdoucet@ait.acl.ca>
     Open or die is mostly fatal <gdoucet@ait.acl.ca>
     Re: Perl CGI Win-httpd problem <rootbeer@teleport.com>
     Portability <rroberts@gowebway.com>
     Re: questions about perl embedded in shell scripts usin (Martien Verbruggen)
     Re: Script to Capitalize HTML Tags (Edward Kelly)
     Re: simple script (Martin Str|mberg)
     Re: The CSV format stinks! <chrisl@bp.com>
     Re: The CSV format stinks! Steve_Kilbane@cegelecproj.co.uk
     Re: The CSV format stinks! <flavell@mail.cern.ch>
     while (/\b([A-Z])\l\1(.*?)\b/g) { print "$&\n"; } <kshaw@plight.lbin.com>
     Re: while (/\b([A-Z])\l\1(.*?)\b/g) { print "$&\n"; } (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Sep 1997 19:12:54 -0600
From: t_dhonci@qualcomm.com
To: akuzhiyi@qualcomm.com
Subject: 5.005 Availability/Capability
Message-Id: <874627149.1902@dejanews.com>

The following was posted a couple of weeks ago & I'm very interested in
something similar.  Does anyone have an idea of when version 5.005 might
be available, and will it support asynchronous calls back into the SAME
interpreter from a DIFFERENT thread?

>>FYI: I'm trying to write an xsub to a library with callbacks, and that
>>library will call perl asynchronously (via the xsub, of course), and
>>possibly in several threads of execution.

>Perl is not yet safe for multithreading, AFAIK.  Wait for 5.005, or
>single-stream execution of Perl.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 18 Sep 1997 14:11:32 -0600
From: johnd@xor.com (John Donnelly)
Subject: Advanced Perl Programming Tutorial
Message-Id: <5vs1tk$gis@xor.com>

The following tutorial is being presented at our training facility in
Boulder, CO.  For further information, registration form contact:
--John Donnelly, Training Coordinator
  XOR Network Engineering, Inc.
  http://www.xor.com/  johnd@xor.com  303-448-4816
				*****
                     Advanced Perl Programming
                  (Three Day Hands-on Lecture/Lab)
                    	  Presented By
                    	Tom Christiansen
		Tuesday - Thursday, October 14-16, 1997
			Tuition: $995

    This course presents everything you'll  need  to  completely
    master  advanced Perl programming using features and facili-
    ties from the latest release of Perl (5.003).

    Who should attend:
    Anyone interested in honing their existing Perl  programming
    skills  for  quick  prototyping,  system utilities, software
    tools, system management tasks, database access,  and  world
    wide web programming.

    Prerequisites:
    Besides having already taken a course in beginning Perl pro-
    gramming  or  having  read  the  Learning  Perl  book  from
    O'Reilly, students should also have already  used  Perl  for
    basic  scripting  for several months previous to taking this
    course.  Basic screen editing and manipulating of files on a
    Unix system are also assumed.


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

Date: Thu, 18 Sep 1997 17:31:49 -0500
From: Brett Denner <Brett.W.Denner@lmtas.lmco.com>
Subject: Bad syntax check with perl -c
Message-Id: <3421ABD5.41C6@lmtas.lmco.com>


I checked the syntax (with perl -c) of the following script:

    $DIGITS = '\d+';
    / $DIGITS (?!a/;   

and the syntax was okay.  The following script

    / \d+ (?!a/;      

however, produces this error: 'unmatched () in regexp'.

It looks like there should be unmatched parentheses errors in both
cases, because the (?! is not balanced by a ).  Is this a bug in perl
or have I overlooked something?

Thanks,
Brett
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Brett W. Denner                                    Lockheed Martin TAS
 Brett.W.Denner@lmtas.lmco.com                      P.O. Box
748            
 (817) 935-1144 (voice)                             Fort Worth, TX 76101
 (817) 935-1212 (fax)                               MZ 9333


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

Date: 18 Sep 1997 20:07:42 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Calculating the week number
Message-Id: <5vsfoe$lqm@panix.com>

In <34238026.16133790@news.algonet.se> bjorn@earthcorp.nn.se (Bjorn) writes:

>I need a piece of code for calculating the current week. I checked the
>perl FAQ, but the formula there doesn't work (unless you're on a year
>that starts with monday and don't care about the last week being
>correct). Any help would be greatly appreciated...

Perl Modules are your friend.

Check out Date::DateCalc or Date::Manip.

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


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

Date: Thu, 18 Sep 1997 16:14:48 -0500
From: Cris Shupp <cshupp@entergy.com>
Subject: Capacity Planning with NT Perl
Message-Id: <342199C8.4FB0@entergy.com>

I am posting to get some ideas, help, and perhaps even actual working
examples of code that could be used for capacity planning purposes.   I
would like to be able to write a Perl program that is capable of 
sampling an NT system for CPU utilization information both globally and
at the workload level   (i.e. I might like
to know that Microsoft Excel utilized 15% of  the systems resources
while Netscape used 10%--by engine if possible).  I would also like to
know how to obtain available memory, paging information, disk
utilization ( by drive) and response time information.

I have discovered that Perl  with the help of  NTRegQueryValueEx and
HKEY_PERFORMANCE_DATA,  HKEY_PERFORMANCE_TEXT, HKEY_PERFORMANCE_NLSTEXT 
can read the system level counters that keep track of all the data I
desire and more. ( soon I will want more!)  

How can I use these features to obtain the information I desire?   All 
ideas are valuable!.
please if you post a response e-mail it to me as well to
cshupp@entergy.com  .


						Thanks,

						Cris Shupp


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

Date: 18 Sep 1997 12:39:06 -0700
From: jmastYers@pcocd2.intel.com (Justin Masters - remove Y toreply)
Subject: Re: DOS version of PERL 5?
Message-Id: <cavwwkebeed.fsf@fri034.fm.intel.com>

bart.mediamind@tornado.be (Bart Lateur) writes:

> 
> Rachel Holmes <rachelh@nortel.ca> wrote:
> 
> >Is there a version of perl available for DOS, that is 100% compatible
> >with unix perl 5?
> 
> Grab the OS/2 port. YOu need EMX and/or RSX too, but these are free too.
> 
> HTH,
> Bart.

I did that, but how do you run perldoc?

I ripped out the top parts of various files, I tried doing what it said
regarding "perl perldoc perldoc" but that didn't work.

Then I tried creating a batch file, named foo.bat that said

perl %1 %2

I typed "foo perldoc perldoc" (and if you create programs with variable
numbers of command line parameters, you keep adding more %#'s, but find
that you can't redirect the output to a file, you can't pipe, etc.)


Any info?  Am I using it wrong?  I tried looking through the code, and 
used the -v or whatever switch (it's been awhile since I tried), to see 
what directories are being searched in for the files, so I know that perldoc
is running, but can't seem to print out documentation...


Justin (remove Y toreply)
-- 
------------------------------------------------------------------------------
   Justin Masters   (Sr. Cad Engineer - Design Automation)  PH: 916-356-6735
   Intel Corp. FM5-94                                      FAX: 916 356-7874
   1900 Prairie City Rd, Folsom, CA 95630          jmastYers@pcocd2.intel.com


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

Date: 18 Sep 1997 22:43:36 GMT
From: dizzy@soda.CSUA.Berkeley.EDU (David Zeng)
Subject: echo $status
Message-Id: <5vsaqo$3uh@agate.berkeley.edu>

Hi, there,

I am interested in checking the system status from perl by calling the 
Cshell command: 
	echo $status;

Therefore, I wrote the following line in Perl:
	$status_holder = `echo \$status`;

I've used this method many times before in my attempts to get the output 
from a shell command.  For some reason, Perl cannot get the "0" or "1" from
the output of "echo $status."  I'm confused by the different results from 
Perl.  

I also tried to save the output of "echo $status" into a file by the 
perl line: 
	`echo \$status > temp_file`
When I type that command in from regular unix promp, and then check the
content of "temp_file," I'd get the desired 0 or 1.  On the other hand,
using `echo \$status > temp_file` in Perl simply does not do the trick,
and temp_file only holds an empty line.

What type of problem can this be?  Does perl not like shell outputs from
commands such as "echo" or "more?"

Thanks for any help.

David Zeng



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

Date: 18 Sep 1997 22:57:02 GMT
From: dizzy@soda.CSUA.Berkeley.EDU (David Zeng)
Subject: Re: echo $status
Message-Id: <5vsbju$47k@agate.berkeley.edu>


Uh... dumb me.  Perl runs Bourne Shell, and "echo $status" should be
"echo $?" in Borune Shell.

Sorry for the trouble and wasted bandwidth.

David Zeng


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

Date: Thu, 18 Sep 1997 23:15:12 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Help with indirect file handles
Message-Id: <EGq8LD.3Jz@world.std.com>

"Ronald Sercely (emd) {xxxx}" <rzs@gbr.msd.ray.com> writes:
[stuff deleted]
>        print $OUT{$string};    # works
>        print $OUT{$string} "xx"; # syntax error


>What does the first print the inderect file work
>but the second give a syntax error?

When printing to an indirect filehandle, the filehandle has to be
either a simple scalar variable, or a block returning a scalar.

   print { $OUT{$string} } "xx";

see <URL:http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfunc
/print.html>


The FAQ recommends using the FileHandle module instead of instead of
dealing with indirect file handles.

$OUT{$string}->print("xx");

<URL:http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq5/How
_can_I_make_a_filehandle_loca.html>
-- 
Andrew Langmead


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

Date: 18 Sep 1997 22:57:50 GMT
From: hdlee@garlic.engr.ucdavis.edu ()
Subject: help! ioctl problem
Message-Id: <5vsble$kf$1@mark.ucdavis.edu>

I ran the example given on p.180 of the camel book 2nd edition and
got the following error message:

Can't locate object method "struct" via package "sgttyb" at (eval 58) line 1.

using Perl version 5.004.  If I ran it on Perl version 5.003, it worked.  
Both versions of Perl seem to have the neccessary .ph files.  I have
no idea what's wrong.  Can someone help?  Thanks.


The code listing is:

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

require 'sys/ioctl.ph';
require 'sys/termios.ph';
 
$getp = &TIOCGETP or die "NO TIOCGETP"; 
$sgttyb_t = "ccccs";
 
if (ioctl STDIN, $getp, $sgttyb) {
        @ary = unpack $sgttyb_t, $sgttyb;
        $ary[2] = 127;
        $sgttyb = pack $sgttyb_t, @ary;
        ioctl STDIN, &TIOCSETP, $sgttyb
        or die "Can't ioctl TIOCSETP: $!";
}

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

-Dave



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

Date: Thu, 18 Sep 97 21:04:24 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Impossible dbm size
Message-Id: <3421d095$2$ofn$mr2ice@speaker.kf8nh.apk.net>

In <34202F4C.66B2FDBA@ican.net>, on 09/17/97 at 03:28 PM,
   Charles Jaimet <cjaimet@ican.net> said:
+-----
| My server says my dbm database file takes up 4,800 GB!
| The server doesn't have nearly that much storage space and when I dump the
| file to text it's only 239 kB.
+--->8

dbm exploits the fact that Unix allows "holes" in files:  empty spaces with no
disk space backing them.  This allows dbm to hash a key to a "page number" on
disk (faster), but can be somewhat confusing because the file looks a lot
bigger than it really is.

It's only a problem if you try to copy the file via a utility that doesn't
know about "sparse files" or "holes", which will cause the copy to have the
holes filled in.

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)           FORZA CREW!
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org



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

Date: Thu, 18 Sep 1997 15:39:23 -0600
From: Steve Wolfe <admin2@inconnect.com>
Subject: Memory leak?
Message-Id: <34219F8B.2B68@inconnect.com>

I am currently writing a script to parse our passwd file, and make sure
that each person has an entry in our qmail configuration file.  However,
the script has a huge memory leak.  Prossessing the first 80 lines of
the passwd file, it takes up 29 megs of ram, and if I try to process the
whole thing, it takes well over 250 megs, and eventually the machine
says "out of memory".  I've tried it under Perl 5.003 and 5.004, same
results.  Any ideas why?  Here's the code:



(Note:  Before this, the assign file is read into the array @newassign,
with one line of the qmail "assign" file as each entry, apprx. 2000
entries.)



for ($temp=0;$temp<80;$temp++){
	($username, $password, $userid, $groupid, $quota, $comment, $infofield,
$homedir) = getpwent();

	$verified=0;
	for ($loop=0;$loop<@newassign;$loop++){
        	@line = split(/:/, $newassign[$loop]);
	        if ($line[1] eq $username){
	                $verified=1;
        	}
	}

if ($verified ==1){
print ("$username exists in both files.\n");
}

Steve Wolfe 
Internet Connect, Inc.


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

Date: 18 Sep 1997 22:47:40 GMT
From: news@bofh.com (Jot Powers)
Subject: Re: Memory leak?
Message-Id: <5vsb2c$9rg$1@gazette.corp.medtronic.com>

In article <34219F8B.2B68@inconnect.com>, Steve Wolfe wrote:
>I am currently writing a script to parse our passwd file, and make sure
>that each person has an entry in our qmail configuration file.  However,
>the script has a huge memory leak.  Prossessing the first 80 lines of
>the passwd file, it takes up 29 megs of ram, and if I try to process the
>whole thing, it takes well over 250 megs, and eventually the machine
>says "out of memory".  I've tried it under Perl 5.003 and 5.004, same
>results.  Any ideas why?  Here's the code:

I'd guess something else is going on.  But, your script could use a lot
of help too.  Then again TIMTOWTDI.  :) 

The first thing is that when you cut your script for us, you must have
cut out:

#!/usr/local/bin/perl -w

use strict;

*grin*
>for ($temp=0;$temp<80;$temp++){
>	($username, $password, $userid, $groupid, $quota, $comment, $infofield,
>$homedir) = getpwent();
>
>	$verified=0;
>	for ($loop=0;$loop<@newassign;$loop++){
>        	@line = split(/:/, $newassign[$loop]);
>	        if ($line[1] eq $username){
>	                $verified=1;
>        	}
>	}
>
>if ($verified ==1){
>print ("$username exists in both files.\n");
>}

Here is my version of yours:

#!/usr/local/bin/perl -w
 
use strict;
 
my @newassign;
 
@newassign = (
        '0:root:0:',
        '1:uucp:1'
        );
 
my ($user);
 
while($user = (getpwent())[0]) {
# The (getpwent())[0] says only get the 0'th element of the returned array.
 
        my ($key);
 
        foreach $key (@newassign) {
                print "$user exists in both files.\n" 
                        if ((split(/:/,$key))[1] eq $user);
        }
}

Which gives me:

root exists in both files.
uucp exists in both files.
root exists in both files.
uucp exists in both files.

(hmm..I believe this is because I'm running NIS and it's going through
my local and the NIS file.)

Of course for stuff like this, I'd rather use a hash for newassign as
opposed to a numerically subscripted array.  If you could do something like:

(**warning, untested code follows**):

# Load %newassign
open(FILE,qmailfile) or die "$!\n";

while(defined(<FILE>)) {
   chomp;

   $newassign{(split(/:/)[1])}++;
}

close(FILE) or die "$!\n";

Then you can change the print ... if to something like:

		print "$user exists in both files.\n"
			if (defined($newassign{$user}));



Both of these methods should save you _some_ memory as you're not allocating
variables that you never use with the splits.

HTH, if I'm completely off-base, someone will correct me.)

-- 
Jot Powers  news@bofh.com
Unix System Administrator
"Sometimes you just have to grab the bull by the tail and face the situation."


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

Date: 18 Sep 1997 22:10:39 GMT
From: gbacon@adtran.com (Greg Bacon)
To: turnerj@cliffy.lmtas.lmco.com (Jim Turner )
Subject: Re: Nested subs and local vs my
Message-Id: <5vs8sv$ntv$1@info.uah.edu>

[Posted and mailed]

In article <5vrqok$d2n3@quest.lmtas.lmco.com>,
	turnerj@cliffy.lmtas.lmco.com (Jim Turner ) writes:
: 	Hello.  This problem has caused me a lot of grief due to my apparant
: ignorance of Perl's scoping.  Can anyone tell me why the following
: code:

[snip code with nested subs]

: Changing "my" to "local" for "b" in "outter" seems to solve my problem,
: but can lead to other problems associated with local, and I would prefer
: to normally use my.  I also just wonder why b is undefined on every call
: but the first.

Had you run this with -w, you'd have seen

    Variable "$b" will not stay shared at script line 13.

IOW, if you want Pascal, you know where to find it. :-)

What you can do is use an anonymous subroutine.  Something like:

    sub outerfun {
        my $b;

        my $inref = sub {
            $b = $i;
            print "...";
        }

        $inref->();
    }

Beware of closure issues if you return the reference outside &outerfun's
scope.

Hope this helps,
Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Thu, 18 Sep 1997 21:56:44 -0300
From: Guy Doucet <gdoucet@ait.acl.ca>
Subject: Novell Web Server & sendmail program
Message-Id: <3421CDCB.A3D7AA22@ait.acl.ca>

Fine on a Unix box perhaps, but how do you get Perl to forward an e-mail
from Novell Web Server. I do have a Unix server on the network with
email but can the Perl script call to this box from the Novell box.

Can anyone help me with the best solution, or any solution!

Guy Doucet



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

Date: Thu, 18 Sep 1997 22:46:18 -0300
From: Guy Doucet <gdoucet@ait.acl.ca>
Subject: Re: Open or die is mostly fatal (Oops, forgot the code, here it is:)
Message-Id: <3421D969.6859E177@ait.acl.ca>



--------------FC44D82BF4F2C783232E5D79
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

# -- 3 ---------- Rewrite the MAIN PAGE
sub upboards {
   open(MAIN1,"$basedir/$chatfil\.htm") || die $!;
   @main = <MAIN1>;
   close(MAIN1);
   open(MAIN2,">$basedir/$chatfil\.htm") || die $!;
   foreach $main_line (@main) {
      if ($main_line =~ /<!--fin-->/) {
         print MAIN2 "$comment <BR> \n";
         print MAIN2 "$main_line";
      }
      else {
         print MAIN2 "$main_line";
      }
   }
   close(MAIN2);
}


Guy Doucet wrote:

> The following code is giving me a headache. It always opens the file the
> first time, but more often than not, it dies the second time.
>
> I am running this on Novell Web Server. I use the same code in another
> program and it runs very well.
>
> Thank you for any and all info.
> new kid on the block, Guy Doucet



--------------FC44D82BF4F2C783232E5D79
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
<TT># -- 3 ---------- Rewrite the MAIN PAGE</TT>
<BR><TT>sub upboards {</TT>
<BR><TT>&nbsp;&nbsp; open(MAIN1,"$basedir/$chatfil\.htm") || die $!;</TT>
<BR><TT>&nbsp;&nbsp; @main = &lt;MAIN1>;</TT>
<BR><TT>&nbsp;&nbsp; close(MAIN1);</TT>
<BR><TT>&nbsp;&nbsp; open(MAIN2,">$basedir/$chatfil\.htm") || die $!;</TT>
<BR><TT>&nbsp;&nbsp; foreach $main_line (@main) {</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($main_line =~ /&lt;!--fin-->/)
{</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print MAIN2 "$comment
&lt;BR> \n";</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print MAIN2 "$main_line";</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print MAIN2 "$main_line";</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</TT>
<BR><TT>&nbsp;&nbsp; }</TT>
<BR><TT>&nbsp;&nbsp; close(MAIN2);</TT>
<BR><TT>}</TT>
<BR><TT></TT>&nbsp;

<P>Guy Doucet wrote:
<BLOCKQUOTE TYPE=CITE>The following code is giving me a headache. It always
opens the file the
<BR>first time, but more often than not, it dies the second time.

<P>I am running this on Novell Web Server. I use the same code in another
<BR>program and it runs very well.

<P>Thank you for any and all info.
<BR>new kid on the block, Guy Doucet</BLOCKQUOTE>
&nbsp;</HTML>

--------------FC44D82BF4F2C783232E5D79--



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

Date: Thu, 18 Sep 1997 21:53:38 -0300
From: Guy Doucet <gdoucet@ait.acl.ca>
Subject: Open or die is mostly fatal
Message-Id: <3421CD11.9DBF156B@ait.acl.ca>

The following code is giving me a headache. It always opens the file the
first time, but more often than not, it dies the second time.

I am running this on Novell Web Server. I use the same code in another
program and it runs very well.

Thank you for any and all info.
new kid on the block, Guy Doucet



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

Date: Thu, 18 Sep 1997 14:00:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: August Brunsman <brunsman.3@pop.service.ohio-state.edu>
Subject: Re: Perl CGI Win-httpd problem
Message-Id: <Pine.GSO.3.96.970918135759.14856D-100000@julie.teleport.com>

On Thu, 18 Sep 1997, August Brunsman wrote:

> I keep getting told that the PerlVM can't startup
> due to a problem wiht its PIF file.

Sounds like either that message is accurate (and then you need to fix the
PIF file) or it's not (and then you need to fix the program that's giving
you that message. But since Perl isn't running, there's no Perl code I can
give you that would help! :-)  I suggest you check with folks who know
about the software which refuses to run Perl, to see whether they have any
helpful suggestions. Certainly you're likely to get a more complete and
more accurate answer that way. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 18 Sep 1997 18:36:13 -0700
From: fractture <rroberts@gowebway.com>
Subject: Portability
Message-Id: <3421D70D.FBD91AF4@gowebway.com>

I am trying to decide what language to write an application it.
It would have IRC interface.
I am looking over sirc which would handle the interface, and perl/tk to
do the GUI.
I am also thinking perl would handle the databases quite well, pluss
I know some perl and have no knowladge of others.
Also one of my main concerns is getting it to work on a Windows machine
(not for me!!) so that others would find it usefull.  But,
#!/usr/bin/perl has no function in Windows, so would I be able to do
what I want here?  Also, does the tk module work well under windows (I
know...comp.lang.perl.tk, but I am here so..)?
I think my only other option would be Java.  Or write it in C and say
screw the windows guys.

Anyway, let me know if this has any possibility of working.



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

Date: 19 Sep 1997 01:08:14 GMT
From: mgjv@mali.comdyn.com.au (Martien Verbruggen)
Subject: Re: questions about perl embedded in shell scripts using -e (LONG!)
Message-Id: <5vsj9u$bbj$1@comdyn.comdyn.com.au>

In article <874608421.12326@dejanews.com>,
	txporter@mindspring.com writes:
> I am writing a script to read a mail folder and split it up into separate
> files, based on the month and year in the FROM header.  Its based on the
> following script for purging messages older than a certain number of days.
>  The model script uses embedded perl so all active code can be seen in the
> single shell script as so:

[lots of stuff deleted]

hiya,

If you're using perl to do some stuff, why not use perl for the whole thing?
There is a collection of modules available that do some mailbox handling.

Have a look at

http://www.perl.com/CPAN/authors/id/GBARR/

and download the MailTools packages.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 18 Sep 1997 22:18:43 GMT
From: ekelly01@uoguelph.ca (Edward Kelly)
Subject: Re: Script to Capitalize HTML Tags
Message-Id: <5vs9c3$q2u@ccshst05.cs.uoguelph.ca>

Robert Maguire (maguirer@hercules.cs.uregina.ca) wrote:
: Is there a script already out there that can do this for me or do i need to
: write one myself.  I've already got most of it written, except for just the
: right regexp or regexps to do the capitalization correctly.

I wrote a script to capitalize HTML tags a long time ago (way before I
understood regular expressions!).  It's pretty crude, but it specifically
capitalizes everything in tags except attributes in quotes.  You can see
it at http://www.uoguelph.ca/~ekelly01/Perl/lower2upper.txt

--
Edward Kelly
ekelly01@uoguelph.ca
http://www.uoguelph.ca/~ekelly01/


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

Date: 17 Sep 1997 19:56:47 GMT
From: ams@ludd.luth.se (Martin Str|mberg)
Subject: Re: simple script
Message-Id: <5vpclv$bih$1@news.luth.se>

Jiri medlen (jmedlen@lpd.sj.nec.com) wrote:
: #!
: print "content-type: text/html\n\n";
: $num = system ('grep -c \'GET /HTTP\'
: c:\netscape\server\httpd-80\logs\access');
: $num += system ('grep -c \'GET /index.html\'
: c:\netscape\server\httpd-80\logs\access');
: print "$num\n"; 
: 
: result
: variable num = 0

That's right, it works.

You asked that the ouput from system() be assigned to $num, and it
was.

Probably you were more interested in getting the output from the grep,
weren't you? Yes, perhaps you meant to code like this:
$num = `grep -c \'GET /HTTP\' c:\netscape\server\httpd-80\logs\access`


Right,

							MartinS


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

Date: Fri, 19 Sep 1997 07:32:59 +1000
From: Chris Leach <chrisl@bp.com>
Subject: Re: The CSV format stinks!
Message-Id: <34219E0B.32F3@bp.com>

Doug Seay wrote:
> 
> Chris Leach wrote:
> >
> > If you CVS file was not broken I'd suggest using the CVS module
> > to parse your file.
> > I suggest you get whatever produces this file fixed the use
> > the CVS.

> Chris, I'd guess that you know the difference and just made typos when
> replying, but I'm just trying to prevent anyone else from getting
> confused.
> 
> - doug
Thanks Doug. I indeed did mean CSV (comma seperated values) and
the CSV module not CVS.
-- 
Chris Leach		  Mail:  leachcj@bp.com or chrisl@oakton.com.au
Oakton Computing          Phone: +61 3 92684771    Fax:  +61 3 92684466


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

Date: Thu, 18 Sep 1997 09:13:38 GMT
From: Steve_Kilbane@cegelecproj.co.uk
Subject: Re: The CSV format stinks!
Message-Id: <9127cd$9d26.3e@news.cegelecproj.co.uk>


I'm just curious: can whatever demented software that generated
this file actually read the damn thing back in again, without
errors?
-- 
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
Kilbane's law of integration: standardise on protocols and file
formats, and the applications take care of themselves.



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

Date: Fri, 19 Sep 1997 00:31:54 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: The CSV format stinks!
Message-Id: <Pine.A41.3.95a.970919023044.66152A-100000@sp058>

On Fri, 19 Sep 1997, Chris Leach wrote:

> Thanks Doug. I indeed did mean CSV (comma seperated values) 

I think I just detected a perity error.
;-)

-- 

         "London nominates new arms body head" - news snip




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

Date: 18 Sep 1997 17:04:17 -0700
From: kendall shaw <kshaw@plight.lbin.com>
Subject: while (/\b([A-Z])\l\1(.*?)\b/g) { print "$&\n"; }
Message-Id: <527mcegoe6.fsf@plight.lbin.com>


Hi,

I want to find all words like Llewelyn. My snippet doesn't work
with my perl 5.0004. Any ideas?

Kendall


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

Date: Thu, 18 Sep 1997 21:40:19 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: while (/\b([A-Z])\l\1(.*?)\b/g) { print "$&\n"; }
Message-Id: <comdog-ya02408000R1809972140190001@news.panix.com>

In article <527mcegoe6.fsf@plight.lbin.com>, kendall shaw <kshaw@plight.lbin.com> wrote:

>I want to find all words like Llewelyn. My snippet doesn't work
>with my perl 5.0004. Any ideas?

not sure what you mean by "like Llewelyn", but does adding the i
modifier work for you?

#!/usr/bin/perl5.004_01

$_ = 'Llewelyn';

while ( / \b        # 0. a word boundary  
          ([A-Z])   # 1. an uppercase letter    
          \l        # 2. ????    
          \1        # 3. a back reference to 1 (case insensitive)    
          (.*?)     # 4. whatever is left up to the next word boundary         
          \b        # 5. a word boundry   
       /gxi )  

{ print "\$& = $&\n\$1 = $1\n\$2 = $2\n" }

__END__

$& = Llewelyn
$1 = L
$2 = ewelyn

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

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