[16646] in Perl-Users-Digest
Perl-Users Digest, Issue: 4058 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 18 14:05:44 2000
Date: Fri, 18 Aug 2000 11:05:20 -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: <966621919-v9-i4058@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 18 Aug 2000 Volume: 9 Number: 4058
Today's topics:
Re: Anyone Help??? <aqumsieh@hyperchip.com>
Re: Best way to perform multiple s//'s on a file nobull@mail.com
Bug in 5.6 regex engine (Andreas Karrer)
Diamond-pattern inheritance protection (Conway) mgreenwood@tqs.com
Re: Does Win32::ODBC use SQL*Net when used on Oracle? (John D Groenveld)
Re: Finding a duplicate character vanis@my-deja.com
Following Hyperlinks with cgi <adams1015@worldnet.att.net>
Re: Following Hyperlinks with cgi <godzilla@stomp.stomp.tokyo>
Re: help with RegExp michaeljgardner@my-deja.com
Re: How do I get statistics from Win NT processes? (ie (Astrid Behrens)
Html-like tags parsing <rtarpine@hotmail.com>
Re: Html-like tags parsing <gellyfish@gellyfish.com>
HTML::Parser <grichard@uci.edu>
Re: I have another question <lr@hpl.hp.com>
Re: I have another question <abe@ztreet.demon.nl>
is STDIN a pipe, file, or tty? <dcbecker@lucent.com>
Re: is STDIN a pipe, file, or tty? (Rafael Garcia-Suarez)
Re: is STDIN a pipe, file, or tty? <brent.schenk@home.com>
My script has some bugs <brent.schenk@home.com>
Re: My script has some bugs <tony_curtis32@yahoo.com>
Re: My script has some bugs <brent.schenk@home.com>
Re: My script has some bugs <newsposter@cthulhu.demon.nl>
network operations under perl (dionysus)
Oracle, sqlplus, DBI - help <NOSPAMheir@home.net>
Re: Oracle, sqlplus, DBI - help <newsposter@cthulhu.demon.nl>
Re: Output to printer in Win NT hiroshiishii@my-deja.com
Re: Parsing mail messages <gellyfish@gellyfish.com>
Re: Parsing mail messages nobull@mail.com
Re: Perl cgi-wrap issues and security problems <sandra@siliconrack.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 18 Aug 2000 15:09:11 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Anyone Help???
Message-Id: <7a4s4ik3mu.fsf@merlin.hyperchip.com>
Solo <solo@u.genie.co.uk> writes:
> Hi all,
> got an interesting problem that someone might be able to help me
> with....
>
> I have a file called aliases which contains a line as follows
>
> # allusers: :include:/usr/home/admin/temp/allusers
>
> What I want to do is to edit the file to remove the hash.
> From the command line I can do it with this
>
> perl -p -i -e 's/^(\# allusers: )(.+)/allusers: $2/g' aliases
Why not simply:
perl -pi -e 's/^# (?=allusers:)//' aliases
Note that your /g is unnecessary as you use ^ to match the beginning of
the line.
> but if i try this from within a program using
>
> system ("perl -p -i -e 's/^(\# allusers: )(.+)/allusers: $2/g'
> aliases");
>
> All I get is
>
> allusers:
>
> For some reason the rest of the line is not added. Am i missing
> something here? Does anyone know why this may be occuring?
Yep. It's due to the interpolation of $2 (to an undefined value most
probably) in the string passed to system() (ie. *before* system()
actually executes your process).
The solution is to escape the $ in $2 by adding a backslash \$2.
Or, you could use the modified regexp I show above, which should also be
faster.
--Ala
------------------------------
Date: 18 Aug 2000 18:10:29 +0100
From: nobull@mail.com
Subject: Re: Best way to perform multiple s//'s on a file
Message-Id: <u9g0o2mr5m.fsf@wcl-l.bham.ac.uk>
newsgroups@ckeith.clara.net (Colin Keith) writes:
> Thats an icky description, but what I'd like to be able to do is feed a sub
> the name of a file, and a list of what to search for and the replacement for
> each match. The problem is that I see this getting stupidly slow. If I
> replace 'NAME="bob"' with 'NAME="tom"' that's not a problem I just compare
> every line against the search pattern and replace it .. (s///), but if I add
> a second search-and-replace pair to the list, then I have to perform 2 sar's
> for each line, and so on .. I can see that with a couple this is going to
> slow to a crawl.
>
> Now I thought about it a little but I can't see an obvious way to beat this
> growth. I wondered if I would help if I generated a big regexp of all of the
> matches, joined them together with |'s before reading and for each line of
> the file matched that.
Don't do that - according to the FAQ and the concensus in this
newsgroup the composite regex will actually be slower than the sum of
its parts. I've never benchmarked this myself.
> The composite regexp pattern could use /o because it isn't changing.
The /o regex qualifier has been effectively obosoleted by the qr//
regex pre-compilation mechanism.
> %replacements = ( '%LOGIN'=>$user,
> 'NAME="name" VALUE="' => "NAME=\"name\" VALUE=\"$user",
> 'CLASS="fred"' => 'CLASS="red5');
Don't use a hash, use an array. You can't use things other than
strings as hash keys and you really want to be using precompiled
regexes. Personally I'd use an array of two two element arrays because
I think it's more readable and only a little less efficient. You can
still use the => notation if you like.
@replacements = ( [ qr/%LOGIN/ => $user ],
[ qr/NAME="name" VALUE="/ => "NAME=\"name\"
VALUE=\"$user" ],
[ qr/CLASS="fred"/ => 'CLASS="red5' ]);
while(<FILE>) {
for my $sar (@replacements) {
s/$sar->[0]/$sar->[1]/g;
}
print;
}
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Aug 2000 19:04:05 +0100
From: karrer@iis.ee.ethz.ch (Andreas Karrer)
Subject: Bug in 5.6 regex engine
Message-Id: <slrn8pqr45.1ga.karrer@kuru.ee.ethz.ch>
The following program:
use bytes;
for $i (0 .. 255) {
$_ = $c = chr($i);
/.??\Q$c\E/ or print "no match: $i\n";
}
prints "no match" for all characters in the range 128 .. 255.
It outputs nothing under 5.00503 and 5.00404 (without the "use bytes",
of course).
Apparently there is some interaction between the minimal matching
?? or *? followed by a character with the high bit set.
A possible workaround is to use a character class:
/.??[\Q$c\E]/
- Andi
--
Andi Karrer, Integrated Systems Laboratory, ETH Zuerich, Switzerland
karrer@iis.ee.ethz.ch
- CH stands for Calvin & Hobbs, the most influential Swiss religion
<2n04i5$44j@hebron.connected.com>
------------------------------
Date: Fri, 18 Aug 2000 15:58:40 GMT
From: mgreenwood@tqs.com
Subject: Diamond-pattern inheritance protection (Conway)
Message-Id: <8njmf1$3ut$1@nnrp1.deja.com>
I am implementing a class hierarchy based on techniques in Damian
Conway's very cool OO Perl book. I have added protection against
repeated initializations in case of diamond-pattern inheritance as
follows (taken almost verbatim from the text, section 6.1.5):
package MyClass;
sub _init
{
my ($self, %args) = @_;
return if $self->{_init}{__PACKAGE__}++;
# more stuff...
}
As he says in the text, the first time MyClass::_init is called, its
$self->{_init}{MyClass} attribute doesn't exist, so initialization
proceeds, but if we go through MyClass::_init a second time, $self->
{_init}{MyClass} has been autovivified by the increment operator, and
the redundant initialization is skipped.
Here's my problem: my objects were not getting properly initialized.
When I ran under my debugger, I asked it to evaluate __PACKAGE__ and it
responded MyClass, of course. However, what was autovivified turned
out to be (literally) $self->{_init}{__PACKAGE__}, NOT $self->{_init}
{MyClass}.
Interestingly, when I changed the line to:
return if $self->{_init}{__PACKAGE__.""}++;
appending the empty string, everything works OK and $self->{_init}
{MyClass} is autovivified.
Can anyone tell me why this is, and why the use of the text's verbatim
method fails? I'm running ActiveState's ActivePerl 5.6 on an NT
machine if it matters.
Thanks,
Mark
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Aug 2000 14:00:25 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Does Win32::ODBC use SQL*Net when used on Oracle?
Message-Id: <8njtjp$c2b$1@grolsch.cse.psu.edu>
ODBC is an API, not a middleware. You'll need to use Oracle's
middleware (SQLNet) or some 3rd party (Openlink) to connect your
ODBC application to the server.
John
groenveld@acm.org
------------------------------
Date: Fri, 18 Aug 2000 16:57:46 GMT
From: vanis@my-deja.com
Subject: Re: Finding a duplicate character
Message-Id: <8njptu$8br$1@nnrp1.deja.com>
Hi, Thank you for the quick replies.. I apologize if the question was
insulting easy...I can understand how responding to a question (quite
frequently) which can be found in the faq is annoying..
> (Just Another Larry) Rosler
> s/(.)\1/$1($1)/g; # add /s to include newlines
> Kjetil Skotheim
> s/(\w)(\1)/$1($2)/g;
The first thing I learned about Perl, TMTOWTDI..Which answer is more
efficient?? It seems as though Larry used a single grouping, while
Kjetil used two separate groupings..
>
> > P.s. A link to the faqs please...
>
> perlfaq4: "How do I remove consecutive pairs of characters?"
>
I'm sorry for not being more specific, I meant a URL to the FAQ..not an
reference to where I might find the related topic....if
possible..gracias
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 18 Aug 2000 17:30:52 GMT
From: "Jeremiah Adams" <adams1015@worldnet.att.net>
Subject: Following Hyperlinks with cgi
Message-Id: <gpen5.14988$4T.865394@bgtnsc07-news.ops.worldnet.att.net>
Hi,
Can someone tell me how to follow hyperlinks with perl? Or send me to a faq
or website? IE, I want to submit a link to the script and have the script
resolve it.
thanks
------------------------------
Date: Fri, 18 Aug 2000 11:02:42 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <399D7A42.50BC44AB@stomp.stomp.tokyo>
Jeremiah Adams wrote:
> Can someone tell me how to follow hyperlinks with perl?
> Or send me to a faq or website? IE, I want to submit a
> link to the script and have the script resolve it.
Easy enough!
Two basic methods for this. One is to use LWP, the other
to do a simple print Location.
For both methods, logic is,
if my input matches http... etc..
or my input is an URL address,
grab this URL address for use.
Once you have parsed out an URL,
using LWP, if URL, $resolve = get ("URL address.. etc..)
print $resolve
or
if URL, print Location: URL .. etc..
Using LWP will print whatever is found at this site.
Using Location will redirect you to this site.
Your key terms for research are: "LWP" and "Location:"
I am curious though. If you already have a link to a
site, couldn't you discover what is there by following
this link via your browser? This is faster and certainly
more efficient than using Perl for this task.
Godzilla!
------------------------------
Date: Fri, 18 Aug 2000 15:12:36 GMT
From: michaeljgardner@my-deja.com
Subject: Re: help with RegExp
Message-Id: <8njjoh$gv$1@nnrp1.deja.com>
In article <399D4754.1D6B69C8@hotmail.com>,
"Alex T." <samara_biz@hotmail.com> wrote:
> Hi,
>
> I need to write a regular expression, which would remove suffixes from
> the last names.
>
> For example,
>
> WHITE<any number of blanks>JR
> would become WHITE
>
> ST<any number of blanks>LOUIS<any number of blanks>III
> would become ST LOUIS
>
Alex,
So, you've basically got a string of two "words" separated by one or
more spaces, and you want to convert it to the first word. Here's a
couple of ideas;
1) replace the space(s) and the last word with nothing
$name=~s/\s+\w+//;
2) return just the first word;
$name=~m/(^\w+)/;
I'm not sure if the second one changes $name's value to the match, so I
put parenthesis around the match so that in any event, the first match
would be saved in the system variable $1. So you may need to re-assign
$name=$1.
Hope this helps,
Michael
> etc...
>
> I tried this:
>
> $lastname =~ s/([\w|\s]+?)\s+?(\w+?)$/$1/i;
>
> and a few other ways, but I don't seem to get it to work.
>
> Thanks!
>
> Alex
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 18 Aug 2000 17:46:23 GMT
From: behrens@haulpak.com (Astrid Behrens)
Subject: Re: How do I get statistics from Win NT processes? (ie total memory used by process)
Message-Id: <slrn8pqu2p.e0c.behrens@pc32.haulpak.com>
Gary Brown <garyb1@home.com> wrote:
>I am trying to do a "ps aux" in Winnt. I would like to track the memory
>used by a process. I will have the process name, but I can't find any
>module that will give me stats, just ones that start and stop processes.
>Basically, I would like to get the information that taskmanager (processes
>tab) and Performance Monitor(prefmon.exe) use.
>
There were a couple scripts like that posted to the perl-ntadmin mailing list,
about a month or two ago.
You could try searching for them at http://www.topica.com/lists/perl-ntadmins/
Astrid
------------------------------
Date: 18 Aug 2000 11:28:44 -0400
From: Ryan Tarpine <rtarpine@hotmail.com>
Subject: Html-like tags parsing
Message-Id: <8njktb$270g$1@newssvr03-int.news.prodigy.com>
I am trying to parse some files that have html-like (beginning and ending) tags. However, when
tags contain other tags of the same kind (I can't think of better terminology. Sorry), a simple
regexp doesn't work. For example:
<begin>
<begin>
<end>
<end>
My simple regexp way of solving this will match the first <begin> with the first <end>, when
it should be matched with the second. What would be a good way to solve this?
Thanks in advance,
Ryan
------------------------------
Date: Fri, 18 Aug 2000 16:23:20 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Html-like tags parsing
Message-Id: <Ypdn5.246$NE3.23877@news.dircon.co.uk>
On 18 Aug 2000 11:28:44 -0400, Ryan Tarpine Wrote:
> I am trying to parse some files that have html-like (beginning and ending) tags. However, when
> tags contain other tags of the same kind (I can't think of better terminology. Sorry), a simple
> regexp doesn't work. For example:
>
> <begin>
> <begin>
> <end>
> <end>
There are modules for the parsing of both HTML and XML, examples of which are
given frequently in this group, you could do worse than search through
Deja News for some examples or look at CPAN to see if there is something
there that meets your requirements.
/J\
------------------------------
Date: Fri, 18 Aug 2000 10:05:15 -0700
From: "Gabe" <grichard@uci.edu>
Subject: HTML::Parser
Message-Id: <8njqm8$que$1@news.service.uci.edu>
The docs say $p->parse_file($file) returns a reference to the parser object.
What does this mean? I know what a reference is, but what's th parser
object? Isn't that $p?
I want to print the content of the HTML page in question, I'm using the
right module right? How do I print what HTML::Parser finds?
Gabe
------------------------------
Date: Fri, 18 Aug 2000 08:37:52 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I have another question
Message-Id: <MPG.1406f829103f163598ac92@nntp.hpl.hp.com>
In article <u3aqpsk601dub1a0goqmvoj1c6jd05u82c@4ax.com>,
abe@ztreet.demon.nl says...
...
> This is a Guttman-Rosler Transform that handles your data as an array of
> lines and tries to find the number between 'B1D-' and ','.
>
> For more information see:
>
> http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html
> and
> http://www.perl.com/CPAN-local/doc/FMTEYEWTK/sort.html
>
> #!/usr/bin/perl -w
> use strict;
>
> my @unsorted = <DATA>;
>
> my @sorted = map "${\ (unpack 'na*', $_)[-1] }" => sort
The data-recovery step is unnecessarily complex.
1. You go out of your way to stringify what is already a string.
2. Using the inverse of the packing transform is informative, but
overkill. I prefer simply to take a trailing substring after 2
characters, which is much faster. If you feel uncomfortable coding in
the literal 2, you could earlier do a simple measurement:
$length_of_prefix = length pack n => 1;
> map pack('na*', /B1D-(\d*),/?$1:0, $_ ) => @unsorted;
I like the thoughtful attempt to deal with 'bad' data. Too often are
such defensive precautions overlooked. But the \d* really should be
\d+.
> print for @sorted;
>
> __DATA__
> NIH,B1D-403,01 36,13 5 26 ,15 43,1 5 2 5 2 4
> NIH,B1D-43,01 36,13 5 26 ,15 43,1 5 2 5 2 4
> NIH,B1D-415,01 36,13 5 26 ,15 43,1 5 2 5 2 4
> Suburban,B1D-10,52 51 36,135 256 ,15413,1512
Plaudits!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 18 Aug 2000 19:01:27 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: I have another question
Message-Id: <9rpqps0bss1ohjthpa1oehu5duitmg8jgr@4ax.com>
On Fri, 18 Aug 2000 08:37:52 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
> In article <u3aqpsk601dub1a0goqmvoj1c6jd05u82c@4ax.com>,
> abe@ztreet.demon.nl says...
>
> ...
...
> > my @sorted = map "${\ (unpack 'na*', $_)[-1] }" => sort
>
> The data-recovery step is unnecessarily complex.
>
> 1. You go out of your way to stringify what is already a string.
I actually went out of my way to use the 'map EXPR, LIST' form rather
than the 'map BLOCK LIST' form. I overdid :-(
> 2. Using the inverse of the packing transform is informative, but
> overkill.
Intended to be informative.
> I prefer simply to take a trailing substring after 2
> characters, which is much faster. If you feel uncomfortable coding in
> the literal 2, you could earlier do a simple measurement:
>
> $length_of_prefix = length pack n => 1;
I first wrote it with substr($_, 2), but changed it.
> > map pack('na*', /B1D-(\d*),/?$1:0, $_ ) => @unsorted;
>
> I like the thoughtful attempt to deal with 'bad' data. Too often are
> such defensive precautions overlooked. But the \d* really should be
> \d+.
Yep.
...
> Plaudits!
Thank you.
--
Good luck,
Abe
------------------------------
Date: Fri, 18 Aug 2000 11:18:38 -0400
From: Daniel Becker <dcbecker@lucent.com>
Subject: is STDIN a pipe, file, or tty?
Message-Id: <399D53CE.4D4AF2D2@lucent.com>
How can one determine, from within a perl script, whether STDIN
is reading from a pipe (eg "cat foo | perl script.pl"), or a file
(eg "perl script.pl foo") or the user's tty (eg "perl script.pl")?
--
Dan Becker
dcbecker@lucent.com
------------------------------
Date: Fri, 18 Aug 2000 15:37:25 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: is STDIN a pipe, file, or tty?
Message-Id: <slrn8pqmc9.prp.rgarciasuarez@rafael.kazibao.net>
Daniel Becker wrote in comp.lang.perl.misc:
>How can one determine, from within a perl script, whether STDIN
>is reading from a pipe (eg "cat foo | perl script.pl"), or a file
>(eg "perl script.pl foo") or the user's tty (eg "perl script.pl")?
man perlfunc
--> lookup '-X FILEHANDLE'
--
Rafael Garcia-Suarez
------------------------------
Date: Fri, 18 Aug 2000 12:38:02 +0100
From: "Brent Schenk" <brent.schenk@home.com>
Subject: Re: is STDIN a pipe, file, or tty?
Message-Id: <399d72f6.0@news>
Hey,
I don't know the answer to your question, but this may help. Here is how I
take in the STDIN:
$referer = $ENV{'HTTP_REFERER'};
$content_length = $ENV{'CONTENT_LENGTH'};
read (STDIN, $posted_information, $content_length);
$posted_information is the stdin string. I use that for webpages. Maybe
yours is something totally different
Rafael Garcia-Suarez <rgarciasuarez@free.fr> wrote in message
news:slrn8pqmc9.prp.rgarciasuarez@rafael.kazibao.net...
> Daniel Becker wrote in comp.lang.perl.misc:
> >How can one determine, from within a perl script, whether STDIN
> >is reading from a pipe (eg "cat foo | perl script.pl"), or a file
> >(eg "perl script.pl foo") or the user's tty (eg "perl script.pl")?
>
> man perlfunc
> --> lookup '-X FILEHANDLE'
>
> --
> Rafael Garcia-Suarez
------------------------------
Date: Fri, 18 Aug 2000 12:05:29 +0100
From: "Brent Schenk" <brent.schenk@home.com>
Subject: My script has some bugs
Message-Id: <399d6b59.0@news>
My script is basically finished! It has some bugs in it. When I do the
check in windows/dos it goes just fine, but when I upload it to my server it
blows up with a 500 error and I can't figure it out. I have no way of
tracking what is happening or where it is at when it stops. If someone
could tell me how to do that, or do it for me if they have a UNIX machine
that would be great! Maybe someone might even want to take a look at the
script fix it leaving commments where they changed it. Thanks alot for
anybody's help!
------------------------------
Date: 18 Aug 2000 12:05:14 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: My script has some bugs
Message-Id: <87bsyqh54l.fsf@limey.hpcc.uh.edu>
>> On Fri, 18 Aug 2000 12:05:29 +0100,
>> "Brent Schenk" <brent.schenk@home.com> said:
> My script is basically finished! It has some bugs in
> it. When I do the check in windows/dos it goes just
> fine, but when I upload it to my server it blows up with
> a 500 error and I can't figure it out. I have no way of
> tracking what is happening or where it is at when it
> stops. If someone could tell me how to do that, or do
> it for me if they have a UNIX machine that would be
> great! Maybe someone might even want to take a look at
> the script fix it leaving commments where they changed
> it. Thanks alot for anybody's help!
Imagine your post above arrived in your mail one day, from
someone else you knew nothing about.
Is there anything in the text that would help anyone
suggest what might be wrong?
No.
Despite what you see in this group, we're not really
psychic.
t
--
"I'm not easily impressed. Wow! A blue car!"
Homer Simpson
------------------------------
Date: Fri, 18 Aug 2000 12:29:20 +0100
From: "Brent Schenk" <brent.schenk@home.com>
Subject: Re: My script has some bugs
Message-Id: <399d70ee.0@news>
Sorry, I wasn't asking if you knew my problem! I was simply asking if
anyone knew how to step into a perl script or maybe they might want me to
send them the script to check over! Didn't mean to piss "t" off.
Tony Curtis <tony_curtis32@yahoo.com> wrote in message
news:87bsyqh54l.fsf@limey.hpcc.uh.edu...
> >> On Fri, 18 Aug 2000 12:05:29 +0100,
> >> "Brent Schenk" <brent.schenk@home.com> said:
>
> > My script is basically finished! It has some bugs in
> > it. When I do the check in windows/dos it goes just
> > fine, but when I upload it to my server it blows up with
> > a 500 error and I can't figure it out. I have no way of
> > tracking what is happening or where it is at when it
> > stops. If someone could tell me how to do that, or do
> > it for me if they have a UNIX machine that would be
> > great! Maybe someone might even want to take a look at
> > the script fix it leaving commments where they changed
> > it. Thanks alot for anybody's help!
>
> Imagine your post above arrived in your mail one day, from
> someone else you knew nothing about.
>
> Is there anything in the text that would help anyone
> suggest what might be wrong?
>
> No.
>
> Despite what you see in this group, we're not really
> psychic.
>
> t
> --
> "I'm not easily impressed. Wow! A blue car!"
> Homer Simpson
------------------------------
Date: 18 Aug 2000 17:39:02 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: My script has some bugs
Message-Id: <8njsbm$pjt$1@internal-news.uu.net>
Brent Schenk <brent.schenk@home.com> wrote:
> My script is basically finished! It has some bugs in it. When I do the
> check in windows/dos it goes just fine, but when I upload it to my server it
> blows up with a 500 error and I can't figure it out. I have no way of
> tracking what is happening or where it is at when it stops. If someone
> could tell me how to do that, or do it for me if they have a UNIX machine
> that would be great! Maybe someone might even want to take a look at the
> script fix it leaving commments where they changed it. Thanks alot for
> anybody's help!
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#My_CGI_script_runs_from_the_com
Erik
------------------------------
Date: Fri, 18 Aug 2000 17:49:29 GMT
From: dionysus39@hotmail.com (dionysus)
Subject: network operations under perl
Message-Id: <399d752f.85628023@nntp.unsw.edu.au>
I am just starting to learn Perl.....one of the major reasons I am
moving to it from java is that I have repeatedly heard how much easier
it is to write programs to interact with a LAN in Perl. I am currently
attempting to put together a program to enumerate all workgroups in
the LAN, all machines in a given workgroup, and all shared directories
on that machine (the idea is to search the LAN for a given filename).
With java I have had to list all shared folders, as while it is easy
to get java to search directories once you give it the name (using the
host computer's OS to interact with the network), the pacakges that
come with java seem to have no easy way of allowing the program itself
to interact with the network (java.net is entirely internet-based).
Hence I was hoping that I would be able to do it with Perl - but of
course, being a bit new to the language I have no idea of even where
to look, and would really appreciate any pointers anyone could give
me. I am using activeperl on a win95 machine (the other machines on
the network are also windows machines), and the LAN uses tcp/ip.
Thanks heaps in advance
-dionysus
Needing quick MP3-related help? Check Xorys' FAQ - http://webhome.idirect.com/~nuzhathl/mp3-faq.html
------------------------------
Date: Fri, 18 Aug 2000 12:23:23 -0400
From: "Michael Heir" <NOSPAMheir@home.net>
Subject: Oracle, sqlplus, DBI - help
Message-Id: <399d6188@viper.isc.att.com>
I have searched far and wide to try to find a manual or documentation to
help me with this problem. I hope someone here can help me.
I have some sqlplus scripts that execute without problems when run from the
sqlplus command line directly. I would like to use the same queries through
DBI, but I cannot seem to figure out how to do it.
Here is a sample sqlplus query that works from the command line:
SET pagesize 2100
COL AN format a40
SELECT /* FULL(raw) PARALLEL(raw, 4) */
sf_raw2name(number) AN, count(*)
FROM raw
WHERE (site = 'S') and (time >= ( sf_date2time(sysdate) - 86400))
GROUP BY sf_alarm2name(alarmnumber)
ORDER BY count(*) desc;
I have tried many things to get that to work via DBD::Oracle. I have
wrapped it in BEGIN and END; .. I have also attempted to cut that query down
to the bare minimums (I removed the PARALLEL/FULL commands, etc) but I still
cannot get it to work.
Is there any way to submit queries that work from the sqlplus command line
through the Perl DBI with DBD::Oracle? The only documentation I could find
was how to call simple stored procedures.
Thanks for any help. It is greatly appreciated.
------------------------------
Date: 18 Aug 2000 17:07:24 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Oracle, sqlplus, DBI - help
Message-Id: <8njqgc$nsv$1@internal-news.uu.net>
Michael Heir <NOSPAMheir@home.net> wrote:
> Here is a sample sqlplus query that works from the command line:
> SET pagesize 2100
> COL AN format a40
> SELECT /* FULL(raw) PARALLEL(raw, 4) */
> sf_raw2name(number) AN, count(*)
> FROM raw
> WHERE (site = 'S') and (time >= ( sf_date2time(sysdate) - 86400))
> GROUP BY sf_alarm2name(alarmnumber)
> ORDER BY count(*) desc;
> I have tried many things to get that to work via DBD::Oracle.
Did you try without the SET pagesize 2100 and COL AN format a40 ?
Could you show the actual code that you tried, _and_ the errors
you got?
> Is there any way to submit queries that work from the sqlplus command line
> through the Perl DBI with DBD::Oracle?
If you mean: everything that works for sqlplus: most likely not.
sqlplus does preprocessing/postprocessing on the queries you type
before passing the quer[y|ies] on to the database engine. DBI does
not do that.
Erik
------------------------------
Date: Fri, 18 Aug 2000 16:38:56 GMT
From: hiroshiishii@my-deja.com
Subject: Re: Output to printer in Win NT
Message-Id: <8njoqt$6t6$1@nnrp1.deja.com>
Thank you Jason.
It worked. This is exactly I was looking for. I want you to know that
none of reference books I looked up didn't mention about your
command, "open(PRINTER,'>LPT1:')." Great appreciation to you!
Well, I came up work around solution,
$file="file2b.printed";
print `type $file > lpt1:`;
-Hiroshi
In article <MPG.1407993347433e99896ce@localhost>,
jason <elephant@squirrelgroup.com> wrote:
> Jonathan Stowe wrote ..
> >On Thu, 17 Aug 2000 15:13:38 GMT hiroshiishii@my-deja.com wrote:
> >> Hi All:
> >>
> >> Would someone give an advice on how to print an ASCII
string, "Hello
> >> world," to LaserJet4, which is on local parallel port (LPT1:), from
> >> WinNT or 98?
> >>
> >
> >open(PRINTER,'>LPT1:') || die "Can't open printer - $!\n";
> >print "Hello, World\n";
> >
> >print "\f"; # Some printers will require this line feed before
producing
> > # a page
> >
> >close PRINTER;
> >
> >On shared printers you can use the UNC name of the printer
(\\server\printer).
>
> of course - Jonathan meant to write
>
> print PRINTER "Hello, World\n";
> print PRINTER "\f";
>
> or maybe a select disappeared from my newsfeed ;)
>
> --
> jason -- elephant@squirrelgroup.com --
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 18 Aug 2000 16:24:17 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Parsing mail messages
Message-Id: <Rqdn5.247$NE3.23877@news.dircon.co.uk>
On Fri, 18 Aug 2000 14:50:02 GMT, awr@cpu.com Wrote:
> I'm on a project where data files will delivered for processing by
> email. Sendmail will be configured to hand the message to my script.
> Parsing the messages is trivial if everything is in ascii text. However,
> I'm afraid the data will be hidden in mime attachments in many of the
> messages. I would like to be able to detech and decode any mime
> attachments. Could some kind soul tell me which module or modules I
> should be looking at to do this? I made a quick perusal of the mail and
> news section of the CPAN modules list, but nothing jumped
> out at me.
>
The MIME-Tools package will probably help.
/J\
------------------------------
Date: 18 Aug 2000 18:22:17 +0100
From: nobull@mail.com
Subject: Re: Parsing mail messages
Message-Id: <u9bsyqmqly.fsf@wcl-l.bham.ac.uk>
awr@cpu.com writes:
> I would like to be able to detech and decode any mime
> attachments. Could some kind soul tell me which module or modules I
> should be looking at to do this?
The MIME::* ones.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 18 Aug 2000 16:27:53 GMT
From: Sandra <sandra@siliconrack.com>
Subject: Re: Perl cgi-wrap issues and security problems
Message-Id: <=kvMNluFyNTx4HeSvfUsDYKS0cbU@4ax.com>
Thanks, we will try the chrooted environment.
Sandra
>Can I suggest you something. It appears that you're taking the problem
>from the wrong side. Have you ever heard something about 'chrooted
>environnments'? See the man page for chroot on your system. Install
>apache as chroot so it can access only a limited part of the filesystem.
>Install ftpd as chroot too. This will be safer that hacking the perl
>source code and scanning all files that are uploaded to your server.
>There are plenty of tutorials on the web that will help you.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4058
**************************************