[19184] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1379 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 25 18:10:46 2001

Date: Wed, 25 Jul 2001 15:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996099014-v10-i1379@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 25 Jul 2001     Volume: 10 Number: 1379

Today's topics:
        redirect perl script to another cgi/bin? <dw@dw.com>
    Re: Regex help <goldbb2@earthlink.net>
        Regexp Question (Tracy Gentry)
    Re: Request Peformance Advice <goldbb2@earthlink.net>
    Re: Self-Searchable Perl documention - Extremely Useful <dbe@wgn.net>
        Setting UUID's within Cookies?  Scripts? <pgl16119@glaxowellcome.com>
        Single char formats => core dump?!? <steve@endrun.com>
    Re: sizes of strings in Activeperl ? <krahnj@acm.org>
    Re: sprintf <curtish@ourtownusa.net>
    Re: sprintf <godzilla@stomp.stomp.tokyo>
    Re: sprintf <cpryce@pryce.net>
        Strange Side Effects Seemingly from open(PIPE, "cmd 2>& (Chris Mollo)
    Re: Substitute _last_ occurrece in string? <krahnj@acm.org>
    Re: Substitute _last_ occurrece in string? <weiss@kung.foo.at>
    Re: Substitute _last_ occurrece in string? <godzilla@stomp.stomp.tokyo>
        symbolic links are plain old files? <kirbyr@ucar.edu>
    Re: symbolic links are plain old files? <krahnj@acm.org>
        What am I doing wrong with this command line ? (Ken Laird)
    Re: What am I doing wrong with this command line ? <mbudash@sonic.net>
    Re: What am I doing wrong with this command line ? (Craig Berry)
    Re: Where are the values stored? (Eric Bohlman)
        Win32/Apache/Mod_perl problem <bmaring@gte.net>
    Re: Win32/Apache/Mod_perl problem <randy@theoryx5.uwinnipeg.ca>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 25 Jul 2001 12:40:58 -0600
From: "dw" <dw@dw.com>
Subject: redirect perl script to another cgi/bin?
Message-Id: <9jn3o1$8ob$1@centralnews1.Central.Sun.COM>

If I do not have access to a local  cgi/bin and want to use perl on some web
pages can I define a remote cgi/bin?  if so how?

thx




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

Date: Wed, 25 Jul 2001 16:56:40 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Regex help
Message-Id: <3B5F3288.91790DA0@earthlink.net>

Ed Napier wrote:
> 
> I'm trying to extract "running" from the html code below. My regex is
> just not cutting it.  Can someone help?
> 
> Thanks,
> Ed
> 
> my $txt = '<html> <head> <title>LCF Daemon</title></title> <!<body
[snip]
>  $txt =~ /Status\s*\:\s*<[\w\s]+>(\w+)/g;
>  #$txt =~ /(<[\w\s]+>)/;
>  $status = $1;
> print "Status: $status\n";
>  $txt =~ /Status\: [^<]*/; print("$&\n");

How about:
my ($statusline) = $txt =~ m[<br>( Status .*?)<br>]s;
my ($status) = $statusline =~ m[>(\w+)<];
print "Status: $status\n";

-- 
I need more taglines. This one is getting old.


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

Date: 25 Jul 2001 13:18:58 -0700
From: tracy_gentry@yahoo.com (Tracy Gentry)
Subject: Regexp Question
Message-Id: <9d356f64.0107251218.96df6f3@posting.google.com>

I'm using the gnu.regex package in a Java environment. This may not be
the most appropriate newsgroup to post to, but after searching all day
for an answer this group seems to have the most discussion regarding
regular expressions.

I'm attempting to use reg expressions as masks to input fields. The
masks must match any subset of characters that are contained in a mask
(validation is done as the user types.) So a date mask, for example,
has to match on 2, 02, 2/, 2/21, 2/21/2, 2/21/2001, etc. Here's a
snippet of the expression I'm using for date validation:

 ...|"(0{0,1}2/29/20[02468][48]{0,1})|"|...

This line validates a subset of the valid leap years for this century.
As coded, 02/29/200 and 02/29/2004 will match, but 02/29/20 won't and
I want it to. Is there a way to denote a character as optional if no
other characters appear after it, but required if more characters
follow? Or maybe some sort of grouping?

Also, the web pages I've seen on regexp are kind of sparce. Does
anyone know of a good resource on the web?

Thanks,
Tracy Gentry


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

Date: Wed, 25 Jul 2001 17:43:35 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Request Peformance Advice
Message-Id: <3B5F3D87.1992972C@earthlink.net>

Buck Turgidson wrote:
> 
> I wrote my first real Perl with a lot if input from this group.  It
> works great, but is very slow.  I have a file containing database
> column names that are changing and I need to update a directory of
> hundreds of SQL modules and change the column names.
> 
> I read the conversion mappings from the file into an array, and for
> each file in a directory, I apply each regex derived from the mappings
> array (about 60) to each line.  It is very, very slow.  I would like
> to speed it up a bit, and was hoping someone could suggest some
> efficiency improvements.

#!/usr/bin/perl -w
use strict; # always use warnings and strict.

my @suffixes = qw(sql);
my ($convertsions, $sourcedir, $destdir) = qw(
    c:\mydir\convert.txt c:\temp\sqlin c:\temp\sqlout);

my %convert_to = do {
    open( my $conv_fh, "<", $conversions )
        or die "Could not open $conversions for reading: $!\n";
    map {
        chomp;
        my ( $key, $val ) = split /=/;
        lc $key => lc $val,
        uc $key => uc $val,
        ucfirst lc $key => ucfirst lc $val;
    } <$conv_fh>
};
my $convert_from = join "|", reverse sort keys %convert_to;

foreach my $file (do {
    opendir my $dh, $sourcedir
        or die "Could not opendir $sourcedir: $!\n";
    local $" = "|";
    grep /\.(@suffixes)$/i, readdir $dh;
}) {
    my ($if, $of) = ("$sourcedir/$file", "$destdir/$file");

    next unless -f $if; # plain files only

    print $if, "\n", $of, "\n";

    open( my $ifh, "<", $if )
        or die "Could not open $if for reading: $!\n";
    open( my $ofh, ">", $of )
        or die "Could not open $of for writing: $!\n";

    my $stdout = select $ofh;
    while( <$ifh> ) {
        s/\b($convert_from)\b/$convert_to{$1}/g;
        print;
    }
    select $stdout;

    close( $ofh )
        or die "Could not close $of after writing: $!\n";
}
__END__

-- 
I need more taglines. This one is getting old.


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

Date: Wed, 25 Jul 2001 14:30:07 -0700
From: "$Bill Luebkert" <dbe@wgn.net>
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <3B5F3A5F.B524CA78@wgn.net>

Jeff Zucker wrote:
> 
> John Holdsworth wrote:
> >
> > If you have ActiveState's "Active Perl" installed on a PC along
> > with Perl Documentation you can make it searchable without having
> > to run a Web server or be connected to the internet by
> 
> a) using the built-in "find" function of windoze: start menu / find /
> files or folders / containing text ...
> 
> or
> 
> b) at the command line with standard switches to the perldoc command or
> with grep

I prefer vi.  I just combined all of the pods into one text file and use 
vi to flip to it when I need some reference material.

Example script on my Webjump site for pre 5.6 version (needs updating for 
5.6 which I'm not on yet).
-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   Mailto:dbe@todbe.com 
  / ) /--<  o // //      http://dbecoll.webjump.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/


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

Date: 25 Jul 2001 18:54:57 GMT
From: "pgl16119" <pgl16119@glaxowellcome.com>
Subject: Setting UUID's within Cookies?  Scripts?
Message-Id: <01c1153a$f315c060$20a03398@us0098988>

where can i obtain code to generate UUID's using perl and place this value
in a cookie?



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

Date: Wed, 25 Jul 2001 20:16:40 GMT
From: Steve Roehling <steve@endrun.com>
Subject: Single char formats => core dump?!?
Message-Id: <steve-AD101C.13024725072001@localhost>

Hello Everyone,

I'm doing some report formatting which needs to have single character 
columns, with no spaces in between columns. I'm creating some formats on 
the fly to do this, and the problem is, these formats cause Perl to core 
dump. Here's an example format which causes the problem:

format STDOUT=
^^^^^^^
$a{0},$a{1},$a{2},$a{3},$a{4},$a{5},$a{6}
 .

I wrote a simple sript to reproduce the problem:

======== 

#!/usr/local/bin/perl
sub DumpBits()
{
   my($numFields,$fieldPic) = @_;

   print STDERR "Dump bits: num fields = $numFields, field pic = 
$fieldPic\n";

   # initialize column values to all 1's
   for ($i = 0; $i < $numFields; $i++)
   {
      $a{$i} = "1";
   }
   $format = "format STDOUT= \n";

   # make a picture line
   for($i = 0; $i < $numFields; $i++) { $format .= $fieldPic; } 
   $format .= "\n";

   # make a format line for the values
   for($i = 0; $i < $numFields; $i++) { $format .= '$a{'.$i.'},'; } 
   chop $format; $format .= "\n";
   $format.=".\n";

   print $format;
   print STDERR "\n";
   eval $format;
   write;
}

for($i = 0; $i < 500; $i++)
{
   print STDERR "Dumping $i columns of output\n";
   &DumpBits($i,"^");
}

=========

The problem seems to trigger with varying number of columns, depending 
on which system I run it on. The following occurs in ver. 5.6.0 on my 
RedHat 7.1 system.

111111
Dumping 7 columns of output
Dump bits: num fields = 7, field pic = ^
format STDOUT=
^^^^^^^
$a{0},$a{1},$a{2},$a{3},$a{4},$a{5},$a{6}
 .

Segmentation fault (core dumped)

I recompiled Perl 5.6.0 in debug mode under Solaris, and here's what I 
get:

111
Dumping 4 columns of output
Dump bits: num fields = 4, field pic = ^
format STDOUT=
^^^^
$a{0},$a{1},$a{2},$a{3}
 .

assertion botched (chunk's tail overwrite?): *((char *)((caddr_t)ovp + 
nbytes -
sizeof (unsigned int) + i)) == 0x55
Abort (core dumped)


Hmmm... Is something wrong? Maybe there's a workaround?


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

Date: Wed, 25 Jul 2001 19:59:17 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: sizes of strings in Activeperl ?
Message-Id: <3B5F25A4.F062A91A@acm.org>

Jan wrote:
> 
> "John W. Krahn" <krahnj@acm.org> wrote in message news:<3B5DCB57.DD1A45B8@acm.org>...
> > Jan wrote:
> > >
> > > Strange one here.  I use a perl script (ActivePerl) to do some checks
> > > on our clearcase vobs.  At a certain moment, I start loading a string
> > > variable with the output of a command-line which generates a huge
> > > output (4 to 5 meg).  Afterwards I split this on \n's to end up with a
> > > huge array, which I start investigating for problems.  I do this
> > > several times with the same string and array.
> >
> > It might be better to read the output a line at a time instead:
> >
> > open CL, "command-line |" or die "Can't open pipe from command-line:
> > $!";
> > while ( <CL> ) {
> >     # do something with line of data
> >     }
> > close CL or die "Can't close pipe from command-line: $!";
> 
> This was the correct solution...  No crashes anymore.  Thanks !
> 
> btw : don't know what made it fail, but it wasn't a shortage of memory
> since I monitored free memspace during the process.

As someone who doesn't use MS products I _might_ say it's your operating
system. ;-)




John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 25 Jul 2001 13:08:20 -0500
From: "Curtis Hawthorne" <curtish@ourtownusa.net>
Subject: Re: sprintf
Message-Id: <fVD77.65$1K.573@newsfeed.slurp.net>

Well, okay.  That's what I meant. :-)

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3B5F09BB.25AAA9D1@stomp.stomp.tokyo...
> Curtis Hawthorne wrote:
>
> > Edward Little Titan/SRC x4621 wrote:
>
> > > How can I print a floating point number with leading zeros?
>
>
> (snipped)
>
>
> > To print leading 0's, you'll need something like sprint("%08.3f",
$number);
> > where 8 is the total number of digits in the output (including the
decimal
> > point) and 3 is the number of digits behind the decimal.
>
>
> Use of  sprint("%08.3f", $number);  will cause a script
> to crash by calling a non-existent sub-routine.
>
> Use of  sprintf("%08.3f", $number);  will not lead pad a zero.
>
>
>
> $number = sprintf("%08.3f", $number);
> print $number;
>
>
> Godzilla!




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

Date: Wed, 25 Jul 2001 11:33:38 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: sprintf
Message-Id: <3B5F1102.B067F94F@stomp.stomp.tokyo>

Edward Little Titan/SRC x4621 wrote:
 
> How can I print a floating point number with leading zeros?
 
(snipped)

Others have provided good answers. However, I am curious
why you would lead zero pad a whole number or a decimal
number which is whole / decimal, such as 123.4 as an 
example. For a decimal number, .4 , this makes sense
as in 0.4 to indicate whole number accuracy.

Use of a zero padding is usually reserved for indication
of accuracy of decimal places, this is, a trailing zero.
Perhaps you are doing this for a database format.

The quickest way to lead zero pad is,

print "0$number";

or

$number = "0$number";

However, a plus sign or minus sign or other number related
characters would be a problem, if included in variable $number.

Nonetheless, be careful about numbers returned in
scientific notation. Simple testing will disclose
why this is a problem.


Godzilla!


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

Date: Wed, 25 Jul 2001 14:19:55 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: sprintf
Message-Id: <EXE77.26337$B7.4114334@ruti.visi.com>


"Edward Little Titan/SRC x4621" <strawman@plexi.com> wrote in message
news:3B5EF418.8011B9DD@plexi.com...
>
>
>
> How can I print a floating point number with leading zeros?
>
> I've tried:
>
> $number = sprintf("%2.3f",$number);
> print "$number\n";
>
> with no luck. I've also tried:
>
> $number = sprintf("%02.3f",$number);


This tutorial might help:
http://www.perlmonks.org/index.pl?node=Using%20%28s%29printf%28%29&lastnode_
id=954

cp




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

Date: 25 Jul 2001 12:28:38 -0700
From: cmollo@checkfree.com (Chris Mollo)
Subject: Strange Side Effects Seemingly from open(PIPE, "cmd 2>&1 |")
Message-Id: <2f7b15d1.0107251128.4bfd96e4@posting.google.com>

Using Perl version 5.005_03 on AIX.

Using the well-known method of capturing stdout & stderr
from an application that is launched via a Perl script:

   $pid = open(APPL, "$app 2>&1 |") or die...;
   while (<APPL>)
   {
     :
     :
   }
   close(APPL) or print...;

Everything is fine and dandy as long as $app terminates
with a zero return status.  However, if $app terminates
with a non-zero return status, I'm seeing "strange"
behavior subsequently.

For example, say the above code fragment is in a loop
that is executed 4 times, and there is a string matching
operation, e.g.

   if (m/account number/)
   { ....}

inside the while loop above.  If $app terminates with a
non-zero return status on the second time it is run,
then the string matching operation fails on the third
& fourth $app is run (and finishes with a zero return
status).  By fails, I mean the m operator never returns
a true value when it should have.

Anybody ever seen something like this before?

TIA!!

Chris


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

Date: Wed, 25 Jul 2001 20:14:56 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Substitute _last_ occurrece in string?
Message-Id: <3B5F294F.2F5A00E8@acm.org>

Paul Moloney wrote:
> 
> How can I substitute the last occurence of a certain text string within
> a string?
> 
> For instance, if I have the string $string = "abcdefghiajkl", I'd
> like to be able to substitute the last "a" in $string with null so that
> I'm returned "abcdefghijkl".
> 
> Is there an argument I can pass to the usual substitute
> operator? For example:
> 
> $string =~ s/a//<ARGUMENT>
> 
> or is there a more lengthy way to do it? Thanks,

You can use the fact that regular expressions are greedy.

$string =~ s/(.*)a/$1/;

Or you can use the normal string functions

substr( $string, rindex( $string, 'a' ), 1 ) = '';



John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 25 Jul 2001 22:57:16 +0200
From: "Stefan Weiss" <weiss@kung.foo.at>
Subject: Re: Substitute _last_ occurrece in string?
Message-Id: <3b5f31f9$1@e-post.inode.at>

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:

> Michael Budash wrote:
 ..
> > just for fun, you could also take advantage of the RE engine's right to
> > left operation:
>
> > $rev = reverse($string);
> > $rev =~ s/a//;
> > $string = reverse($rev);

[ Michael: This is the first thing that came to my mind when I read
the question. I'm actually quite fond of Sexegers [1], but then I
figured the lookahead assertion would be cleaner in this case. ]

> Will this work correctly for a single instance of
> letter "a" within string? This is, a string only
> contains one letter a and parameters are to remove
> the "last instance" of this letter.

It will remove the last instance of the letter 'a', which also
happens to be the only one. Why didn't you try it yourself?

BTW, the "solution" you posted elsewhere in this thread will _not_
work in this case. I find it amusing that you think it inefficient to
"invoke a memory wasteful regex engine" (which would solve the problem
in no more than 24 characters), then go ahead and propose an 8-liner
that reads like BASIC, does not even work correctly, and would only
waste the OP's time and patience. Efficient?

> Think on this.

Indeed.


cheers,
stefan


[1] http://www.crusoe.net/~jeffp/sexeger/sexeger.html





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

Date: Wed, 25 Jul 2001 14:07:40 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Substitute _last_ occurrece in string?
Message-Id: <3B5F351C.68095AFC@stomp.stomp.tokyo>

Stefan Weiss wrote:
 
> Godzilla! wrote:
> > Michael Budash wrote:

(snipped)

> > > just for fun, you could also take advantage of the RE engine's right to
> > > left operation:

> > > $rev = reverse($string);
> > > $rev =~ s/a//;
> > > $string = reverse($rev);
 
> > Will this work correctly for a single instance of
> > letter "a" within string? This is, a string only
> > contains one letter a and parameters are to remove
> > the "last instance" of this letter.
 
> It will remove the last instance of the letter 'a', which also
> happens to be the only one. Why didn't you try it yourself?


Besides being a lame brain troll, it is clear you are yet another
proud graduate of the Sears, Roebuck & Co. Academy Of Language Arts.


Godzilla!


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

Date: Wed, 25 Jul 2001 11:07:53 -0600
From: Rob Kirby <kirbyr@ucar.edu>
Subject: symbolic links are plain old files?
Message-Id: <3B5EFCE9.93615AC1@ucar.edu>

It appears that when I use a -f test in Perl, that I 
also get symbolic links. Is this working as designed? I would 
think that a symbolic link should not be considered a plain old file.

Thanks,

-- 
Rob Kirby - [mailto:kirbyr@ucar.edu][http://www.ncar.ucar.edu]
--
"Real knowledge is to know the extent of one's ignorance." Confucius


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

Date: Wed, 25 Jul 2001 20:42:49 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: symbolic links are plain old files?
Message-Id: <3B5F2F81.2015CEAE@acm.org>

Rob Kirby wrote:
> 
> It appears that when I use a -f test in Perl, that I
> also get symbolic links. Is this working as designed? I would
> think that a symbolic link should not be considered a plain old file.

-f is testing the file that the symbolic link is pointing to not the
link itself.

perldoc -f stat
perldoc -f lstat



John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 25 Jul 2001 20:43:07 GMT
From: kenlaird@yahoo.com (Ken Laird)
Subject: What am I doing wrong with this command line ?
Message-Id: <vbG77.111898$E4.3052502@amsnews02.chello.com>

ls -la

file1
file2
file3 
file4


I'd like to get the next line if /file2/ matches.

So I'm trying something like this

perl -e 'for (`ls -la`) {next if /file2/;print}'

but it doesn't work.

I tried with shift instead of next , but doesn't work either.

What am I doing wrong?


Thanks in advance for any suggestions.

Ken Laird



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

Date: Wed, 25 Jul 2001 21:13:56 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: What am I doing wrong with this command line ?
Message-Id: <mbudash-15DF6A.14135725072001@news.sonic.net>

In article <vbG77.111898$E4.3052502@amsnews02.chello.com>, 
kenlaird@yahoo.com (Ken Laird) wrote:

> ls -la
> 
> file1
> file2
> file3 
> file4
> 
> I'd like to get the next line if /file2/ matches.
> 
> So I'm trying something like this
> 
> perl -e 'for (`ls -la`) {next if /file2/;print}'
> 
> but it doesn't work.
> 
> I tried with shift instead of next , but doesn't work either.
> 
> What am I doing wrong?
> 
> Thanks in advance for any suggestions.
> 
> Ken Laird
> 

one way:

for (`ls -la`) {
 if ($prev =~ /file2/) {
  print;
  last;
 }
 $prev = $_;
}

i leave the variable scoping (my, local, etc.) to you... of course, 
'thefile21' matches 'file2', so look out for that. also, if there is no 
name after the match, nothing will print.

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Wed, 25 Jul 2001 21:35:45 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What am I doing wrong with this command line ?
Message-Id: <tluethm8e2mrb2@corp.supernews.com>

Ken Laird (kenlaird@yahoo.com) wrote:
: ls -la
: 
: file1
: file2
: file3 
: file4
: 
: I'd like to get the next line if /file2/ matches.

So in this case you'd want 'file3', right?

: So I'm trying something like this
: 
: perl -e 'for (`ls -la`) {next if /file2/;print}'
: 
: but it doesn't work.

How about

  ls -al | perl -ne 'print scalar <>, break if /file2/'

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Brute force done fast enough looks slick."
   |             - William Purves


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

Date: 25 Jul 2001 18:50:57 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Where are the values stored?
Message-Id: <9jn4eh$3qj$1@bob.news.rcn.net>

Jonas Nilsson <nospam.jonni@ifm.liu.se> wrote:
> Try this:

> use Data::Dumper;
> my %hash;
> $hash{'A'} = "First value";
> print Dumper(\%hash);
> $hash{'A'}->{'B'} = "Second value";
> print Dumper(\%hash);
> print $hash{'A'}->{'B'};

> RESULT:
> $VAR1 = {
>           'A' => 'First value'
>         };
> $VAR1 = {
>           'A' => 'First value'
>         };
> Second value

> Where is the value "Second value" shown in the output stored? It isn't in
> %hash as shown by Dumper. Still it appears in the printout.

>  I know that use strict; tells you something like: Can't use string ("First
> value") as a HASH ref while "strict refs" in use at D:\Slask\clpm002.pl line
> 6.

It's as the message says.  $hash{A} contains the literal string "First
value" which is used as a symbolic reference to a hash whose name is what
the symbol table would contain if you could actually use a variable name
called "%First value".  That hash has one key, B, whose value is "Second
value".  If you had written "Firstvalue" without a space, you'd have 
created a hash variable whose name you could actually use, and you'd find 
that $Firstvalue{B} was "Second value".



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

Date: Wed, 25 Jul 2001 19:34:21 GMT
From: "Blayne Maring" <bmaring@gte.net>
Subject: Win32/Apache/Mod_perl problem
Message-Id: <1bF77.293$v%.160517@dfiatx1-snr1.gtei.net>

I have just installed the latest bundle perl-win32-bin-0.7.exe,
expat_win32.dll using configure-apache from http://savage.net.au.  Apache
starts fine and the default page and html pages dispay on the browser.
However, when I attempt to use a cgi-bin file, I get a server error with the
message "couldn't spawn child process"

Here is a simple page that fails:
#!d:/perl/bin
$time=localtime;
print "<html><head><title>My Home</title></head>",
 "<body bgcolor=yellow>",
 "<p>",
 "<h3><font face='arial' color='blue' size='5'>This is my home
page</font></h3>",
 "<br><br>",
 "The time is now $time",
 "<hr>",
 <img src='apache_pb.gif'>,
 "</p>",
 "</html>";

Any suggestions?




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

Date: 25 Jul 2001 20:18:47 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Win32/Apache/Mod_perl problem
Message-Id: <9jn9j7$bnd$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, Blayne Maring <bmaring@gte.net> wrote:
> I have just installed the latest bundle perl-win32-bin-0.7.exe,
> expat_win32.dll using configure-apache from http://savage.net.au.  Apache
> starts fine and the default page and html pages dispay on the browser.
> However, when I attempt to use a cgi-bin file, I get a server error with the
> message "couldn't spawn child process"

> Here is a simple page that fails:
> #!d:/perl/bin
[ ... ]

Try the first line of your script as

#!d:/perl/bin/perl.exe

assuming perl.exe is under d:/perl/bin.

best regards,
randy kobes


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.announce, send your article to
clpa@perl.com.

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

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


------------------------------
End of Perl-Users Digest V10 Issue 1379
***************************************


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