[7971] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1596 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 7 16:17:16 1998

Date: Wed, 7 Jan 98 13:00:23 -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           Wed, 7 Jan 1998     Volume: 8 Number: 1596

Today's topics:
     Re: "shift @array" question <jdporter@min.net>
     Re: arrays as parameters in subroutines (Matthew Cravit)
     Re: Arrgghhhhh! There must be a simple solution to this <jdporter@min.net>
     Re: base64encode/decode <dfetter@shell4.ba.best.com>
     Re: bison for perl <jdporter@min.net>
     Re: Capturing STDERR on NT <defaultuser@domain.com>
     Re: Editing Perl question (brian d foy)
     Good place to start in Perl 5 <gendress@symbios.com>
     Help with a sort (Jeff McFadyen)
     Re: how does hashes work in angle brackets ? <joseph@5sigma.com>
     How to Configure Perl with IIS 4.0 <stevew@metafuse.com>
     How to Configure Perl with IIS 4.0 <stevew@metafuse.com>
     How to Configure Perl with IIS 4.0 <stevew@metafuse.com>
     Re: Lexical scope and embedded subroutines. (Earl Hood)
     Re: Modularize non object code (M.J.T. Guy)
     Net::LDAPapi's ldap_get_values <huard@netrev.com>
     Perl on NT 3.51 for CGI? <jjacobs@lach.net>
     Re: Q: search matching "(" and ")" (Craig Berry)
     Re: Review of CGI/Perl book <adavid@netinfo.com.au>
     Running  a perl script in the background on Windows(95/ <noel@integrityonline.com>
     Re: Running  a perl script in the background on Windows <andys@nvisual.com>
     Re: serious post about gmtime and year-1900 (was Re: Pe (Chris Nandor)
     Re: Storing A Text File Into A Variable -- How?? <barnett@houston.Geco-Prakla.slb.com>
     Re: Would yo explain the Perl "pack" command to me? (Matthew Cravit)
     Re: Would yo explain the Perl "pack" command to me? <joseph@5sigma.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 07 Jan 1998 14:00:56 -0500
From: John Porter <jdporter@min.net>
Subject: Re: "shift @array" question
Message-Id: <34B3D0E8.1C21@min.net>

Jerry Lineberry wrote:
> 
> ... at one point I have to use the shift
> command three times in a row. Can this be done with one command?
> 
> shift @users;             # How can I remove the first three lines
> shift @users;             # without doing this?
> shift @users;
> open(OUTPUT, ">nym.users") or die "Can't open newfile nym.users: $!\n";
> foreach $user (@users) {

Sure, splice(@users,0,3) works, but you could do this instead:

# do no shifts, but then:
foreach $user ( @users[ 3 .. $#users ] ) {
   # etc.


John Porter
jporter@logicon.com


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

Date: 7 Jan 1998 11:09:45 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: arrays as parameters in subroutines
Message-Id: <690jtp$n25$1@shell3.ba.best.com>

In article <34B3CBB5.EFBCD1DC@birdsong.cudenver.edu>,
Brian  <brian@birdsong.cudenver.edu> wrote:
>I'm trying to send a sub two arrays, but only the first array's values
>are being read.

The easiest way to do this is with references. The problem is that when
you call a sub like

    DoSomething(@foo, @bar);

the parameters to the sub are passed in @_, and so get "flattened" into
one array. The way to avoid this is to not pass @foo and @bar directly, but
instead pass references to them. The perlref man page has lots of detail
about this, but in a nutshell, you'd call your subroutine like this:

    DoSomething(\@foo, \@bar);

and then do something like this in your subroutine to get the arrays back:

    sub DoSomething {
        my ($fooref, $barref) = @_;
        my @foo = @{$fooref};
        my @bar = @{$barref};

        # Do whatever with @foo and @bar
    }

Hope this helps!

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Wed, 07 Jan 1998 13:57:34 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Arrgghhhhh! There must be a simple solution to this script error
Message-Id: <34B3D01D.211@min.net>

James Robshaw wrote:
> 
> Can anyone please point me in the right direction.
> 
> I have a perl script that works fine until I try to edit this particular
> line from
> 
> print NEWFILE "  <body >\n";
> 
> into
> 
> print NEWFILE "  <body bgcolor="#B4BCCD" text="#000000" link="#000066"
> vlink="#990000">\n";
> 
> Is it the repetition of the "#" that causes the error?
> Can I place a default character in front of the # to prevent the error?

Nope.  The problem is with the double-quote characters.  Hey, if the
string starts with a ", it ends at the next (unescaped) ".
Try changing the whole string to be enclosed in qq//. (Look it up.)

  print NEWFILE qq{  <body bgcolor="#B4BCCD" text="#000000"
link="#000066"
    vlink="#990000">\n};

Actually here I used qq{}.  Same diff. Choose enclosing delimiters which
don't occur in the string literal.

> The script doesn't actually generate an error code, I just get the default
> Server Error 500.

Actually it IS the script that's failing.  And that results in a server
error.

> I have tried a couple of things, but none have worked. I'm going potty,

Ok, bathroom breaks are allowed...  ;-)

John Porter
jporter@logicon.com


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

Date: 7 Jan 1998 20:16:37 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: base64encode/decode
Message-Id: <690nr5$34d$2@nntp1.ba.best.com>

Usha Vas Larson <uvlarson@avesta.com> wrote:
> Hi,

> Has anybody written base64encode/decode routine in perl? If so, could
> you point me to it. I'm new to perl and realize that it would take me a
> while to figure it out, and need it asap.

CPAN has MIME::Base64, which is probably what you need.

HTH, 
Dave.
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
                                       Kernighan 


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

Date: Wed, 07 Jan 1998 14:17:23 -0500
From: John Porter <jdporter@min.net>
Subject: Re: bison for perl
Message-Id: <34B3D4C3.6265@min.net>

Richard Jelinek wrote:
> 
> Hi there,
> 
> I'm looking for a parser generator for perl. The only thing I've
> found was:
> 
> http://www.cs.berkeley.edu/~sfink/perl-bison.release.html
> 
> But I wasn't able to find the executable itself. Any halp is
> apreciated. Thank you.

The binaries are not distributed. You have to compile them 
yourself.  That's the Internet/Unix Way!


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

Date: Wed, 07 Jan 1998 13:21:35 -0600
From: brian <defaultuser@domain.com>
Subject: Re: Capturing STDERR on NT
Message-Id: <34B3D5BF.8EA90FFB@domain.com>

Todd O'Connor wrote:

> I am having a hard time capturing STDERR on NT 4.0. Has anyone found a way
> to do this with Perl?

# borrowed from camel book pp 193
open(SAVESTDERR, ">&STDERR") or croak "Couldn't dup STDERR";
open(STDERR, ">mylogfile.txt") or croak "Couldn't redirect STDERR";
select STDERR; $| = 1;
select STDOUT;

print STDERR "blarf!\n";

# restore STDERR
close(STDERR);
open(STDERR, ">&SAVESTDERR");

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-brian




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

Date: Wed, 07 Jan 1998 14:05:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Editing Perl question
Message-Id: <comdog-ya02408000R0701981405500001@news.panix.com>
Keywords: from just another new york perl hacker

In article <19980107183501.NAA01421@ladder02.news.aol.com>, manyhats12@aol.com (Manyhats12) posted:

>Is it possible to use notepad in Windows to edit a cgi script written in Perl?

Perl source is text.  any thing that can edit text can edit Perl source.
carriage return/line feed problems depend on where the text ends up
and how it got there.  transferring text in ASCII mode in ftp should
take care of inter-system differences.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 07 Jan 1998 11:40:27 -0700
From: Gabriele Endress <gendress@symbios.com>
Subject: Good place to start in Perl 5
Message-Id: <34B3CC1B.54AB15AC@symbios.com>

Hi,

I'm really interested in learning Perl 5 so I can begin writing my own
CGI scripts. I was wondering if any of you had a recommendation of any
good beginners books for me start with?

This would be the first hard core programming language I'd be learning.
The only other "code" I've ever learned are HTML and BASIC. :-)

Thanks in advance,

Gabi
-- 
--------------------------------------------------------------
Gabriele Endress			Symbios, Inc.
Assistant Webmaster			Fort Collins, CO

"Reality is merely an illusion, albeit a very persistent one."
 - Albert Einstein (1879-1955)
-------------------------------http://www.symbios.com---------


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

Date: 7 Jan 1998 19:23:30 GMT
From: mcfadyj@gov.on.ca (Jeff McFadyen)
Subject: Help with a sort
Message-Id: <690kni$rr1$1@news.gov.on.ca>

I want to read in a data file, split the input into an array, sort the array 
and then printout a sorted - non-duplicated list.  The code that I have been
playing with will print out what I want an array field at
a time but I can't get it to print an entire record.
 Any help would be appreciated.
			thanks...

open(SORTIN,"c:\\ems\\sort\\subject.rpt");
while (<SORTIN>) {

        chop();

        $line=$_;                   #read in a line of data

        @linein=$line;
        
        @fields=split/\|/,$line;    #split input line into array

        $fields[99]=$line;
        $lineout=$fields[99];

        $emsno=$fields[0]; $omsno=$fields[1];   #define input fields
        
        $foo{$emsno}=$omsno;        #define relationship based on ln
        $foo{$dataline}=$lineout;
      }

        foreach $emsno(sort(keys(%foo)))
          {
           print "$foo{$dataline}\n";
           #print "$emsno $foo{$emsno}\n";
          }






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

Date: Wed, 07 Jan 1998 12:18:36 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: how does hashes work in angle brackets ?
Message-Id: <34B3D4FA.D5CB203B@5sigma.com>

The simplest thing to do here is to use the getline{s} method.
See the man page for FileHandle or IO::Handle.  If that doesn't
work let us know exactly what the problem is.

	-joseph
	 http://www.effectiveperl.com

Bela Garzo wrote:
> 
> Hi Mike,
> 
> yes I read it, but it doesn't cover that problem.
> If I used scalars or arrays to store filehandles, everything ok.
> I've stored fh in a hash ( old or new style doesn't differ ), and
> used in <>, something goes wrong ( not syntactically )
> Please try out the code.


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

Date: Wed, 07 Jan 1998 11:41:43 -0800
From: Steve West <stevew@metafuse.com>
To: james@netmart.com, kevincou@microsoft.com, stevew@metafuse.com, iarbitma@costamesa.bozell.com
Subject: How to Configure Perl with IIS 4.0
Message-Id: <34B3DA76.A3AF561B@metafuse.com>

For all you who are trying to run IIS 4.0 and perl here is what you have
to do to configure it to run properly on IIS 4.0.

I have outlined a two step process to get it to work...here goes

****** STEP 1.   CONFIGURE PERL TO WORK WITH IIS 4.0*****
Microsoft changed from having the script mappings in the registry to the
a
configuration in the service manager.  Now script mappings are changed
in the
default website properties.

Go to the default website, right mouse click on the properties for that
site....

then click on "Home Directory" tab
Go to the "Applications Settings" toward the bottom of the window...find

the "Configuration" button...the click on  it.  A new window called
script
mappings exists..you need to either create a new script mappings or edit
the old
one.

It should look like this

 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s

I had those set before in the registry...as you may have too...and MS
IIS 4.0
pulled the values out and capitalized the %S %S...that wont work..it
looked like
this

*** MICROSOFT PUT THIS THERE...IT WILL NOT WORK ***
 .pl      C:\PERL\BIN\PERL.EXE %S %S

*** YOU MUST CHANGE MAPPING TO LOOK LIKE THIS***
 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s



***** STEP 2.  CONFIGURE PERL TO WORK WITH STANDARD I/O *****

By default you cannot use standard I/O redirection with perl and IIS
4.0.

You have to configure this into the metabase.  Here is how you do it:
You need to run a command line from the:
"\winnt\system32\inetsrv\adminsamples" directory

When you get there type this on the command prompt

adsutil set w3svc/CreateCGIWithNewConsole TRUE

You may get an error becuase the .vbs is not set, just click on yes, and
retype the command if you get that error.

You will have to stop the default website, and restart it from the
internet service manager to make the changes.

NOTE:  If for some reason you cannot get the adsutil at the command
prompt, or you get unrecognized command, you may want to search for it
using the start menu, find.  Look on your system for "adsutil.vbs".  If
you still cannot find it, you perhaps did not install all the
samples...you may go to the Windows NT 4.0 Option pack setup from the
start menu and check to see if you can install the administration
samples.  I am not sure if the adsutil.vbs shipped in all cases, but
most of you will have it in your
"winnt\system32\inetsrv\adminsamples" directory.

I hope this note helps you guys and keeps you from having same trouble I
had.

Steve West







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

Date: Wed, 07 Jan 1998 11:38:18 -0800
From: Steve West <stevew@metafuse.com>
To: james@netmart.com, kevincou@microsoft.com, stevew@metafuse.com, iarbitma@costamesa.bozell.com
Subject: How to Configure Perl with IIS 4.0
Message-Id: <34B3D9AA.3C54B64B@metafuse.com>

For all you who are trying to run IIS 4.0 and perl here is what you have
to do to configure it to run properly on IIS 4.0.

I have outlined a two step process to get it to work...here goes

****** STEP 1.   CONFIGURE PERL TO WORK WITH IIS 4.0*****
Microsoft changed from having the script mappings in the registry to the
a
configuration in the service manager.  Now script mappings are changed
in the
default website properties.

Go to the default website, right mouse click on the properties for that
site....

then click on "Home Directory" tab
Go to the "Applications Settings" toward the bottom of the window...find

the "Configuration" button...the click on  it.  A new window called
script
mappings exists..you need to either create a new script mappings or edit
the old
one.

It should look like this

 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s

I had those set before in the registry...as you may have too...and MS
IIS 4.0
pulled the values out and capitalized the %S %S...that wont work..it
looked like
this

*** MICROSOFT PUT THIS THERE...IT WILL NOT WORK ***
 .pl      C:\PERL\BIN\PERL.EXE %S %S

*** YOU MUST CHANGE MAPPING TO LOOK LIKE THIS***
 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s



***** STEP 2.  CONFIGURE PERL TO WORK WITH STANDARD I/O *****

By default you cannot use standard I/O redirection with perl and IIS
4.0.

You have to configure this into the metabase.  Here is how you do it:
You need to run a command line from the:
"\winnt\system32\inetsrv\adminsamples" directory

When you get there type this on the command prompt

adsutil set w3svc/CreateCGIWithNewConsole TRUE

You may get an error becuase the .vbs is not set, just click on yes, and
retype the command if you get that error.

You will have to stop the default website, and restart it from the
internet service manager to make the changes.

NOTE:  If for some reason you cannot get the adsutil at the command
prompt, or you get unrecognized command, you may want to search for it
using the start menu, find.  Look on your system for "adsutil.vbs".  If
you still cannot find it, you perhaps did not install all the
samples...you may go to the Windows NT 4.0 Option pack setup from the
start menu and check to see if you can install the administration
samples.  I am not sure if the adsutil.vbs shipped in all cases, but
most of you will have it in your
"winnt\system32\inetsrv\adminsamples" directory.

I hope this note helps you guys and keeps you from having same trouble I
had.

Steve West







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

Date: Wed, 07 Jan 1998 11:43:50 -0800
From: Steve West <stevew@metafuse.com>
To: james@netmart.com, kevincou@microsoft.com, stevew@metafuse.com, iarbitma@costamesa.bozell.com
Subject: How to Configure Perl with IIS 4.0
Message-Id: <34B3DAF6.E9C985AE@metafuse.com>

For all you who are trying to run IIS 4.0 and perl here is what you have
to do to configure it to run properly on IIS 4.0.

I have outlined a two step process to get it to work...here goes

****** STEP 1.   CONFIGURE PERL TO WORK WITH IIS 4.0*****
Microsoft changed from having the script mappings in the registry to the
a
configuration in the service manager.  Now script mappings are changed
in the
default website properties.

Go to the default website, right mouse click on the properties for that
site....

then click on "Home Directory" tab
Go to the "Applications Settings" toward the bottom of the window...find

the "Configuration" button...the click on  it.  A new window called
script
mappings exists..you need to either create a new script mappings or edit
the old
one.

It should look like this

 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s

I had those set before in the registry...as you may have too...and MS
IIS 4.0
pulled the values out and capitalized the %S %S...that wont work..it
looked like
this

*** MICROSOFT PUT THIS THERE...IT WILL NOT WORK ***
 .pl      C:\PERL\BIN\PERL.EXE %S %S

*** YOU MUST CHANGE MAPPING TO LOOK LIKE THIS***
 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s



***** STEP 2.  CONFIGURE PERL TO WORK WITH STANDARD I/O *****

By default you cannot use standard I/O redirection with perl and IIS
4.0.

You have to configure this into the metabase.  Here is how you do it:
You need to run a command line from the:
"\winnt\system32\inetsrv\adminsamples" directory

When you get there type this on the command prompt

adsutil set w3svc/CreateCGIWithNewConsole TRUE

You may get an error becuase the .vbs is not set, just click on yes, and
retype the command if you get that error.

You will have to stop the default website, and restart it from the
internet service manager to make the changes.

NOTE:  If for some reason you cannot get the adsutil at the command
prompt, or you get unrecognized command, you may want to search for it
using the start menu, find.  Look on your system for "adsutil.vbs".  If
you still cannot find it, you perhaps did not install all the
samples...you may go to the Windows NT 4.0 Option pack setup from the
start menu and check to see if you can install the administration
samples.  I am not sure if the adsutil.vbs shipped in all cases, but
most of you will have it in your
"winnt\system32\inetsrv\adminsamples" directory.

I hope this note helps you guys and keeps you from having same trouble I
had.

Steve West







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

Date: 7 Jan 1998 19:07:05 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Lexical scope and embedded subroutines.
Message-Id: <690jop$9jm@news.service.uci.edu>

In article <68ulsg$amo@panix.com>, Clay Irving <clay@panix.com> wrote:
>>Here you'd better use
>>    &What_is_the_temp($temp);
>
>Just out of curiousity - Why? perlsub indicates:

Using & will also disable any prototype checking.  There are
other cases were & is actually mandatory (like indirect subroutine
calls).  Read more of perlsub.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: 7 Jan 1998 19:39:24 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Modularize non object code
Message-Id: <690llc$msa$1@lyra.csx.cam.ac.uk>

Barry G Reville <breville@uoguelph.ca> wrote:
>	I have written a non object perl program that works fine but I 
>would like to modularize it for maintainability and reusability.  There 
>are many subroutines - many that I use multiple times.  Some of these are 
>general utilities that I would like to keep all in one file and somehow 
>be able to call the subroutines like normal.
>	Is this possible, and if so how?

You probably want to use the Exporter mechanism.   See the examples in

     perldoc perlmod

and the Exporter documentation in

     perldoc Exporter


Mike Guy


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

Date: Wed, 7 Jan 1998 11:58:19 -0800
From: Paul Huard <huard@netrev.com>
Subject: Net::LDAPapi's ldap_get_values
Message-Id: <Pine.BSF.3.96.980107113514.8738D-100000@shell12.ba.best.com>

Hi,

I can't get ldap_get_values to generate any values and I'm hoping someone
can take a look at the code below and tell me what I'm doing wrong. I know
that the connection is successful because ldap_get_dn works fine.

# Example Search:
# working command line search: ldapsearch -b "o=acme,c=us" -h
# "ldap.abcgroup.acme.com" -p 389 "cn=abcgroup"
# abcgroup - dn: cn=abcgroup,o=acme,c=US

 	$groupDn = "abcgroup";
# 	@attrs = ("uniquemember"); # doesn't work
 	@attrs = (); # leaving this empty for ldap_search should provide
all attributes 	
	$filter = "(cn=$groupDn)";
	if
(ldap_search_s($ld,$BASEDN,LDAP_SCOPE_SUBTREE,$filter,\@attrs,1,$result)
!= LDAP_SUCCESS)
	{
         print "Error:  Unable to Search Directory.",p;
	   ldap_perror($ld,"ldap_search_s");
	   ldap_unbind($ld);
	   exit -1;
	}

      $ent = ldap_first_entry($ld,$result);
#	@values = ldap_get_values($ld,$ent,"uniquemember"); # doesn't work
#	@values = ldap_get_values($ld,$ent,"*");            # doesn't work
#	@values = ldap_get_values($ld,$ent);	          # won't compile
	@values = ldap_get_values($ld,$ent,"cn");           # doesn't work
	push(@values,"junk"); # just making sure the array is printing
properly

#  We only need the DN from the entry we matched.
	$dn = ldap_get_dn($ld,$ent); #works
	print "\nHere's the DN $dn\n"; # works
	print "Here's the result ($result) and the entry ($ent) and the
values\n";
	print @values;
	print ldap_get_values($ld,$ent,"cn");
}


TIA,
Paul



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

Date: Wed, 07 Jan 1998 14:45:57 -0600
From: Jay Jacobs <jjacobs@lach.net>
Subject: Perl on NT 3.51 for CGI?
Message-Id: <34B3E985.774F8A56@lach.net>

Hiya, 
  I've been trying to put a perl formmailler on NT 3.51.  I've gotten it
to function just fine on 4.0.  I think it is an issue with file
associations.  Has anyone experienced this?  Has anyone got it to work? 
I did install the latest version of Perl for Win32, and I can run apps
by invoking "perl.exe file.pl"  But the error message is something like
"file.pl is not a valid NT application" or something like that
indicating that it doesn't know what to do with it.  I've set up the
file associations through NT, and it works when I double click a .pl
file, but I have a feeling that the web server (ns enterprise) isn't
double clicking the .pl file, and is trying to run it as file.pl blah
blah at a command line type interface.  If anyone has experienced this
please let me know.

Another option we are exploring is to have the form be submitted to a
webserver at a different site (probably running unix) that can handle
the complexity that a perl script brings.

Thanks for anything,
Jay Jacobs
jjacobs@lach.net


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

Date: 7 Jan 1998 18:47:11 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Q: search matching "(" and ")"
Message-Id: <690ijf$65s$2@marina.cinenet.net>

Ilya Zakharevich (ilya@math.ohio-state.edu) wrote:
: [A complimentary Cc of this posting was sent to Craig Berry
: <cberry@cinenet.net>],
: who wrote in article <68ugfd$4kl$1@marina.cinenet.net>:
: > : Q: How can I  easily find  the matching parir for "(" and ")" for A1?
: > 
: > You can't do it 'easily' (at least accordning to my own 'easiness' 
: > metric).  Just to save you some pointless hacking, you can't do it for 
: > arbitrary levels of nesting using regexes
: 
: Yes you can with the latest RE engine, one of the tests in t/op/pat.t
: is doing exactly this.  But this is still not "easily" - though very
: quick.  To make it "easy" several other changes to RE engine should
: materialize first.

Wow...this rather blows my mind.  I'd always thought that "balanced pair
matching"  like this was beyond the scope of regexes by definition.  Can
you provide an example regex, useable under 5.004, which will match a
sequence of characters starting with '(' and ending with the balancing
')', for arbitrarily nested parens? 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Tue, 06 Jan 1998 23:29:19 +1100
From: Anthony David <adavid@netinfo.com.au>
To: craig@patchett.com
Subject: Re: Review of CGI/Perl book
Message-Id: <34B2239E.A53EE26A@netinfo.com.au>



Craig Patchett wrote:

> And while I'm at it, Perl 4 is far from dead. It lives on as a subset of
> Perl 5, one that is far more accessible to the beginning programmer than
> the whole set. It is elegant, concise, powerful, and has, on several
> occasions, made me want to write passionate fan letters to Larry. But it is
> also, above all else, extremely approachable and easy-to-learn (bar
> thenuances of regexes).

In my opinion it isn't the regexes, it's the overuse of typeglobbing and eval,
themessy use of subroutines and security concerns that makes the
continued promotion of Perl4 disheartening.

> The additional features offered by Perl 5 are an extension to the core of
> the language (read "Perl 4") and, in my opinion at least, should be treated

My view is that Perl 5 offers a simplification of the "core". My first use of
tie hashworked, my first CGI.pm program worked, my first DBI.pm program worked.

I was the first enjoyable programming experience I had had in a long time.
That was not my experience supporting first time Perl CGI programming,
though one can't take anecdotal evidence as solid proof. The following is a
brief and sad tale.

The site I support decided to Intranet-enable their COBOL programs. They
finally decided to go the Java route because it was a "professional programming

environment" after they spent a frustrating time trying to code up the Perl 4
examples out of the CGI programming books they found.

Perl 5.003 was installed with only the core modules. I had a limited exposure
to Perl a couple of years before but Perl 5 was the only dialect I have ever
taken seriously.
In fact, I was learning Perl in order to support them.
They would ask me what was wrong with their program and I would ask them
why all the subroutines had ampersands in from of them!

Every problem they had I would solve for them with a module. They became
disillusioned because they were struggling with the books that were suggesting
using utilities like h2ph and suchlike then questioning my competence
at installing Perl when I said "it's not there, don't use it, use Socket
instead".

While we are at it, call me a purist if you will, but I was disappointed at
Randall's
inclusion of dbmopen in the 2nd Llama when it is a mere facade over the
more intuitive tie function.

> Bottom line: Don't sell Perl short by forgetting what attracted you to it
> in the first place.
>

Isn't there a Buddhist parable about not carrying a boat around with youfor the
rest of your life, just because it got you across a raging river once.

Regards Anthony

--
Anthony David                      |     Opinions expressed ARE
Anthony David & Associates |     those of my employer




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

Date: 7 Jan 98 19:10:25 GMT
From: "Mike Noel" <noel@integrityonline.com>
Subject: Running  a perl script in the background on Windows(95/NT)
Message-Id: <01bd1b5d$f048e720$1512eecd@stephen>

Please forgive me if this is the wrong newsgroup.  My newserver doesn't
carry comp.lang.perl (but it carries c.l.p.misc...).

I've written a perl script on a Windows95/NT system that I would like to
run and have sit in the background.  The script itself does a bit of
processing, then sleeps for 5 minutes, over and over again.

I come from a UNIX background where this sort of thing is trivial but I
can't figure out how to do it in Windows.  Right now, when the script
starts, it seems to run through a DOS window.  As long as the script is
running the DOS window is on the screen (or minimized and on the taskbar). 
If I kill the DOS window the process quits.  I'd like to set up the script
so that it doesn't use the DOS window.  I don't want it to show up on the
taskbar.

>From looking at the task manager I see that Windows95/NT recognizes a
difference between applications and processes.  It seems that applications
have an associated window and processes don't.  So I guess I want to
convert my perl script from an application to a process.

How can I do this?

Thanks.

_M_
noel@integrityonline.com



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

Date: Wed, 7 Jan 1998 20:34:43 -0000
From: "Andy Spencer" <andys@nvisual.com>
Subject: Re: Running  a perl script in the background on Windows(95/NT)
Message-Id: <34b3e6c7.0@newsread1.dircon.co.uk>


Mike Noel wrote in message <01bd1b5d$f048e720$1512eecd@stephen>...
>Please forgive me if this is the wrong newsgroup.  My newserver doesn't
>carry comp.lang.perl (but it carries c.l.p.misc...).
>
>I've written a perl script on a Windows95/NT system that I would like to
>run and have sit in the background.  The script itself does a bit of
>processing, then sleeps for 5 minutes, over and over again.
>
>I come from a UNIX background where this sort of thing is trivial but I
>can't figure out how to do it in Windows.  Right now, when the script
>starts, it seems to run through a DOS window.  As long as the script is
>running the DOS window is on the screen (or minimized and on the taskbar).
>If I kill the DOS window the process quits.  I'd like to set up the script
>so that it doesn't use the DOS window.  I don't want it to show up on the
>taskbar.
>
>From looking at the task manager I see that Windows95/NT recognizes a
>difference between applications and processes.  It seems that applications
>have an associated window and processes don't.  So I guess I want to
>convert my perl script from an application to a process.
>
>How can I do this?
>
>Thanks.
>
>_M_
>noel@integrityonline.com
>

Try the SRVANY utility supplied in the WinNT Resource Kit, available from
the microsoft site.

You would use this to act as a stub for your perl script, effectivley
creating yourself an .pl NT service process.

Does not work on 95 (that I know of) as 95 uses a different mechanism to
achieve the same goal.

If I have time to dig the bits out, I'll mail them to you....

Regards
AndyS







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

Date: Wed, 07 Jan 1998 15:41:42 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
Message-Id: <pudge-0701981541430001@ppp-48.ts-1.kin.idt.net>

In article <19980107.134435.1y6.rnr.w164w@locutus.ofB.ORG>, Russell Schulz
<Russell_Schulz@locutus.ofB.ORG> wrote:

# pudge@pobox.com (Chris Nandor) writes:
# > I don't see what the difficulty is.
# > Programming is an empirical science.
# 
# try it, and see if it looked like it worked, and if it didn't, mess
# with it until it does, and then hope it always will...

Look, we say it works.  If you are intelligent enough to add seconds
together, you can test it yourself.  I don't know what more can be done.

As to the C runtime, Chip said it best.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Wed, 07 Jan 1998 12:43:29 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Storing A Text File Into A Variable -- How??
Message-Id: <34B3CCD1.5943C0BE@houston.Geco-Prakla.slb.com>

Tony K. Olsen wrote:
<snip>
>         # retrieve text now if it exists.
>         $comment_file = "e:\\pfe\\programs\\database\\" . $db_serial . "-"
> . $db_year;
>         open(IP, "<$comment_file") || die "cannot open the ",
> $comment_file, " file";
> 
>         while (<IP>) {
>                 print;
>         }
> 
>         this works fine and displays it to the screen.  What I would like
> is something along these lines:
> 
>         while (<IP>) {
>                 chop;
>                 $var = $_;
This is going to set $var to be the last valid line from IP only.  It
gets reset each time through the loop.

Two ways:

1.  $/ = undef;		#undefine the record seperator (normally \n)
    $var = <IP>;	#set $var equal to all lines from IP

2.  @var = <IP>;	#set @var array equal to all lines from IP

I think the second one looks cleaner, and is easier to follow, but....

Dave

>         }
> 
>         Then I could generate a perl file using the $var like such to
> display the comments already written to the file:
> 
> <TEXTAREA NAME="textdata" ROWS=15 COLS=69>
> $var
> </TEXTAREA>
> 
>         Confused and punch drunk with a newborn baby in the house.
> Replies and advice appreciated.  Cheers.

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
* Schlumberger Geco-Prakla   (281) 596-1434 (Office Number)            *
* 1325 S. Dairy Ashford      (281) 596-1807 (Fax)                      *
* Houston, TX 77077                                                    *
------------------------------------------------------------------------


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

Date: 7 Jan 1998 11:05:54 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Would yo explain the Perl "pack" command to me?
Message-Id: <690jmi$loe$1@shell3.ba.best.com>

In article <avm-0801981039090001@avm.vip.best.com>,
Anthony Mulligan <avm@best.com> wrote:
>learn to read the frigging man pages.

There's no need to be rude. The original poster said:


>#I read the man page, but still I don't get it. I an reading the llama
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And, indeed, for someone who's not a proficient programmer (or who has
never programmed in languages that use structures), what pack does is
definitely not intuitive. An understanding of what pack does and when
and how you'd use it is, I think, only really possible if you've ever
run across an instance where you'd need to use it. 

Perl has a number of features which can probably be safely ignored until
such time as you need them, and then, since you know what you're trying to
do, the man page makes a lot more sense. 

So, my advice to the original poster is to leave pack for right now and
come back to it later; it'll probably make more sense once you have some
more experience with Perl. And to Mr. Mulligan, my advice is that if a post
annoys you, don't respond to it. And if you're going to flame someone for
not reading the man page, at least make sure they haven't read the man
page first.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Wed, 07 Jan 1998 12:15:03 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Would yo explain the Perl "pack" command to me?
Message-Id: <34B3D425.C5DD121@5sigma.com>

Hey, learn to read the posts!  The user already said he read
the man pages.  He would like some additional explanation.

	-joseph
	 http://www.effectiveperl.com

Anthony Mulligan wrote:
> 
> learn to read the frigging man pages.
> from the command line type the following
> 
> perldoc -f pack


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

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 1596
**************************************

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