[8174] in Perl-Users-Digest
Perl-Users Digest, Issue: 1792 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 2 20:17:32 1998
Date: Mon, 2 Feb 98 17:00:25 -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 Mon, 2 Feb 1998 Volume: 8 Number: 1792
Today's topics:
(no subject) <dwu@svcam.amd.com>
Re: (no subject) <dwu@svcam.amd.com>
Re: (no subject) <dwu@svcam.amd.com>
Re: A regex problem <*@qz.to>
Re: A regex problem (Craig Berry)
Re: Error with analysis of system () return value on Pe (Michael Wang)
Re: Error with analysis of system () return value on Pe (Chip Salzenberg)
Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to <jhi@alpha.hut.fi>
Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to (Chip Salzenberg)
Help Wanted: Parsing data from oddly formatted files (Terry Bunch)
How do I post to cgi from PERL script? <jaywhite@erols.com>
Re: How do I post to cgi from PERL script? (Chip Salzenberg)
How Do I Tell Whether a Key Is Valid for an Associative (Kevin M Simonson)
Re: How Do I Tell Whether a Key Is Valid for an Associa (Steve Linberg)
Re: How Do I Tell Whether a Key Is Valid for an Associa (Chip Salzenberg)
How to search for control characters ... <shiva001@tc.umn.edu>
Is There a Way to Switch the case Sensitivity of Patter (Kevin M Simonson)
loading images (Edward Yeh)
Re: Modifying a file on another Server (Chip Salzenberg)
Re: Multi-line blocks of text (Tad McClellan)
Re: Multi-line blocks of text <dboorstein@shopcfn.com>
Re: Multi-line blocks of text <*@qz.to>
Re: Multi-line blocks of text (Tad McClellan)
Problems compile PERL/DBD (Jason McLain)
Re: Public Response to Private Flame (albeit machine-ge (soren a.)
Re: recursive regex? (Ilya Zakharevich)
Re: Suggestions on my New Shopping Cart System (Jeff Yoak)
tie DB_File timing problem <james@juno.physast.uga.edu>
Where's a DBD-mSQL Module? (Roy S. Rapoport)
Re: White Hats and Black (soren a.)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 02 Feb 1998 16:14:52 -0600
From: CS44 Personel <dwu@svcam.amd.com>
Subject: (no subject)
Message-Id: <34D6455C.638F@svcam.amd.com>
I'm reading in a file from one location on my unix system
And printing the contents to another location. Heres my code.
open (guesthandle , ">>usr/printtwo.html");
open (guesthandle , "usr/printfrom.log");
while (<guesthandle3>) {
print guesthandle2;
(assumed location for needed instruction)
}
Anyway I want to save the last line printed form hte file
printfrom.log
I have tried @a = @ARGV;
and then print @a at the end of the program and a few other methods
but nothing has worked so far.
If anyone can provide help it would be greatly appreciated.
Kimbrough Gray
kigray@cs.utexas.edu
------------------------------
Date: Mon, 02 Feb 1998 16:56:35 -0600
From: CS44 Personel <dwu@svcam.amd.com>
Subject: Re: (no subject)
Message-Id: <34D64F23.1CB1@svcam.amd.com>
ignore this message
I didnt see the responses to my first one
------------------------------
Date: Mon, 02 Feb 1998 17:20:41 -0600
From: CS44 Personel <dwu@svcam.amd.com>
Subject: Re: (no subject)
Message-Id: <34D654C9.32B1@svcam.amd.com>
ignore this message
I didnt see the previous replies
------------------------------
Date: 3 Feb 1998 00:08:15 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: A regex problem
Message-Id: <qz$9802021846@qz.little-neck.ny.us>
Kari Marttila <Kari.Marttila.@tietogroup.com> wrote:
> Is there a way to remove certain tags inside another tags? E.g.
You mean remove tags from certain blocks.
> <H3>Nok aat <p>esit le <p>na <p>rean <p></H3>No<p> <H3> asdf <p> </H3>
> =>
> <H3>Nok aat esit le na rean </H3>No<p> <H3> asdf </H3>
>
> In this example I wanted to remove all "<p>" tags only if they were
> inside a string delimited by "<H3>..</H3>" tags.
A crude way:
#!/usr/bin/perl -w
$_ = <<'SAMPLE';
<H3>Nok aat <p>esit le <p>na <p>rean <p></H3>No<p> <H3> asdf <p> </H3>
SAMPLE
s; <H3> # Start
( # capture
(?: # group
[^<]+ # not a start of a tag
| # or
< # a <
(?! # not followed by
/H3> # an H3 block close
) #
)+ # at least one of the group
) # end of capture
</H3> # end of block
; # substitute
($a = $1, # temporary variable
$a =~ s:<p>::gi, # remove <p>'s from it
"<H3>$a</H3>") # replacement text
;xige; # /x extended; /i case insensitve;
# /g global; /e eval replacement part
print
__END__
:r! perl -x %
<H3>Nok aat esit le na rean </H3>No<p> <H3> asdf </H3>
Elijah
------
fixing it to work for arbitrary correct HTML left as an exercise for the reader
------------------------------
Date: 3 Feb 1998 00:03:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: A regex problem
Message-Id: <6b5mss$211$1@marina.cinenet.net>
Kari Marttila (Kari.Marttila.@tietogroup.com) wrote:
: Is there a way to remove certain tags inside another tags? E.g.
:
: <H3>Nok aat <p>esit le <p>na <p>rean <p></H3>No<p> <H3> asdf <p> </H3>
: =>
: <H3>Nok aat esit le na rean </H3>No<p> <H3> asdf </H3>
:
: In this example I wanted to remove all "<p>" tags only if they were
: inside a string delimited by "<H3>..</H3>" tags.
:
: I have tried several ways without success.
This gets the job done in the absence of pathological cases (nested tags,
for example):
#!/usr/bin/perl -w
use strict;
my $str = '<H3>Nok aat <p>esit le <p>na <p>rean <p>' .
'</H3>No<p> <H3> asdf <p> </H3>';
$str =~ s!<H3>(.*?)</H3>!'<H3>'.&killp($1).'</H3>'!ge;
print "$str\n";
sub killp
{
my $text = shift;
$text =~ s/<p>//g;
$text;
}
Hope this helps!
---------------------------------------------------------------------
| 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: 2 Feb 1998 22:50:01 GMT
From: mwang@alhena.ibk.ml.com (Michael Wang)
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <6b5iip$9nm$1@news.ml.com>
John Porter <jdporter@min.net> wrote:
>Michael Wang wrote:
>>
>> I believe the example analyzing the return value of system()
>> on Perl book page 230 is wrong.
>
>I certainly don't blame you for being confused. But you're wrong.
John,
I certainly don't blame you for being confused. But what you said
below is in complete agreement as what I posted, which is in
disagreement with Perl book page 230. Thanks.
>The return value is weird bitmasked value. The upper byte is the
>exit status of the child, which it passed to its exit() call.
>The lower byte contains the number of the signal which hit the child
>-- zero, if no signal. Also, the high bit of the low byte is set
>if the child dumped core. Generally, the high byte is valid only if
>the low byte is 0.
>
>So if the return value was 0x88, that's 0x0088; the low byte is not
>zero, so ignore the high byte. You can see that the high bit (of
>the low byte) is set -- that means the child dumped core. Mask
>away that bit, and you have 8. This is the signal number.
>Look up this number in man -s 5 signal (e.g.) and you find SIGFPE:
>Floating-point exception. (You know it's divide by zero.)
>
>hth,
>John Porter
------------------------------
Date: Mon, 02 Feb 1998 23:37:03 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <6b5lee$pda$1@cyprus.atlantic.net>
According to jdporter@min.net:
>So if the return value was 0x88, that's 0x0088; the low byte is not
>zero, so ignore the high byte.
You have that backwards, I'm afraid. Check the *high* byte first.
If it's zero, then the program exited normally, and the low byte
is the exit code. If the high byte isn't zero, then it represents
the reason why the program died -- typically a signal number.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 02 Feb 1998 23:54:40 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to Browser from Script)
Message-Id: <oeeyaztbrkv.fsf@alpha.hut.fi>
chip@mail.atlantic.net (Chip Salzenberg) writes:
>
> According to Scott Kelley <jsk2@axe.humboldt.edu>:
> >--------------msDFB546772F4DBF93B78B351F
>
> No answers for MIMEs.
You could whiten your face and mime to your monitor?
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: Mon, 02 Feb 1998 23:09:22 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to Browser from Script)
Message-Id: <6b5jqn$pbi$1@cyprus.atlantic.net>
According to Jarkko Hietaniemi <jhi@alpha.hut.fi>:
>chip@mail.atlantic.net (Chip Salzenberg) writes:
>> According to Scott Kelley <jsk2@axe.humboldt.edu>:
>> >--------------msDFB546772F4DBF93B78B351F
>>
>> No answers for MIMEs.
>
>You could whiten your face and mime to your monitor?
My face paled and I gesticulated mutely. Does that count?
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Mon, 02 Feb 1998 16:11:38 -0600
From: riddler@atmnet.net (Terry Bunch)
Subject: Help Wanted: Parsing data from oddly formatted files
Message-Id: <886456819.1468071937@dejanews.com>
Hello,
I have around 300 small ascii files that I need to parse some data out of
and I am not quite sure how to go about this. The files do not all
contain the same fields, but they need to populate the same html
template. The other problem I have is that the field names and data
fields are on seperate lines with a blank line seperating them.
What I need is the the parsing section of the code to be able to do the
following:
1. Find the field names if they exist and match the data on the line
below the field name in the pair.
2. Report null as the data for the fields missing input
3. Process this on each file, one after the other.
example of file:
field name
data
field name
data
data
The data portion on some of the fields is multiple lines.
If anyone can help with this problem, please reply or send me email
direct at riddler@atmnet.net
If anyone wants a fee for creating this script, please contact me
directly to discuss details.
Thank you all in advance
Terry Bunch
Alchemy Metal Net
http://www.atmnet.net/~riddler/alchemy/
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 2 Feb 1998 18:25:06 -0500
From: "Jay White" <jaywhite@erols.com>
Subject: How do I post to cgi from PERL script?
Message-Id: <6b5jeu$ihf$1@winter.news.erols.com>
How do I do the equivalent of an HTML post to a cgi script on another server
from my PERL cgi?
I want my PERL script to do this:
<form method="POST" action="http://www.otherdomain.com/cgi-bin/script.cgi">
<input type="hidden" name="reqtype" value="secure">
<input type="hidden" name="account" value="7588105">
------------------------------
Date: Tue, 03 Feb 1998 00:31:06 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: How do I post to cgi from PERL script?
Message-Id: <6b5ojv$phr$1@cyprus.atlantic.net>
According to "Jay White" <jaywhite@erols.com>:
>How do I do the equivalent of an HTML post to a cgi script on another server
>from my PERL cgi?
Use the libwww-perl library.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 2 Feb 1998 23:20:07 GMT
From: simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson)
Subject: How Do I Tell Whether a Key Is Valid for an Associative Array?
Message-Id: <6b5kb7$sm@sf18.dseg.ti.com>
Keywords: key valid
I'm coding an application that looks like it would be nicely imple-
mentable with a hash table. But I can't seem to figure out how to do it.
Anybody out there interested in helping me? If so, you can mail me at
"simonson@skopen.dseg.ti.com".
My "perl" script needs to read in a list of key words from one file,
though the only information it needs to store for each key word is the fact
that it existed in the file. So far, so good; I can implement that as an
associative array that has keys but ignores the rest of its data.
At this point the script can close the first file, opens a source file
for input, and opens a destination file for output. Each time it finds a
certain series of characters in the input file, it needs to check the word
that follows it to see if it was one of the files read from the first file.
That is, it needs to check to see if it exists in the associative array.
How do I do this? If I write my code as follows:
%Abc = ( "Xyz" , 0 , "Abc" , 1);
how do I write a statement that refers to '$Abc{"Def"}' that will detect
that it has been defined, and yet make another statement that refers to
'Abc{"Fhi"}' to realize it does not exist, without blowing up and killing
the execution of the script?
---Kevin Simonson
-------------------------------------------------------------------------
Reverence To send me mail, remove "_nospam" and
the eternal. all the vowels from my login name.
------------------------------
Date: Mon, 02 Feb 1998 19:16:46 -0500
From: see-below@crocker.com (Steve Linberg)
Subject: Re: How Do I Tell Whether a Key Is Valid for an Associative Array?
Message-Id: <see-below-0202981916470001@pri03-041.oldcity.dca.net>
In article <6b5kb7$sm@sf18.dseg.ti.com>,
simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson) wrote:
> how do I write a statement that refers to '$Abc{"Def"}' that will detect
> that it has been defined, and yet make another statement that refers to
> 'Abc{"Fhi"}' to realize it does not exist, without blowing up and killing
> the execution of the script?
if (defined ($abc{"def"})) {
# ...
} else {
# ...
}
Might I suggest "Learning Perl" by Randal Schwartz, available at better
bookstores everywhere.
--
slinberg@ com
crocker.
Try that one, spambots!
------------------------------
Date: Tue, 03 Feb 1998 00:30:14 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: How Do I Tell Whether a Key Is Valid for an Associative Array?
Message-Id: <6b5ohg$pgr$1@cyprus.atlantic.net>
Keywords: key valid
According to simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson):
>%Abc = ( "Xyz" , 0 , "Abc" , 1);
>how do I write a statement that refers to '$Abc{"Def"}' that will detect
>that it has been defined ...
if (exists $Abc{Def}) {}
>Anybody out there interested in helping me? If so, you can mail me at
>"simonson@skopen.dseg.ti.com".
Oh well, I guess you won't see this.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Mon, 02 Feb 1998 18:02:04 -0600
From: Rajiv Shivane <shiva001@tc.umn.edu>
Subject: How to search for control characters ...
Message-Id: <34D65E7C.7A10@tc.umn.edu>
Hi
I am a new perl user and I managed to go through the ``learning perl''
book but I am not able to search for control characters. I want to
search and replace all the control M (^M) characters in $_ with <BR>\n.
I tried s/^./<BR>\n/g; but it didn't work.
If the answer is there in one of the FAQs I would really appreciate it
if you could send me the address of teh FAQ.
Thanks in advance!
-Rajiv.
------------------------------
Date: 2 Feb 1998 23:55:42 GMT
From: simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson)
Subject: Is There a Way to Switch the case Sensitivity of Pattern Recognition?
Message-Id: <6b5mdu$1l2@sf18.dseg.ti.com>
Keywords: case sensitive
Currently the code below gives the following results. I'd like to
know if there's a way to do the pattern recognition with the second com-
pare to get an equality.
h48^h/simonson/Thanos} cat CaseSen
#!/usr/local/bin/perl
$Jqz = "Mno";
if ($Jqz =~ /Mno/)
{ print "Control succeeded.\n";
}
else
{ print "Control failed.\n";
}
if ($Jqz =~ /mno/)
{ print "Test succeeded.\n";
}
else
{ print "Test failed.\n";
}
h48^h/simonson/Thanos} CaseSen
Control succeeded.
Test failed.
h48^h/simonson/Thanos}
Sorry if this is in the FAQ, but I'm not sure how to go about getting
ahold of the FAQ. Any input, posted to this group or mailed to
"simonson@skopen.dseg.ti.com", would be appreciated.
---Kevin Simonson
-------------------------------------------------------------------------
Reverence To send me mail, remove "_nospam" and
the eternal. all the vowels from my login name.
------------------------------
Date: 3 Feb 1998 00:37:27 GMT
From: Eyeh@cris.com (Edward Yeh)
Subject: loading images
Message-Id: <6b5os7$fqs@examiner.concentric.net>
has anyone loaded images into a sql server database ?
ed
--
======================================================================
Ed Yeh
email: eyeh@cris.com - edyeh@usa.net
web: http://www.cris.com/~eyeh
======================================================================
------------------------------
Date: Mon, 02 Feb 1998 23:45:32 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Modifying a file on another Server
Message-Id: <6b5ltv$pee$1@cyprus.atlantic.net>
According to sme@planetpod.com:
>The first way I tried to do this was to have a server-side include that
>called a PERL CGI script on another server. But, I could not determine
>how (or if it was even possible) to call a script that resides on
>another server.
You can make HTTP requests with the LWP library (libwww-perl).
Whether those requests invoke remote scripts depends on the setup
of the remote servers.
>The other solution I imagined was having the script modify a file and
>then upload it to another server. Is there a ftp type method for PERL
>and if so, where is it available?
The libnet library includes FTP.
For both of these, see www.perl.com/CPAN.
>There is also the security issue.
All the rest of your questions are specific to your web servers of choice.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Mon, 2 Feb 1998 14:53:39 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Multi-line blocks of text
Message-Id: <job5b6.r6b.ln@localhost>
Laurens van Alphen (alphen@craxx.com) wrote:
: i'm looking for some advice, here's the scenario:
[snip]
: that is, the file starts with a few comment lines and an undefined number of
: virtual host directives.
: what i want is this:
: deete an entire <VirtualHost></VirtualHost> block by only specifying the
: username (in the User xxx directive).
: can this be done using perl? maybe sed, awk, ed, grep? i've not been able to
: set up a proper multi-line regex...
Not robust enough for production code, but this should get you started:
-----------------------
#!/usr/bin/perl -w
while (<DATA>) {
print; # just echo the comments
last if /^#/; # bail from loop at first non-comment line
}
$/ = "</VirtualHost>\n"; # set the "input record separator"
while (<DATA>) {
print unless /^ User thatuser$/m;
}
__DATA__
# /home/www/conf/virtual.conf
# copyright ) 1998, craxx
# all rights reserved
<VirtualHost www.someserver.com>
ServerName www.someserver.com
User thisuser
Group thisgroup
DocumentRoot /home/thisuser/www
ScriptAlias /cgi-bin/ /home/thisuser/www/cgi-bin/
TransferLog /home/www/log/www.someserver.com
</VirtualHost>
<VirtualHost www.otherserver.com>
ServerName www.otherserver.com
User thatuser
Group thatgroup
DocumentRoot /home/thatuser/www
ScriptAlias /cgi-bin/ /home/thatuser/www/cgi-bin/
TransferLog /home/www/log/www.otherserver.com
</VirtualHost>
-----------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 02 Feb 1998 18:02:16 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Multi-line blocks of text
Message-Id: <34D65078.C8189A4B@shopcfn.com>
Tad McClellan wrote:
>
> Laurens van Alphen (alphen@craxx.com) wrote:
*cut*
> : that is, the file starts with a few comment lines and an undefined number of
> : virtual host directives.
>
> : what i want is this:
>
> : deete an entire <VirtualHost></VirtualHost> block by only specifying the
> : username (in the User xxx directive).
>
> Not robust enough for production code, but this should get you started:
>
> -----------------------
> #!/usr/bin/perl -w
>
> while (<DATA>) {
> print; # just echo the comments
> last if /^#/; # bail from loop at first non-comment line
> }
>
> $/ = "</VirtualHost>\n"; # set the "input record separator"
>
> while (<DATA>) {
> print unless /^ User thatuser$/m;
^^^^^^^^
change the above to 'thisuser' and you lose 2 comment lines. i believe
your 'while' above exits after the first comment line. maybe:
while (<DATA>) {
print; # just echo the comments
last if $_ !~ /^#/; # bail from loop at first non-comment line
}
> }
>
> __DATA__
> # /home/www/conf/virtual.conf
> # copyright ) 1998, craxx
> # all rights reserved
>
> <VirtualHost www.someserver.com>
> ServerName www.someserver.com
>
> User thisuser
> Group thisgroup
>
> DocumentRoot /home/thisuser/www
> ScriptAlias /cgi-bin/ /home/thisuser/www/cgi-bin/
>
> TransferLog /home/www/log/www.someserver.com
> </VirtualHost>
>
> <VirtualHost www.otherserver.com>
> ServerName www.otherserver.com
>
> User thatuser
> Group thatgroup
>
> DocumentRoot /home/thatuser/www
> ScriptAlias /cgi-bin/ /home/thatuser/www/cgi-bin/
>
> TransferLog /home/www/log/www.otherserver.com
> </VirtualHost>
>
--
dan boorstein
------------------------------
Date: 2 Feb 1998 23:50:40 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Multi-line blocks of text
Message-Id: <qz$9802021817@qz.little-neck.ny.us>
Laurens van Alphen <alphen@craxx.com> wrote:
> there's a config file virtual.conf (defines virtual hosts
> in apache) the file is structured as following:
>
> --- begin of file ---
[moved to end of post]
> --- end of file --
> what i want is this:
> deete an entire <VirtualHost></VirtualHost> block by only specifying the
> username (in the User xxx directive).
>
> can this be done using perl? maybe sed, awk, ed, grep? i've not been able to
> set up a proper multi-line regex...
Very simple.
#!/usr/bin/perl -w
undef($/);
$_ = <<'SAMPLE';
# /home/www/conf/virtual.conf
# copyright ) 1998, craxx
# all rights reserved
<VirtualHost www.someserver.com>
ServerName www.someserver.com
User thisuser
Group thisgroup
DocumentRoot /home/thisuser/www
ScriptAlias /cgi-bin/ /home/thisuser/www/cgi-bin/
TransferLog /home/www/log/www.someserver.com
</VirtualHost>
<VirtualHost www.otherserver.com>
ServerName www.otherserver.com
User thatuser
Group thatgroup
DocumentRoot /home/thatuser/www
ScriptAlias /cgi-bin/ /home/thatuser/www/cgi-bin/
TransferLog /home/www/log/www.otherserver.com
</VirtualHost>
SAMPLE
$username = 'thatuser';
s! ^ \s* # start of line, with optional whitespace
# (no strictly needed, but I wanted to
# avoid a commented out entry)
<VirtualHost # start of a VirtualHost
[^<]+ # stuff, without "<"s
^ \s* # start of line, with optional whitespace
# (again avoiding comment text)
User \s+ # begin user statement
$username # the user
\s # a strong word boundary
[^<]+ # stuff, without "<"s
^ \s* # start of line, with optional whitespace
# (again avoiding comment text)
</VirtualHost> # end of a VirtualHost
\s* # tailing whitespace
!!mixs; # /m : allow caret to match at emedded \n
# /i : case insensitive
# /x : extended format
# /s : allow . to match \n
print;
__END__
:r! perl -x %
# /home/www/conf/virtual.conf
# copyright ) 1998, craxx
# all rights reserved
<VirtualHost www.someserver.com>
ServerName www.someserver.com
User thisuser
Group thisgroup
DocumentRoot /home/thisuser/www
ScriptAlias /cgi-bin/ /home/thisuser/www/cgi-bin/
TransferLog /home/www/log/www.someserver.com
</VirtualHost>
Elijah
------
perl -we '$_="anVzdCBhbm90aGVyIG5ldyB5b3JrIHBlcmwgaGFja2VyCg==";
s/.*/eval"use MIME::Base64",decode_base64($&)/e;print;'
------------------------------
Date: Mon, 2 Feb 1998 16:22:41 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Multi-line blocks of text
Message-Id: <hvg5b6.5ib.ln@localhost>
Tad McClellan (tadmc@flash.net) wrote:
: Laurens van Alphen (alphen@craxx.com) wrote:
: : i'm looking for some advice, here's the scenario:
: Not robust enough for production code, but this should get you started:
: last if /^#/; # bail from loop at first non-comment line
Duh. That should have been:
last unless /^#/; # bail from loop at first non-comment line
See. I said it wasn't robust ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 2 Feb 1998 23:27:56 GMT
From: wamphyr@netcom.com (Jason McLain)
Subject: Problems compile PERL/DBD
Message-Id: <wamphyrEnryIK.3Gq@netcom.com>
Greetings.
Actually the root of my problem is getting DBD-Oracle-0.47 to work
with Oracle 7.3.3.4. We've been using DBD with Oracle 7.1.6 for
many months now with no problem. Over the weekend I upgraded the
database to 7.3.3.4 and DBD no longer worked. I tried to rebuild
it and although it seemed to generate a Makefile with no problems
the output from make is as follows:
"Makefile", line 900: make: Dependency line needs colon or double colon operator
.
"Makefile", line 902: make: Dependency line needs colon or double colon operator
.
make: Fatal errors encountered -- cannot continue.
I then did some quick scanning of the manual and tried
"perl Makefile.PL -p". This generated a Makefile that did indeed
compile with no problems. However the tests failed in the plsql
portion and dumped core.
I notied that when I did the perl Makefile.Pl command it
recommended that I rebuild perl using xlc_r as the compiler.
I've been trying to do this for about 6 hours now with no luck.
I've tried dozens of different combinations of libraries and
compiler flags but I always get the following when it hits miniperl:
Could not load program ./miniperl
Symbol _h_errno in sh is undefined
Error was: Exec format error
I can compile perl with no problems and no failed tests with CC,
XLC, or GCC. It's just XLC_R that's giving me the problems. And,
unfortunated DBD doesn't seem to want to work with any version of
perl that I've compiled so far.
I'd really appreciate any help. Here's the environment I'm working
in:
AIX 4.1.4
Oracle 7.3.3.4
PERL 5.004_04
DBD 0.47
DBI 0.91
Jason.
------------------------------
Date: Mon, 02 Feb 1998 23:05:39 GMT
From: sorentin@plsdontspam.sprynet.com (soren a.)
Subject: Re: Public Response to Private Flame (albeit machine-generated)
Message-Id: <6b5jg3$554@bgtnsc02.worldnet.att.net>
In response to an article in which Rich Grise <lovegod@earthling.net> wrote
the following:
[CC: as a "courtesy" to "lovegod@earthling.net"]
>Before I go rage on this "tchrist" guy (what does "tchrist" stand for,
>after all, "The Christ??"
>Apparently, this "TheChrist" guy is so High-and_f????ing_Mighty
>that he has MACHINES flame us because he can't spare the time from
>his gatesian-nine-thousand-dollares an hour job to answer our
>questions or even validate anything us roob questioners
As you have no doubt already been told, oh Massively Ignorant One, Tom
Christiansen MIGHT AS WELL BE Christ; he is one of the 3 or 4 most respected
and basic authorities on Perl and has been offering *free* help and guidance
on using the language, as well as been building the language (and writing
the BIBLES on the language) for longer than you have been lamer-ing your way
through Life, most likely. He no doubt implemented an automatic email reply
system as an absolutely necessary self-defense against the crushing,
astounding volume of repetitive email he must receive as one of the frequent
contributors to this newsgroup and as one of the most respected Authorities
consulted about the language. To you, he might as well be Larry Wall or
Christ; he's as close as YOU are ever going to get (with your attitude) to
either one.
Not noticing that his name is Tom CHRISTiansen (tchrist) is almost as
unforgiveable -- no, pathetically amusing -- as your ill-advised and
ill-tempered attempt to publically flame him. One wonders what kind of
gleaming regex's you will be creating with perceptive abilities of that
caliber.
soren andersen (who has no autoresponder but DOES have a killfile)
--
Visit the a.b.p.gardens Archive at
http://www.geocities.com/~sorentino/
you will not be afflicted with a GeoCities "PopUp"
ad at this GeoPlus site. Please make sure JavaScript
is enabled before entering.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 2 Feb 1998 22:15:56 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: recursive regex?
Message-Id: <6b5gis$kva$1@mathserv.mps.ohio-state.edu>
Adding to what Chip wrote:
[A complimentary Cc of this posting was sent to Richard Caley
<spt@cstr.ed.ac.uk>],
who wrote in article <eyh67my17y9.fsf@liddell.cstr.ed.ac.uk>:
> In article <6b1o86$mt61@zinc.imation.com>, Mark Rostron (mr) writes:
>
> mr> am writing a parser and would like to use regex to easily decode nested
> mr> funcion calls - any ideas?
>
> Can't be done (at least generally).
Can be done with the current Perl (though still *very* clumsy).
> Regular expressions recognise
> regular languages and regular languages don't include recursive
> structures.
Irrelevant, since Perl RE are not "Regular expressions" per se.
> Wouldn't put it past `them' to provide non-regular regular
> expressions in some future perl though :-).
I would guess that Perl RE were never too-regular.
Ilya
------------------------------
Date: Mon, 02 Feb 1998 23:15:00 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Suggestions on my New Shopping Cart System
Message-Id: <6b5jrh$9ev@sjx-ixn11.ix.netcom.com>
"William Lapides" <MetatonCSI@worldnet.att.net> wrote:
>Please check out, if you will, http://jimgraygalley.com
>It is my latest version of my shopping cart script, and Id love suggestions
>and comments on it.
>It is the first Full CGI I have ever written, and would love to have it
>cartiqued!, Thanks!
William,
Gotta get the website up first. ;) I'm guessing that's a typo
(rather than a down server) because whois at InterNIC doesn't seem to
know who 'jimgraygalley.com' is either.
Cheers,
Jeff
-------------------------------
Jeff Yoak jeff@yoak.com
------------------------------
Date: 02 Feb 1998 19:17:36 -0500
From: Michael James <james@juno.physast.uga.edu>
Subject: tie DB_File timing problem
Message-Id: <wzyaztwnhb.fsf@juno.physast.uga.edu>
ok .. I have a nice little setup to handle some data ... using the
DB_File module. The question I can't solve is this, When I change a
value in the hash that is tied to the DB, when is the change actually
commited. I have a script that just seems to ignore changes I make
.
ok ... here I read from the DB, and then write a slightly different
version to the DB. The version that gets printed out is the original
one.
($name,$ssn,$period,$ta1,$ta2,$q1,$q2,$q3) = split(":",$h{$ssn});
$h{$ssn} = join(":",$name,$ssn,$period,$ta1,$ta2,$Q1,$Q2,$Q3);
print qq{$h{$ssn}<p>};
I'm kinda stumped ... any thoughts
Michael
--
==============================================================================
Michael James james@juno.physast.uga.edu
Physics/Computer Science http://www.physast.uga.edu/~james/
University of Georgia Phone - (706) 542-2485
Athens, GA 30602 Fax - (706) 542-2492
Ingres is not a necessary precursor to Egress.
==============================================================================
------------------------------
Date: 2 Feb 1998 16:21:13 -0800
From: rsr@shell3.ba.best.com (Roy S. Rapoport)
Subject: Where's a DBD-mSQL Module?
Message-Id: <6b5ntp$6a$1@shell3.ba.best.com>
I must be missing something.
I'm trying to use Perl to play with an mSQL database; I retrieved the
DBI module, and went to the DBD module description where it explicitly
mentioned a DBD:Msql module.
But at least on ftp.cs.colorado.edu, there is no DBD-mSQL -- it goes
from DBD-Ingres to DBD-NET.
Is there a DBD:MSQL module? Where can I find it?
-roy
------------------------------
Date: Mon, 02 Feb 1998 23:05:37 GMT
From: sorentin@plsdontspam.sprynet.com (soren a.)
Subject: Re: White Hats and Black
Message-Id: <6b5jg1$554@bgtnsc02.worldnet.att.net>
In response to an article in which Tom Christiansen <tchrist@mox.perl.com>
wrote the following:
[CC: to T. C. as a courtesy]
> __White Hats and Black__
> Thursday, 22 January 1998
> Tom Christiansen
> tchrist@perl.com
Not to be just another lame "me too'er" ... but this was brilliant,
wonderful, important commentary and I, as a relative newcomer to the Free
Software Universe, applaud it, and Netscape, enthusiastically. It not only
directs attention to the culture of gift-giving but to the "culture of hope"
vs. that of "stale cynicism."
Tom, i would like to refer to this essay/article on my webpage; do you have
this published on the WWW as a fixed stable URL? One that i can link to?
soren andersen
--
Visit the a.b.p.gardens Archive at
http://www.geocities.com/~sorentino/
you will not be afflicted with a GeoCities "PopUp"
ad at this GeoPlus site. Please make sure JavaScript
is enabled before entering.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
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 1792
**************************************