[20031] in Perl-Users-Digest
Perl-Users Digest, Issue: 2226 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 28 09:05:36 2001
Date: Wed, 28 Nov 2001 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1006956310-v10-i2226@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 28 Nov 2001 Volume: 10 Number: 2226
Today's topics:
Re: [resource] perl script (Helgi Briem)
Re: A Perl Bug? (Helgi Briem)
Re: Can I avoid 2 passes? <admin@asarian-host.net>
Change file extensions in specific subfolders. <adr@not.av>
Correction: Re: Win32::ODBC => generating a list of has <simon.oliver@umist.ac.uk>
Define watch variables and debug non-interactively (Michael Scott)
Re: File position of of every word in a file (Dave Cross)
Re: File position of of every word in a file (Dave Cross)
Re: Filehandle Comparing? <bart.lateur@pandora.be>
Re: HERE documents and setuid programs (Anno Siegel)
Re: How to insert a newline in Perl <bernard.el-hagin@lido-tech.net>
how to use URI::URL ? <lex@nospam.peng.nl>
Re: Intersectioning arrays <jonni@ifm.liu.nospam.se>
Re: is rename atomic? (Anno Siegel)
Re: Must be a better way.. <bart.lateur@pandora.be>
Re: Need Source for search engine like google/yahoo <bart.lateur@pandora.be>
Re: Newbie Help... <Tassilo.Parseval@post.rwth-aachen.de>
newline problem with messy output - v simple problem (bigpig)
Re: newline problem with messy output - v simple proble <cingram-at-pjocs-dot-demon-dot-co-dot-uk>
Oracle 9i patching and Perl (Boris Bellorini)
Perl for WinNT <gldoucette@nbnet.nb.ca>
Problems while Installing modules from Source on w2k. (Sreelatha)
Re: Problems while Installing modules from Source on w2 <rereidy@indra.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Nov 2001 12:41:42 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: [resource] perl script
Message-Id: <3c04da74.3554308115@News.CIS.DFN.DE>
On Wed, 28 Nov 2001 00:40:50 GMT, logikal nonsense
<oddjob10@lycos.com> wrote:
> Was this the wrong group to post this query? help?
>
Yes, and you top-posted too.
Direct web server configuration issues to
the appropriate group in the
comp.infosystems.www.server* hierarchy
Direct cgi issues to
comp.infosystems.www.authoring.cgi
Neither has any relevance to comp.lang.perl.misc
which is a group for discussion of Perl, a
general purpose programming language.
Regards,
Helgi Briem
------------------------------
Date: Wed, 28 Nov 2001 11:10:17 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: A Perl Bug?
Message-Id: <3c04c517.3548838750@News.CIS.DFN.DE>
On Tue, 27 Nov 2001 11:54:13 -0600, "Jake Fan"
<jake@chaogic.com> wrote:
>Helgi Briem <helgi@decode.is> wrote:
>
>> But here, there is always the danger of being answered
>> by a clueless moron like you or Godzilla. A helpdesk
>> usually has only clueful people like Randal, Uri or Tad
>> answering questions. (My god, that would be a good
>> helpdesk. )
>
>What danger? I suspect that many (certainly not all) posters
> asking for help here don't expect the luxury of being
>inspired by super-gurus. They don't even expect "correct"
> answers. All they need is a hint, a keyword,
> and google can take care of the rest.
>
>Plus, a rational person shall not trust any answer as 100%
>precise and correct until it's tested in a working program.
There is plenty of danger. Using "working" scripts
from Matt's script archive or Godzilla or countless
other sources of crap code can open your system to
all manner of exploit and data corruption even
though the scripts "work" when tested.
Many of the people you have been arguing with
"are" super gurus.
From your postings so far, you need
a lot more than a hint and a keyword to
produce something useful.
Regards,
Helgi Briem
------------------------------
Date: Wed, 28 Nov 2001 12:04:50 GMT
From: "Mark" <admin@asarian-host.net>
Subject: Re: Can I avoid 2 passes?
Message-Id: <Cp4N7.132110$qx2.8198436@bin5.nnrp.aus1.giganews.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3C03EBF5.6D20E2ED@stomp.stomp.tokyo...
Tassilo wrote:
> > A true associative array, eh?
> > Better come back with a true associative array working under
> > strictures or return to your sandbox.
>
> > Something that screws your symbol-table and hence is not
> > allowed under strict.
>
>
> Oh look, I smoked another Taliban Cleric Code Cop out of his
> Perl 5 Cargo Cultist cave.
>
> Clearly you invested a lot of time and effort into finding
> a way to break my code, ....
Investing a lot of time into breaking your code?? All he had to do was add
"use strict;" to buckle the hull! And, in the true Perl spirit, "There is
more than one way to break your code." :)
But, seriously, if your mind is so prone to taking long leaves of absence,
perhaps you should consider a vacation program.
- Mark
------------------------------
Date: Wed, 28 Nov 2001 13:59:41 +0100
From: starflyer <adr@not.av>
Subject: Change file extensions in specific subfolders.
Message-Id: <ptn90u8nuhsmgsdf2b5k571domn53130lt@4ax.com>
I need to change html files to shtml in
folders with the same name (all within
a complex folder tree).
Someone help me out?
Or maybe a good perl site for starters?
--
thanks, starflyer
------------------------------
Date: Wed, 28 Nov 2001 13:04:57 +0000
From: Simon Oliver <simon.oliver@umist.ac.uk>
Subject: Correction: Re: Win32::ODBC => generating a list of hashes from the query result set
Message-Id: <3C04E0F9.264EA76B@umist.ac.uk>
> your query you can retrieve the column names via the $sth->{NAMES}
Sorry, that should read '$sth->{NAME}'
--
Simon Oliver
------------------------------
Date: 28 Nov 2001 03:12:10 -0800
From: michael.scott@testadvantage.com (Michael Scott)
Subject: Define watch variables and debug non-interactively
Message-Id: <f3239c04.0111280312.35940e63@posting.google.com>
Hi there,
I would like to be able to define some watch variables and then trace
script execution to a log file, preferably non-interactively ie define
the watch variables somehow and use something like
PERLDB_OPTS="N A L=db.out" perl -d myscript.pl
The intention is that the db.out file will contain the trace execution
of the script, and an indication of when the watch variables change,
and to which value.
I tried manually entering the watch variables from within the the
debugger, then doing an "O option=" to get the trace and non-stop. The
db.out file was created, with the trace execution BUT NO WATCH
VARIABLES.
Any help greatly appreciated.
Michael.
------------------------------
Date: 28 Nov 2001 04:00:32 -0800
From: dave@dave.org.uk (Dave Cross)
Subject: Re: File position of of every word in a file
Message-Id: <9d3debce.0111280400.b925697@posting.google.com>
strien@inl.nl (Rob van Strien) wrote in message news:<3c020c98.8334750@news.leidenuniv.nl>...
> Thanks to all of you who helped me with this problem.
> This is my solution (apart from the discussion of what
> a 'word' might be, which isn't solved yet in my case).
>
>
> while ($startOfLine = tell, $line = <INV>) {
> chomp($line);
> while ($line =~ m/\b([a-zA-Z]+)\b/g) {
> $match = $&;
> $position = $startOfLine+pos($line);
> print TEMP "$match:$position\n";
> }
> }
Rob,
That's very close, but it seems to print out the position of the _end_
of each word. To get the beginning, you need to subtract the length of
$& each time.
Here's my adaptation of your code:
while (my $startOfLine = tell INV, my $line = <INV>) {
chomp($line);
while ($line =~ m/\b([a-zA-Z]+)\b/g) {
my $position = $startOfLine+pos($line)-length($&);
print "$&:$position\n";
}
}
hth,
Dave...
------------------------------
Date: 28 Nov 2001 04:46:22 -0800
From: dave@dave.org.uk (Dave Cross)
Subject: Re: File position of of every word in a file
Message-Id: <9d3debce.0111280446.75376425@posting.google.com>
strien@inl.nl (Rob van Strien) wrote in message news:<3c020c98.8334750@news.leidenuniv.nl>...
> Thanks to all of you who helped me with this problem.
> This is my solution (apart from the discussion of what
> a 'word' might be, which isn't solved yet in my case).
>
>
> while ($startOfLine = tell, $line = <INV>) {
> chomp($line);
> while ($line =~ m/\b([a-zA-Z]+)\b/g) {
> $match = $&;
> $position = $startOfLine+pos($line);
> print TEMP "$match:$position\n";
> }
> }
On further investigation, I've remembered the @- variable which stores
the start position of every parenthesised match in your regex and
thereby renders your challenge really easy. I'm not sure when this was
added, it doesn't work in the 5.005_02 that I have here.
$_ = do { local $/; <INV> };
my @matches = /\b([a-zA-Z]+)\b/g;
print "$matches[$_]: $-[$_]\n" foreach 0 .. $#matches;
hth,
Dave...
------------------------------
Date: Wed, 28 Nov 2001 13:07:07 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Filehandle Comparing?
Message-Id: <t1o90ucdqp2svikm9gs8cfi1ho74i4ip62@4ax.com>
Kit wrote:
>I am opening a folder in which holds just .dat files. I set the
>filehandle DATFILE for all of the .dat files (or, more precisely, each
>of them).
>open REGFILE, "$ENV{'BASEFOLDER'}/$ENV{'DATFILES'}/";
>my ($email,$password,$name) = <REGFILE>;
You're not doing that. You try to open a directory as if it was a file.
That won't work.
You need a glob. That way, you can get a list ofthe paths of the .dat
files, and you can process them all, one by one.
my @datfiles = glob "$ENV{'BASEFOLDER'}/$ENV{'DATFILES'}/*.dat";
foreach my $datfile (@datfiles) {
...
}
>Right now I need to compare one variable, $address, to the name of
>each dat file. How do I do this? I tried:
>if REGFILE eq $address {
>#Commands
>}
>But perl did not seem to want the filehandle. What can I do?
That doesn't make any sense. What file do you want to read your
($email,$password,$name) from? You can compare your $address to each of
the @datfiles in turn, e.g. with grep(), but I'm sure it won't return
any positives unless your address includes the full file path and a
".dat" extension.
@found = grep { $_ eq $address } @datfiles;
--
Bart.
------------------------------
Date: 28 Nov 2001 11:08:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: HERE documents and setuid programs
Message-Id: <9u2gji$di9$1@mamenchi.zrz.TU-Berlin.DE>
According to Maged Abdel-Messeh <m.f.z.abdel-messeh@open.ac.uk>:
> Dear All,
>
> I wonder if you can help me ... I am trying to run a perl script which
> calls the system command rwall which in turn uses the concept of HERE
> documents as its input. Also the perl script is a setuid so it has to
> avoid taintness. In my program I have tried something like:
>
> exec "/usr/sbin/rwall", @remotes, "<<-END\nThis is a warning\nEND";
> # This is not tainted but rwall thinks that <<-END is another machine
>
> exec "/usr/sbin/rwall @remotes <<-END\nThis is a warning\nEND";
> # This is tainted .. gives Insecure dependency
>
> where @remotes is a list of remote machines
You have at least two problems: How to call the rwall program, and
how to make it taint-safe. Don't try to solve both at once, first
get the call right and worry about the setuid problem later.
First of all, are you sure you want to call the program via exec?
A call to exec is always the last thing your program does: exec doesn't
return to the calling program. If you don't want that, you need
system() instead.
Further, you seem to assume that Perl's here-document feature provides
input (via stdin) to an external program. Not so. In Perl, a here-
document is just a way to provide a string. What happens to the string
is the responsibility of the programmer. I won't go into details of
here-documents because it isn't the right tool for the purpose.
The standard way in Perl to provide input to an external program is
via open():
open RWALL, "| /usr/sbin/rwall @remotes" or die "Can't run rwall: $!";
print RWALL "This is a warning\n";
close RWALL or die "Error running rwall";
Anno
------------------------------
Date: 28 Nov 2001 11:09:44 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: How to insert a newline in Perl
Message-Id: <slrna09kcp.qsr.bernard.el-hagin@gdndev25.lido-tech>
On Wed, 28 Nov 2001 22:01:37 +1100, gixxer600 <infullflight@12000rpm.com>
wrote:
> Hi all,
> I've tried using tr & sed to do the following but I have been unsuccessful.
>
> My Input:
> P0127aaaaaaaaaaa00P0203aaaaaaaaaaa08F0102aaaaaaaaaaaaaa00
>
> Desired Output:
> P0127aaaaaaaaaaa00
> P0203aaaaaaaaaaa08
> F0102aaaaaaaaaaaaaa00
>
> I cannot use 'fold' to do this as the length of each line is different. How
> can I do this in Perl?
If you want the newline before every capital letter followed by four
digits (as it seems to me looking at your example) then try:
s/([A-Z]\d{4})/\n$1/g;
Cheers,
Bernard
------------------------------
Date: Wed, 28 Nov 2001 13:36:14 +0100
From: Lex Thoonen <lex@nospam.peng.nl>
Subject: how to use URI::URL ?
Message-Id: <45m90uovpc92u4ak5e3llaslme5dibhu7f@4ax.com>
Hi,
What I am looking for is a script that I can call from a webpage,
strips the not needed information from that webpage (outside the
<print></print> tags) and returns the lot with custom colors (black on
white) to a new window, so the page can be printed easily.
I am using the code you'll find below and it works.
There is one problem though: I want all url's to become absolute urls,
so that also (relative) images will become visible.
I know I should work with URI::URL and I have it on my server, but I
do not how to use with this script. Actually, my knowledge of perl is
very poor, I wouldn'ty know how to use it in any script...
Can somebody help?
Thanks,
Lex
code:
#!/usr/bin/perl
####################################################################
#define this homepath as the root directory of your web site
$homepath="/dnshome/peng.nl/htdocs/";
#GATHER THE INFORMATION
#Are you on nt, mac, or unix?
$platform="unix";
#What's the web path to the ease-zine directory?
$footer="footer.html";
$index="index.html";
$domain=$ENV{'SERVER_NAME'};
$homepath=~ s/\\/\//g;
$source=$ENV{'HTTP_REFERER'};
#DISCOVER THE SOURCE FILE
$source_file=$source;
$source_file=~ s/http\:\/\///g;
$source_file=~ s/$domain//g;
if (substr($source_file,-1,1) eq "/"){
$source_file=$source_file."$index";
}
if (substr($source_file,0,1) eq "/"){
chop($homepath);
}
$source_file=$homepath.$source_file;
if($platform eq "nt"){
$source_file=~ s/\//\\/g;
}
elsif($platform eq "mac"){
$source_file=~ s/\//\:/g;
}
#MAKE SURE IT EXISTS
if (-e $source_file){
$test="yes";
}
open (SOURCE,"$source_file");
foreach $line (&read_file("SOURCE"))
{
$line =~ s/[cC][oO][lL][oO][rR]=/oldclr=/g;
$line =~ s/[bB][aA][cC][kK][gG][rR][oO][uU][nN][dD]=/oldbck=/g;
$line =~ s/[tT][eE][xX][tT]=/oldtxt=/g;
$line =~ s/[lL][iI][nN][kK]=/oldlnk=/g;
$line =~ s/$ENV{'SCRIPT_NAME'}/$source/g;
$line =~s/button_in\.gif/button_out\.gif/g;
$output=$output.$line."\n";
}
close(SOURCE);
#2001 Code for tag support
$max=200;
$counter=0;
$strip = $output;
$strip =~ s/\n/ /g;
$strip=~ s#</[pP][rR][iI][nN][tT]>#<XX>#;
$strip =~ s#<[pP][rR][iI][nN][tT]>#<XX>#;
@lines = split (/<XX>/,$strip);
until ($counter> $max){
$counter++;
$theoutput=$theoutput.$lines[$counter];
}
$output=$theoutput;
print "content-type:text/html\n\n";
print qq|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<LINK rel = STYLESHEET
href =
"http://www.peng.nl/breman.nl/htdocs/css/print.css"
Type = "text/css" >
</head>
<body>
<div align="center"><font size="-2">Voor de laatste versie van deze
pagina kunt u op $domain terecht, wel te
weten:<br><strong>$source</strong></font></div>
<hr width="100%" size="1" noshade>
<p>
|;
print $output;
open(FOOTER, "$footer") || print "no file found $footer!";
$template = "";
while(<FOOTER>)
{
$template .= $_;
}
close(FOOTER);
print "$template\n";
exit;
# THESE ARE COMMON SUBROUTINES
####################################################################
# PARSE SUBROUTINE
sub parse_form {
read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
if (length($cache) < 5) {
$buffer = $ENV{QUERY_STRING};
}
@pairs = split(/&/, $cache);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
}
# READ LISTING
# OPEN LISTING
sub open_file {
local ($filevar, $filemode, $listings) = @_;
open ($filevar,$filemode . $listings) ||
die ("Can't open $listings");
}
# READ LISTINGS
sub read_file
{
local($file_var) = @_;
local(@file_lines) = ();
while(<$file_var>)
{
chop;
push(@file_lines, $_);
}
close($file_var);
return(@file_lines);
}
# STRIP SUBROUTINE
sub strip {
my($cheese)= @_;
$cheese =~ s/\n/<P>/g; # should use this.
$cheese =~ s/%95/<li>/g;
$cheese =~ s/\r/<P>/g;
return ($cheese);
}
#all required scripts must return successfully;
1;
------------------------------
Date: Wed, 28 Nov 2001 13:40:49 +0100
From: "Jonas Nilsson" <jonni@ifm.liu.nospam.se>
Subject: Re: Intersectioning arrays
Message-Id: <9u2lue$m9a$1@news.island.liu.se>
| "Jonas Nilsson" <jonni@ifm.liu.nospam.se> writes:
| > Is there a way to make arrays intersect?
<nobull@mail.com> wrote in message news:u9n118xfct.fsf@wcl-l.bham.ac.uk...|
| No, you can't do it with arrays in pure Perl. But just wait until I
| publish Array::Splice. Unfortunately I haven't even started writing
| it! But my PAUSE user ID arrived today so I'll be uploading an 'i'
| ("just an idea") state module RSN. Array::Splice is a working title
| it may end up being called something else.
|
| This module will export a splice() function that does what I think
splice()
| should have done all along.
|
| use Array::Splice qw( splice ); # Replace inbuilt splice()
| my @array1=("elem1","elem2","elem3");
| my @array2=("newelem1");
| splice @array2, 1, 0, $array1[1];
I really don't get how this differs from inbuild splice, please elaborate.
When I think of it, maybe a module like this could be needed.
use Array::Intersect qw(Intersect);
my @array1=("El1","El2","El3","El4");
my @array2;
Intersect @array1,1,2,@array2;
#Now @array1,@array2 are tied to some module.
print "@array2"; #will print 'El2 El3'
print "@array1"; #will print 'El1 El2 El3 El4'
$array2[0]="NewEl";
print "@array1"; #will print 'El1 NewEl El3 El4'
push @array2,"New2";
print "@array1"; #will print 'El1 NewEl El3 New2 El4'
Was it something like this you meant?
/jN
------------------------------
Date: 28 Nov 2001 11:28:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: is rename atomic?
Message-Id: <9u2ho9$di9$3@mamenchi.zrz.TU-Berlin.DE>
According to Joachim Ziegler <ziegler@algorilla.de>:
[...]
> is 'rename' atomic in the sense that it is either carried out
> completely or not all all?
Yes.
Anno
------------------------------
Date: Wed, 28 Nov 2001 12:26:52 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Must be a better way..
Message-Id: <e9l90u0v753kvuibhh82ihfnh1d9oieron@4ax.com>
HoboSong wrote:
>Clearly Im a newbie to both Perl and programming, but I havent learned
>a better way to do this... Ive used similar many times without any problems
>but Im trying to be more efficient, can someone just give me a nudge in the
>right direction?
>while (<TEXTFILE>) {
>
>if ( /SETTLEMENT SECTION/ ) {
> $section = "settlement";
> } elsif ( /DIVIDENDS REPORT/ ) {
> $section = "divs";
> } elsif ( /RISK MANAGEMENT REPORT/ ) {
> $section = "risk";
> }
>
>
>if ( $section eq "settlement" ) {
> parse_settlement($_);
> } elsif ($section eq "divs" ) {
> parse_divs($_);
> } elsif ( $section eq "risk" ) {
> parse_risk($_);
> }
>}
It looks like you're look ing for a switch statement. No, Perl doesn't
have them, although there's a module on CPAN which implements them --
no, it won't be faster, I'm pretty sure of that. There's an entry in the
FAQ about them (comes with perl install):
Found in lib\pod\perlfaq7.pod
How do I create a switch or case statement?
but what it suggests is not much different from what you came up with.
I just want to suggest using a dispatch table for the second part:
Set up:
my %dispatch = (
settlement => \&parse_settlement,
divs => \&parse_divs,
risk => \&parse_risk,
);
sub default {
my $section = shift;
die "No default action, section = $section";
}
Invocation:
($dispatch{$section} || \&default)->($section);
--
Bart.
------------------------------
Date: Wed, 28 Nov 2001 12:13:16 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Need Source for search engine like google/yahoo
Message-Id: <qrk90uc3nlf24lenlbmnhr2ccutglhmjr8@4ax.com>
Pavan wrote:
> I am planning to develop a search engine like yahoo/ Google for our
>small community. I am thinking to develop using Perl /PHP/ASP, MY Sql
>& Linux. The site is a non commercial one. If any body have any source
>code ,plz mail me at pkkasu@yahoo.com. I tried at sourceforge.net . I
>didnt found the exact application i need. If any one found it on web
>or if u developed, plz mail me.
I think CPAN might be of some use. In particular, Search::InvertedIndex
and DBIx::FullTextSearch look promising.
--
Bart.
------------------------------
Date: Wed, 28 Nov 2001 12:06:27 +0100
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Newbie Help...
Message-Id: <9u2gfj$r1v$06$1@news.t-online.com>
On Wed, 28 Nov 2001 10:45:04 GMT, Chris White wrote:
> I have to learn what the CGI module does first! The book I have
> doesn't go into detail on the standard modules and their subroutines.
> Thanks for the advice, I'll find a reference that does explain it.
You already have _the_ reference to CGI on your harddisk, namely the
docs written by L.D.Stein, the author of CGI.
Try 'perldoc CGI' or - since you appear to use Win and may use
ActiveState's perl - look into the nicely formatted html-documentation
that is basically just a conversion of the original perldocs. You find
the CGI-things among the documentation for the other core-modules.
Tassilo
--
Eggheads unite! You have nothing to lose but your yolks.
-- Adlai Stevenson
------------------------------
Date: 28 Nov 2001 03:12:10 -0800
From: eguttridge@buildonline.com (bigpig)
Subject: newline problem with messy output - v simple problem
Message-Id: <b09860cc.0111280312.477ab47c@posting.google.com>
Hi,
My script fills a variable with the output of a log file. The variable
is then output into html. Although I am sure it is simple, I cannot
work out how to format the output so it contains line ends etc. where
it should do.
All code examples appreciated - thanks.
The output looks like this:
[snip]
Writing out javascript code Aug-23 16:30:22 DEBUG:
upload_confirmation.jsp tolFile Name : i_10x8_sort_down_grey file
extension : gif Aug-23 16:30:22 DEBUG: upload_confirmation.jsp tolFile
Name : i_10x8_sort_up_grey file extension : gif Aug-23 16:30:22 DEBUG:
upload_confirmation.jsp tolFile Name : i_11x12_cadministrator file
extension : gif Aug-23 16:30:22 DEBUG: upload_confirmation.jsp tolFile
Name : i_11x12_padministrator file extension : gif Aug-23 16:30:22
DEBUG: upload_confirmation.jsp tolFile Name : i_11x12_puser file
extension : gif Aug-23 16:30:22 DEBUG: upload_confirmation.jsp tolFile
Name : i_11x13_company file extension : gif Aug-23 16:30:22 DEBUG:
upload_confirmation.jsp tolFile Name : i_11x19_status_trans_hdr file
extension : gif Aug-23 16:30:22 DEBUG:
[snip]
The Perl:
#! /usr/bin/perl
use CGI qw(param);
$host= param("host");
$log= param("log");
$lines= param("lines");
$output= `rsh $host -l dmadmin tail -$lines $log`;
print "Content-type: text/html\n\n";
print "<html><body bgcolor='#FFFFFF' text='#000000'>";
print "<font face='Verdana, Arial, Helvetica, sans-serif' size='1'
color='#999999'>";
print "$output\n";
print "<html><body><h1>End";
print "</h1></body></html>\n";
------------------------------
Date: Wed, 28 Nov 2001 13:55:43 -0000
From: "Clyde Ingram" <cingram-at-pjocs-dot-demon-dot-co-dot-uk>
Subject: Re: newline problem with messy output - v simple problem
Message-Id: <1006955456.7938.0.nnrp-07.9e98e5bc@news.demon.co.uk>
Hi Big Pig,
bigpig <eguttridge@buildonline.com> wrote in message
news:b09860cc.0111280312.477ab47c@posting.google.com...
> My script fills a variable with the output of a log file. The variable
> is then output into html. Although I am sure it is simple, I cannot
> work out how to format the output so it contains line ends etc. where
> it should do.
>
> The output looks like this:
> [snip]
> Writing out javascript code Aug-23 16:30:22 DEBUG:
> upload_confirmation.jsp tolFile Name : i_10x8_sort_down_grey file
> extension : gif Aug-23 16:30:22 DEBUG: upload_confirmation.jsp tolFile
> Name : i_10x8_sort_up_grey file extension : gif Aug-23 16:30:22 DEBUG:
. . .
>
> print "$output\n";
>
> print "<html><body><h1>End";
> print "</h1></body></html>\n";
Can it simply be that the Web server ignores end of line sequences, and if
you want to force formatting, you have to make your Perl replace, e.g., LF
with <BR> in $output?
(At a guess, without me bothering to test this - or knowing much HTML:
$output =~ s/\012/<BR>/g;
or something like that.)
Hope this helps,
Clyde
------------------------------
Date: 28 Nov 2001 06:00:13 -0800
From: boris.bellorini@trivadis.com (Boris Bellorini)
Subject: Oracle 9i patching and Perl
Message-Id: <32a555ec.0111280600.74a2f0ad@posting.google.com>
After installing the patches for Oracle 9i (especially patch
PHCO_24148), I can't use any more my perl 5.6.1 installation.
Previously perl was working fine
Here for example:
Can't load '/opt/perl/lib/5.6.1/PA-RISC1.1/auto/File/Glob/Glob.sl' for
module File::Glob: Invalid argument at
/opt/perl/lib/5.6.1/PA-RISC1.1/XSLoader.pm line 75. at
/opt/perl/lib/5.6.1/PA-RISC1.1/File/Glob.pm line 101
This happens or ANY shared library that I try to use DBD or DBI, etc
Any ideas ?
Here more info's
perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1)
configuration:
Platform:
osname=hpux, osvers=11.00, archname=PA-RISC1.1
uname='hp-ux hptit b.11.00 a 9000785 2002592767 two-user license '
config_args='-Dprefix=/u00/app/oracle/local/tvdperl
-Ubincompat5005'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags =' -D_HPUX_SOURCE -Ae +DAportable
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',
optimize='-O',
cppflags='-D_HPUX_SOURCE -Ae +DAportable'
ccversion='B.11.11.02', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec -lcl
-lpthread
perllibs=-lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec -lcl
-lpthread
libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
cccdlflags='+z', lddlflags='+s -b +vnocompatwarnings
-L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under hpux
Compiled at Jun 20 2001 16:28:10
@INC:
/u00/app/oracle/local/tvdperl/lib/5.6.1/PA-RISC1.1
/u00/app/oracle/local/tvdperl/lib/5.6.1
/u00/app/oracle/local/tvdperl/lib/site_perl/5.6.1/PA-RISC1.1
/u00/app/oracle/local/tvdperl/lib/site_perl/5.6.1
/u00/app/oracle/local/tvdperl/lib/site_perl
Thanks for any help
------------------------------
Date: Wed, 28 Nov 2001 13:55:15 GMT
From: "G.Doucet" <gldoucette@nbnet.nb.ca>
Subject: Perl for WinNT
Message-Id: <716N7.2044$ud.294961@news-nb00s0.nbnet.nb.ca>
Here's the scoop!
The last PERL script I wrote was more than a year ago and ran on the Novell
Enterprise Server.
Now I need to program a PERL script to run on a UNIX server.
The problem however is that I must create, test and debug it at home.
Unfortunately, at home, I only found a copy of WinNT4, and I also have a
copy of Novell Netware 4. - And I have unfortunately never touched UNIX.
I was hoping to develop my script with NT4 or Novell 4 and then make a few
changes when it came time to transfer it to UNIX. Invoking PERL is different
for all these OS but I'm hoping that since my script will be relatively
simple it will transfer smoothly to UNIX.
At first I installed Novell at home but I think I may be too rusty in
finding and installing the Enterprise Web Server - if that's even still in
use.
So then I removed Novell and installed WindowsNT4. The problem however, is
that I have never seen a PERL script for windows. PERL scripts for UNIX
usually begin with: #!/usr/local/bin/perl , for Novell it was:
require("cgilib.pl"); but what about NT4?
I am wondering if someone could reply to the newsgroup here with a
relatively short PERL script written for winNT4, if that even still exists!
Or perhaps there is a web site with lots of WinNT PERL examples or whatever!
Thank you for all and any information.
Please don't reply to email.
G.Doucet
------------------------------
Date: 28 Nov 2001 05:07:37 -0800
From: sreelathas@yahoo.com (Sreelatha)
Subject: Problems while Installing modules from Source on w2k.
Message-Id: <8c3cead.0111280507.161f831d@posting.google.com>
Hi,
I installed perl from source (not the active state perl). The
installation went fine.
I had just changed the Install drive. No other value in the makefile
was changed.
Now I want some other modules to be installed,like win32api::file,
win32api::regitry, etc. When I try installing them I get an error . I
created the makefile(for the above modules after downloading
libwin32-0.18 from CPAN) by running "perl makefile.pl " at the command
prompt. When I try the next step i.e. "nmake", I get the following
error:
D:\PERL56~1.1\libwin32-0.18>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -c -GX -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE
-DNO_STRICT -DPERL_MSVCRT_READFIX -O1 -MD -DNDEBUG
-DVERSION=\"0.09\" -DXS_VERSION=\"0.09\"
-ID:\perl\5.6.1\lib\MSWin32-x86\CORE Process.cpp
Process.cpp
Process.xs(25) : error C2065: 'get_childenv' : undeclared identifier
Process.xs(25) : error C2440: '=' : cannot convert from 'int' to 'void
*'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
Process.xs(37) : error C2065: 'free_childenv' : undeclared identifier
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
How do I overcome this?? Is the error occuring because of some
settings when installing perl?. What do I need to change to install
the different modules when building perl from Source ??
Please Help.
Thanking you In advance.
Sreelatha
------------------------------
Date: Wed, 28 Nov 2001 06:52:22 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Problems while Installing modules from Source on w2k.
Message-Id: <3C04EC16.FEC334AE@indra.com>
Sreelatha wrote:
>
> Hi,
> I installed perl from source (not the active state perl). The
> installation went fine.
>
> I had just changed the Install drive. No other value in the makefile
> was changed.
>
> Now I want some other modules to be installed,like win32api::file,
> win32api::regitry, etc. When I try installing them I get an error . I
> created the makefile(for the above modules after downloading
> libwin32-0.18 from CPAN) by running "perl makefile.pl " at the command
> prompt. When I try the next step i.e. "nmake", I get the following
> error:
>
> D:\PERL56~1.1\libwin32-0.18>nmake
>
> Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
> Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>
> cl -c -GX -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE
> -DNO_STRICT -DPERL_MSVCRT_READFIX -O1 -MD -DNDEBUG
> -DVERSION=\"0.09\" -DXS_VERSION=\"0.09\"
> -ID:\perl\5.6.1\lib\MSWin32-x86\CORE Process.cpp
> Process.cpp
> Process.xs(25) : error C2065: 'get_childenv' : undeclared identifier
> Process.xs(25) : error C2440: '=' : cannot convert from 'int' to 'void
> *'
> Conversion from integral type to pointer type requires
> reinterpret_cast, C-style cast or function-style cast
> Process.xs(37) : error C2065: 'free_childenv' : undeclared identifier
> NMAKE : fatal error U1077: 'cl' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: 'cd' : return code '0x2'
> Stop.
>
> How do I overcome this?? Is the error occuring because of some
> settings when installing perl?. What do I need to change to install
> the different modules when building perl from Source ??
>
> Please Help.
>
> Thanking you In advance.
>
> Sreelatha
Not being a windows programmer, what are the command line switches 'cl'
is using? Are these valid?
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
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 2226
***************************************