[16561] in Perl-Users-Digest
Perl-Users Digest, Issue: 3973 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 06:05:53 2000
Date: Thu, 10 Aug 2000 03:05:11 -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: <965901911-v9-i3973@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 10 Aug 2000 Volume: 9 Number: 3973
Today's topics:
"more" with perl <jhijas@yahoo.es>
Re: - Free ebooks and resources - (Matthew M. Huntbach)
Re: Cant figure this out. <elephant@squirrelgroup.com>
Re: Convert URLs to links <fm@via-rs.net>
Re: Converting from US dates/numbers to European dates/ (Mihai N.)
Re: find the number of characters in a string <nickco3@yahoo.co.uk>
Re: find the number of characters in a string <wyzelli@yahoo.com>
Generated or received a file descriptor number that is maheshasolkar@engineer.com
Re: GREP - type of script... <ultraserverNOulSPAM@hotmail.com.invalid>
help for Insert rows into table by DBI <lucas@cplhk.com>
RE: HELP!! with Install on HP-UX.. where to start!?? (H. Merijn Brand)
Re: Issues with running Perl on a Win2000 network? <guenther.degenfelder@datev.de>
Re: Large-File Reformatting Problem (Regexp gurus, et a (Ilya Zakharevich)
Re: Need help with simple cgi code <superegoNOsuSPAM@execs.com.invalid>
Re: Need help with simple cgi code <elephant@squirrelgroup.com>
Re: Oracle connectivity using Perl <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
Perl <-> C (Vladimir)
Perl, CGI, Linux and Forms, need help, urgent <erdal@khio.no>
Perl, CGI, Linux and Forms, need help, urgent <Bulent@khio.no>
Re: Pop Ups <lincolnmarr@europem01.nt.com>
Unable to execute perlcc sneha.shenoy@wipro.com
Re: warning/var weirdness (or is it?) (fvw)
Re: warning/var weirdness (or is it?) <lr@hpl.hp.com>
What is "pack()" used for? <jhijas@yahoo.es>
Re: What is "pack()" used for? <bart.lateur@skynet.be>
Re: Who has used ---------> Net::Telnet ???? Kick A <guenther.degenfelder@datev.de>
Re: XML to HTML with Perl <thunderbear@bigfoot.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Aug 2000 10:57:24 +0200
From: Javier Hijas <jhijas@yahoo.es>
Subject: "more" with perl
Message-Id: <39926E74.ADF9B4E6@yahoo.es>
how can I display paged information with Perl?
------------------------------
Date: 10 Aug 2000 08:39:41 GMT
From: mmh@dcs.qmw.ac.uk (Matthew M. Huntbach)
Subject: Re: - Free ebooks and resources -
Message-Id: <8mtpod$l7h$4@beta.qmw.ac.uk>
COM Service (webmaster@swap-resources.com) wrote:
> I would like to know where I can find free ebooks and good resources about
> Java, Perl, Unix, ASP and Visual Basic.
There are huge amounts of material on these things available on the web.
Anyone with any competence would have no trouble finding them.
Matthew Huntbach
------------------------------
Date: Thu, 10 Aug 2000 07:51:43 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Cant figure this out.
Message-Id: <MPG.13fcfc761e0d44d798968b@localhost>
psycho wrote ..
>Easily put, need to be able to cut the last part of a scarlar at
>a determind character. There would be more then of these
>characters, but the last one and all data after that character
>is to be deleted.
perldoc -f substr
perldoc -f rindex
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 10 Aug 2000 04:48:56 -0300
From: "Fernando" <fm@via-rs.net>
Subject: Re: Convert URLs to links
Message-Id: <8mtnjh$58h$1@phi.procergs.com.br>
amonotod <amonotod@netscape.net> escreveu nas notícias de
mensagem:8msa8r$4pi$1@nnrp1.deja.com...
> In article <8mrg81$cpn$1@horn.hk.diyixian.com>,
> "multiplexor" <abuse@localhost.com> wrote:
> > "." is any character and "\w" is any alphanumeric character, which
> > doesn't include full stop.
> >
> > Just a trial:
> >
> > ####
> > $string = <<'EOC';
> > http://anything.net
> > www.anything.com
> > http://www.anything.net
> > EOC
> > $string =~ s!((http://|www\.)\S*)!<a href=$1>$1</a>!gi;
> > print $string;
> > ####
> >
> > Expression: Starts with "http://" or "www." followed by optional
> non-space
> > characters.
> > Protocol and domain name are case-insensitive, as I know.
> >
> > Hope this helps.
> >
> > "Fernando" <fm@via-rs.net> wrote
> > > I want to write a regular expression that search if the user
> supplied a
> > > url(http://anything.net or www.anything.com for example) in a
> texarea form
> > > and convert it to a link.
> > >
> > > I tried the following:
> > >
> > > $string =~ s/(http:\/\/.+|www\..+)/<a href=$1>$1<\/a>/g;
> > >
> > > Well, of course it failed, but if I substitute the "." for a "\w"
> it'll
> > > still not do the right job.
> >
> >
>
> #!perl -w
> #
> # by multiplexor
> # enhanced by amonotod
>
> use strict;
>
> my $string = <<'EOC';
> http://anything.net
> anything.net
> www.anything.com
> http://www.anything.net
> amonotod.freeservers.com
> www.geocities.com/amonotod
> pics.ebay.com/aw/pics/navbar/ebay_logo_home.gif
> EOC
> $string =~ s!((http://|\w*\.\w*)\S*)!<a href=$1>$1</a>!gi;
> print $string;
> exit;
>
> Works better, but keep in mind that it'll take stuff like example.gif,
> so be prepared for some potential weirdness...
>
> HTH,
> amonotod
Thanks for your help! I got the idea.
And I discovered other "disasters" that could occur:
for example, if the user enter something like:
my $string = <<EOC;
Visit the bar's website (www.bar.com). <- parentheses
Other sites I suggest:
awww.anything.com <- he typed wrong
http://ahything.com. <- a period
EOC
I ended up with the following regex:
$corpo =~ s!(\b(http://|www\.)[\w./]+\w)!<a href=$1>$1</a>!gi;
I used the \b (I learned today about that thing) to avoid the "xwww" or
"xhttp".
[\w./]+ to the core of the link.
\w to the last character of the link.
This solution don't match if the user supplies an "mysite.sub.net",
though...
------------------------------
Date: 10 Aug 2000 09:08:00 GMT
From: nmihai_2000@yahoo.com (Mihai N.)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <8F8C1284FMihaiN@207.172.3.46>
>>But I wonder how the situation of (in a French locale, say)
>>
>> $pi = 3,14159;
>>
>>is different from, in an English locale,
>>
>> $pi = 3.14159;
>>
>>I *can* test the following:
>>
>> $pi = 3 .14159;
>>
>>where the '.' is DWIMmed as string concatenation. By analogy, in order
>>to get the comma interpreted as a list operator, one might need white
>>space.
>
>I thought of that, but it seems to me that it would be
>impossible to have reasonable DWIMming for things like
>substr($s,2,3). Yes, it's good to have whitespace after commas,
>but do French programmers *always* space out their function
>arguments? Maybe I'm just too stuck in my locale.
>
>(I also think that string concatenation is unlikely to be WIM
>when I write
>
> $pi = 3 .14159;
>
>but Perl's DWIM attempts often hide typos, unfortunately.)
Hi,
Sorry for interfiering, but I did play with Perl and locale for a while and
I hope I can help.
The way you write the code does not change from a locale to another.
The locale only affects how Perl converts number to string and string
to number.
You still write
$val = 1234567.89;
$pi = 3.14159;
and the displayed values will be:
US locale:
1234567.89;
3.14159;
French locale:
1234567,89
3,14159
To test the string to number conversion you may try:
print "12,34" * 2;
On a US system "12,34" will become 12 and Perl will display 24;
On a French system "12,34" will become 12.34 and Perl will display 24,68;
Perl uses the POSIX implementation of locale. The implementation is system
dependent, so on some systems the numbers for French locale may be:
1.234.567,89
3,14159
Also, the name of the locales depends on the system.
For instance you have French_France.1252 and German_Germany.1252
if you use Windows, but fr_FR and de_DE for most of the UNIX flavours.
Also an interesting effect is illustrated by the following script:
==============================
require 5.004;
use POSIX qw(locale_h);
use locale;
$a = 1234567.89;
$b = 1234567.89;
# save the original locale
$old_locale = setlocale(LC_ALL);
print "Original locale: $old_locale\n";
print "The value is $a\n";
# set the locale to French
$new_locale = setlocale(LC_ALL, "French_France.1252");
print "Locale changed to: $new_locale\n";
print "The value is $a\n";
print "The value is $b\n";
while( <> ) {
print $_ * 2;
print "\n";
}
setlocale( LC_ALL, $old_locale ); # restore the original locale
==============================
Because you display the value of $a in the original locale (US in this case),
the number is converted to string and the string is "cashed" by Perl.
After you change the locale for French, $a is displayed
as 1234567.89 and $b is displayed as 1234567,89
At least this is what is happening on Windows 98 with the build 616 from
Activestate;
Mihai
------------------------------
Date: Thu, 10 Aug 2000 09:40:54 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: find the number of characters in a string
Message-Id: <39926A96.54EDF0B4@yahoo.co.uk>
Grandma-zilla wrote:
> Many summers ago ...
[snipped ramble]
> Anyhow, one of my most interesting ...
[more ramble]
> You know what ...
[yet more ramble]
> Years back ...
[ramble, ramble, ramble]
> My personal notion is ...
[blah, blah, blah]
> Perhaps a day will come ...
[...when this anecdote finishes?]
> Last Choctaw dictionary was printed in 1909 ...
[... zzzzzzzzzzzz ...]
> There is no way of knowing what will come your way ...
[ Is there a point looming anywhere on the horizon? ]
> This explains my five-hundred horsepower Corvette Mako Shark.
>
> Godzilla!
This isn't alt.senile.rambling, Grandma.
------------------------------
Date: Thu, 10 Aug 2000 18:54:22 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: find the number of characters in a string
Message-Id: <ozuk5.1$JH1.324@vic.nntp.telstra.net>
>
> This explains my five-hundred horsepower Corvette Mako Shark.
> Quite defensive, yes.
>
Personally I drive a 79 Ponitiac Trans-Am (Black) though the closest it
comes to Perl is when I buy a new book and put it in the back seat on
the way home.
Wyzelli
------------------------------
Date: 10 Aug 2000 09:01:08 GMT
From: maheshasolkar@engineer.com
Subject: Generated or received a file descriptor number that is not valid
Message-Id: <8mtr0k$8e6$1@news.netmar.com>
Hi,
I have a couple of small perl scripts...
One is exec.pl ...
#!/usr/local/bin/perl -w
my $CmdStr1 = "my.pl > lst1";
my $CmdStr2 = "my.pl >& lst2";
system ("$CmdStr1");
system ("$CmdStr2");
.. and other my.pl ...
#!/usr/local/bin/perl -w
print "An STDOUT String1\n";
print STDERR "An STDERR String2\n";
print "An STDOUT String3\n";
print STDERR "An STDERR String4\n";
Upon executing exec.pl, these are the responses that I get on two
versions of perl (on two different OSs).
On perl version 5.005_03 built for i386-linux, (Exactly the way I want)
An STDERR String2
An STDERR String4
(Lst1 has only the STDOUT messages & Lst2 has both STDERR & STDOUT
messages)
And on perl v5.6.0 built for 9000/777-hpux, (Error. Functionality, not
as desired)
An STDERR String2
An STDERR String4
sh: lst2: Generated or received a file descriptor number that is not
valid.
(Lst1 has only the STDOUT messages. Script exits before generating Lst2
due to an error)
------------------------------------------------------------------------
I think the problem lies in the '&' in $CmdStr2. If that is removed,
all's well - except the functionality - because I want all the STDERR
& STDOUT messages to go into the lst files. Is there any way I can get
response on v5.6.0 similar to the 5.005_03?
I have an idea that perl 5.6.0 treats file descriptors differently as
compared to its predecessors - as real variables. But I am not sure if
this problem is related to that fact.
- Mahesh
----- Posted via NewsOne.Net: Free Usenet News via the Web -----
----- http://newsone.net/ -- Discussions on every subject. -----
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: Wed, 09 Aug 2000 23:42:49 -0700
From: Scott Barlow <ultraserverNOulSPAM@hotmail.com.invalid>
Subject: Re: GREP - type of script...
Message-Id: <14978418.1176a99f@usw-ex0108-061.remarq.com>
Thanks for both of the help - but I actually want to change
not
the file name or make a backup of the actual file, but I
want
to change a string variable that is found within the file
itself.
So, if foo.txt has the following parameters:
---------------------
test, hello
rest, bye-bye
test, I'm back
----------------------
Then, I'd like to find the string "test" and change it
to "whatever" within the particular "foo.txt", producing the
results:
---------------------
whatever, hello
rest, bye-bye
whatever, I'm back
----------------------
Any suggestions?
TIA
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Thu, 10 Aug 2000 18:04:56 +0800
From: "Lucas Tsoi" <lucas@cplhk.com>
Subject: help for Insert rows into table by DBI
Message-Id: <8mtui5$6lb1@imsp212.netvigator.com>
Hi all,
I met some problems about DBI calling mySQL.
When either of elements(element1, element2, element3, element4, element5)
has
the character liked ' or ", the error message "Cannot update database
payment"
would be returned.
I guess the problem is from the qq interpolation, but I don't know how to
solve it.
----------------------------------------------------------------------------
-----
$dbpayment = DBI->connect("DBI:mysql:table1","root","passwd") or
Error($dbpayment->errstr);
$dbrow = $dbpayment->do(qq(
INSERT INTO payment2 (element, element, element, element)
VALUES ('$DATA{element1}', '$DATA{element2}', '$DATA{element3}',
'$DATA{element4}') ));
if (!defined $dbrow) {
&Error("Cannot update database payment");
}
$dbpayment->disconnect;
------------------------------
Date: Thu, 10 Aug 00 11:37:21 +0200
From: h.m.brand@hccnet.nl (H. Merijn Brand)
Subject: RE: HELP!! with Install on HP-UX.. where to start!??
Message-Id: <8F8C769D7Merijn@192.0.1.90>
btaneja@my-deja.com wrote in <8msia5$b7l$1@nnrp1.deja.com>:
>
>
>sorry forgot to mention this is on a HP-UX 11.0
>and the Perl I downloaded is a binary install..
>
>the question is then do I even do a make?? can
>I just ignore the install/ readme files and untar
>under /opt/perl5 (e.g.) and it will all work??
>
>thanks!!
>-Bruce
>bruce@ereliable.com
>
>
>In article <8msh72$aac$1@nnrp1.deja.com>,
> btaneja@hotmail.com wrote:
>>
>>
>> I have downloaded a Perl 5.6 version of HP-UX, untar-ed it and read
>> it .. Basically I need to :
>>
>> rm -f config.sh Policy.sh
>> sh Configure
>> make
>> make test
>> make install
>>
>> BUT WHERE IS THE MAKE FILE ??
>> I HAVE UNZIPPED IN /home/root
>> and the INSTALL/ readme is in:
>> /home/root/perl/perl/perl-RUN/opt/perl5/doc
>>
>> But no matter where I do "make", I get:
>>
>> # make
>> Make: No arguments or description file. Stop.
>>
>> HELP!
>> thanks, Bruce
What's the name of the tar file? Where did you get it?
If it's something like 'perl-5.6.0.SD.tar.gz' your sequence will be:
# gzip -d perl-5.6.0.SD.tar
# swinstall -s `pwd`/perl-5.6.0.SD.tar
And that should do the trick. Most binary HP-UX distributions are in
SD (Software Distribution) format, and will need swinstall to get it
to the right places.
--
H.Merijn Brand
using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
------------------------------
Date: Thu, 10 Aug 2000 11:08:47 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Issues with running Perl on a Win2000 network?
Message-Id: <399270a6@news.datev.de>
<mikelot@my-deja.com> schrieb im Newsbeitrag
news:8msroi$hr7$1@nnrp1.deja.com...
> I'm in an environment with a Win2000 network. I'd like to create some
> simple perl scripts and have others on the network be able to run them
> without installing Perl/PerlScript. Are there any issues with
> installing Perl and any needed modules on a single system and having
> the users run the Perl interpreter from there, as opposed to locally?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Seems not to be a perl-problem?!
------------------------------
Date: 10 Aug 2000 08:34:51 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Large-File Reformatting Problem (Regexp gurus, et al.)
Message-Id: <8mtpfb$iii$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.13fb948c633503898ac5a@nntp.hpl.hp.com>:
> > > next unless /^[\w\s]+$/;
> > ... and which is the same (but significantly slower) as
> >
> > next if /[^\w\s]/;
>
> I wonder why it would be 'significantly slower'.
My tests show a difference up to 1.5x with the string length of 40 and
5.6.0. /[^\w\s]/ can be rejected without entering the REx engine at
all, by the optimizer alone.
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
use vars qw( $s0 $s1 $s2 $c );
$c = $ENV{LEN} || 240;
$s0 = 'a' x $c;
$s1 = 'a' x $c . '.';
$s2 = 'a.' . 'a' x $c;
timethese( 1 << ($ENV{CNT} || 0), {
Greg0 => 'my $x = $s0 =~ /^[\w\s]+$/',
Greg1 => 'my $x = $s1 =~ /^[\w\s]+$/',
Greg2 => 'my $x = $s2 =~ /^[\w\s]+$/',
Ilya0 => 'my $x = $s0 =~ /[^\w\s]/',
Ilya1 => 'my $x = $s1 =~ /[^\w\s]/',
Ilya2 => 'my $x = $s2 =~ /[^\w\s]/',
} );
__END__
Benchmark: timing 262144 iterations of Greg0, Greg1, Greg2, Ilya0,
Ilya1, Ilya2.
Greg0: 2 wallclock secs ( 2.57 usr + 0.00 sys = 2.57 CPU) @
102001.56/s (n=262144)
Greg1: 2 wallclock secs ( 2.58 usr + 0.00 sys = 2.58 CPU) @
101606.20/s (n=262144)
Greg2: 3 wallclock secs ( 2.08 usr + 0.00 sys = 2.08 CPU) @
126030.77/s (n=262144)
Ilya0: 2 wallclock secs ( 1.86 usr + 0.00 sys = 1.86 CPU) @
140937.63/s (n=262144)
Ilya1: 3 wallclock secs ( 2.07 usr + 0.00 sys = 2.07 CPU) @
126639.61/s (n=262144)
Ilya2: 1 wallclock secs ( 1.84 usr + 0.00 sys = 1.84 CPU) @
142469.57/s (n=262144)
------------------------------
Date: Thu, 10 Aug 2000 00:00:40 -0700
From: Savant_cubed <superegoNOsuSPAM@execs.com.invalid>
Subject: Re: Need help with simple cgi code
Message-Id: <09a40f4c.8dd3de1d@usw-ex0101-008.remarq.com>
Brian has it correct Peter. Where did you ever get your original
Code from (hehe). I would also add in the time too by adding:
$time=`date`;
$caller = $ENV{'HTTP_REFERER'};
open (HANDLE, ">>Somefile.txt") || die " Cant open file $!" ;
print HANDLE " At $time, someone from $caller visited \n" ;
close(HANDLE);
-
-
-
- www.DanCclark.com
-
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Thu, 10 Aug 2000 08:04:56 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Need help with simple cgi code
Message-Id: <MPG.13fcff90289a1ac98968c@localhost>
Savant_cubed wrote ..
>Brian has it correct Peter. Where did you ever get your original
>Code from (hehe). I would also add in the time too by adding:
>
>$time=`date`;
any reason why you're potentially throwing away platform independence
and certainly throwing away some performance by not using one of Perl's
built-in time functions ?
perldoc perlfunc
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 10 Aug 2000 02:21:03 -0700
From: Peter_Gadsby <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
Subject: Re: Oracle connectivity using Perl
Message-Id: <076a01d8.f65ce540@usw-ex0102-014.remarq.com>
Hi Erik, the code also core dumps intermittently in UNIX.....
This is the code in question, basically it display Oracle locks
in HTML .... Your help would be much appreciated.. Cheers
#!/usr/local/bin/perl
$Oraperl::safe=1;
use Oraperl;
#
# Initialising environment variables.
#
my($dbuser)='xxxx/xxxx';
my($dbname)='xxxx';
my($dblink);
my(
@ora_result
);
#
# Format standard output parameters.
#
$^ = 'DATA_TOP';
$~ = 'DATA_BODY';
$= = 10000000;
$dblink = $ARGV[0];
#
# Oracle connection login.
#
my($lda) = &ora_login($dbname, $dbuser, '')
|| &page_support("ora_login: $ora_errno:
$ora_errstr\n");
#
# Extract datafiles from Oracle.
#
my $proc_sql = "
select /*+RULE */ s.sid
,nvl(s.schemaname,
s.username) as schema
,s.osuser
as osuser
,l.type||' '||decode (l.lmode,0,'*REQ','HELD')
||decode
(l.block,1,'*',' ') as type
,replace (to_char (floor(ctime/(60*60)),'00')||':'||
to_char (mod(floor(ctime/60),60),'00')||':'||
to_char (mod
(ctime,60),'00'),' ') as time_held
,decode (l.type,'TX','Rollback Segment'
,'TM',obj.object_type||': '||obj.object_nam
e
,'TT',obj.object_type||': '||obj.object_nam
e
,'ST','Space Transaction Enqueue'
,'TS','Temporary Space Enqueue'
,'unrecognised')
as object
from v\$lock\@$dblink l, dba_objects\@$dblink obj,
v\$session\@$dblink s
where l.sid = s.sid
and decode (l.type, 'TM' ,l.id1, 'TT', l.id1, 0)=obj.object_id
(+)
and s.schemaname <> 'SYS'
order by 5
";
my($proc_csr) = &ora_open($lda, $proc_sql)
|| &page_support("ora_open:
$ora_errno: $ora_errstr\n");
&ora_bind($proc_csr)
|| &page_support("ora_bind:
$ora_errno: $ora_errstr\n");
while(@ora_result = &ora_fetch($proc_csr)) {
write;
}
&ora_close($proc_csr)
|| warn "ora_close($proc_csr): $ora_errno:
$ora_errstr\n";
#
# Close all cursors and logoff Oracle
#
&ora_logoff($lda)
|| warn "ora_logoff($lda): $ora_errno: $ora_errstr\n";
$ora_result[0] = " ";
$ora_result[1] = " ";
$ora_result[2] = "End of Locks Sunmmary";
$ora_result[3] = " ";
$ora_result[4] = " ";
$ora_result[5] = " ";
write;
#----------------------------------------------------------------
---------------
#
# Procedures and Functions.
#
#----------------------------------------------------------------
---------------
#----------------------------------------------------------------
---------------
# Page support
#----------------------------------------------------------------
---------------
sub page_support {
my($message)=@_;
print $message,"\n";
system("PAGE_SUPPORT $message");
die;
}
#----------------------------------------------------------------
---------------
# Produce report in HTML format
#----------------------------------------------------------------
---------------
format DATA_TOP =
Content-type: text/html
<HTML>
<HEAD><TITLE>Mips Locks</TITLE>
<BODY>
<LINK REL=STYLESHEET TYPE="text/css"
HREF="http://gbhfcaix2/mips_dev/style.css">
<H1>Database Locks</H1>
<TABLE border cellpadding=4>
<SMALL>
<TR>
<TH>SID
<TH>Schema
<TH>OS_User
<TH>Type
<TH>Time_Held
<TH>Object
.
#----------------------------------------------------------------
---------------
format DATA_BODY =
<TR>
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[0]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[1]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[2]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[3]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[4]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ora_result[5]
<TD>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
.
#----------------------------------------------------------------
---------------
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Thu, 10 Aug 2000 09:02:52 GMT
From: v@internet.com (Vladimir)
Subject: Perl <-> C
Message-Id: <8F8C7D225vinternetcom@208.170.158.16>
When trying to implement two-way communication between Perl and C, I ran
into the following problem recently.
From Perl, I call C function get_data() to receive hash populated with
some items. I modify those items within script and call another C
function, update_data(), to pass modified hash back to C.
Now, if I do some integer arithmetics with hash item of type integer within
script, it will change item's type, as described in following examle
below. If I don't do any arithmetics at all, but instead just fetch value
from item into variable and immediately put that value back to hash ,
everything is just fine. Incrementing a variable also work, but many other
things don't.
I omitted certain parts of the code for clarity. Although it doesn't seem
to matter, I'm using XS as a glue between C and Perl. Development
environment: NT4/MSVC 6.0/Perl v5.6.0 built for MSWin32-x86.
So, is it something that I am doing wrong here?
Perl code:
==========
...
$data = get_data(); # reference to a hash which is made somewhere in C
# fetch value into some variable
$number = $data->{"number"};
# this seems to work, "number" is still integer after incremeting
$number++;
# but this (and many other operations) _changes_
# type of "number" to pointer to numeric value (!)
$number += 10;
# SV "number" is no longer of type SVt_IV, but SVt_PVNV
$data->{"number"} = $number;
update_data($data);
...
C code:
=======
HV* get_data()
{
HV* hash = newHV();
hv_store(hash, "number", 6, newSViv(12345), 0);
return hash;
}
void update_data(HV* hash)
{
// hash has only one element in this example
int i;
I32 key_count = hv_iterinit(hash);
for (i = 0; i < key_count; i++)
{
char * key;
I32 key_len;
int sv_type;
SV * sv = hv_iternextsv(hash, &key, &key_len);
// key == "number"
sv_type = SvTYPE(sv);
// here, sv_type is SVt_PVNV (enum from sv.h)
// instead of SVt_IV (?)
...
}
}
------------------------------
Date: Thu, 10 Aug 2000 10:35:31 +0200
From: Erdal Sarinc <erdal@khio.no>
Subject: Perl, CGI, Linux and Forms, need help, urgent
Message-Id: <39926952.4EB6EE44@khio.no>
Hi,
I need help to solve an attachment problem due to a application form.
I want people/users to attach their files to the application form, just
as you do at www.hotmail.com but i cant figure out how to this.
I need to know the code beyond these scripts: attach, doattach
i know these codes is copyrighted, i really dont need code itself, but
how write one self.
thanx i advance
Bulent@khio.no
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="Author" content="Bulent Sarinc">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (Win98; I)
[Netscape]">
<title>SØKNADSSKJEMA ATTACHMENTS</title>
</head>
<body bgcolor="#aaaaaa">
<!-- FILE: title.asp-->
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr bgcolor="#eeeecc" align="center">
<td><font face="arial, sans-serif"><b>Vedlegg til søknadskjema,
Kun Word97 format!</b>
</font></td>
</tr></table>
<! Legge ved vedlegg>
<form name="doattach" ENCTYPE="multipart/form-data" method="POST"
action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/doattach">
<input type="hidden" name="disk" value="216.33.240.70_d286">
<input type="hidden" name="login" value="miraculix25">
<input type="hidden" name="f" value="52224">
<input type="hidden" name="curmbox" value="ACTIVE">
<input type="hidden" name="_lang" value="">
<input type="hidden" name="smsg" value="miraculix25.saved">
<input type="hidden" name="attfiles" value="">
<input type="hidden" name="stationery" value="">
<input type="hidden" name="ref" value="">
<table align="center" width="400">
<tr><td>
<ol>
<LI>Klikk på <B>Browse</B> knappen for å velge filen du vil
legge ved søknaden.<BR>
<center><nobr>
Legg ved filen: <input name="attfile" type="file" value="Bla i
gjennom">
</nobr></center>
<p>
<LI>Klikk på <B>Legg ved vedlegget</B> knappen.<br>
<center>
<input type="submit" name="Attach.x" value="Legg ved
vedlegget"><br>
</center>
<p>
<LI>Repeter Trinn 1 og 2 for å legge ved flere filer eller klikk
på <B>Ferdig</B> knappen for å returnere til din søknad.<BR>
</ol>
</td></tr></table>
</form>
<! Ferdig med vedlegg>
<form name="doneattach" ENCTYPE="multipart/form-data" method="POST"
action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/doattach">
<input type="hidden" name="disk" value="216.33.240.70_d286">
<input type="hidden" name="login" value="miraculix25">
<input type="hidden" name="f" value="52224">
<input type="hidden" name="curmbox" value="ACTIVE">
<input type="hidden" name="_lang" value="">
<input type="hidden" name="smsg" value="miraculix25.saved">
<input type="hidden" name="attfiles" value="">
<input type="hidden" name="stationery" value="">
<input type="hidden" name="ref" value="">
<center>
<input type="submit" name="Done.x" value="Ferdig">
</center>
</form>
<! Slette vedlegg>
<form name="attach" method="POST"
action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/attach">
<input type="hidden" name="disk" value="216.33.240.70_d286">
<input type="hidden" name="login" value="miraculix25">
<input type="hidden" name="f" value="52224">
<input type="hidden" name="curmbox" value="ACTIVE">
<input type="hidden" name="_lang" value="">
<input type="hidden" name="smsg" value="miraculix25.saved">
<input type="hidden" name="attfile" value="">
<input type="hidden" name="stationery" value="">
<hr width=400>
<table width="400" border=0><tr><td>
<select name="attachlist" size=5 multiple>
<option value="nOT">-- Vedlegg til søknaden --
</select>
</td>
<td>
<input type="submit" name="Remove.x" value="Fjern vedlegget">
</td></tr>
<tr><td><b>Total antall størrelse på filene = 0K</b></td></tr>
</table>
</form>
<!-- File: bottomstuff.asp -->
<p></center>
<center>
<hr>
<font size=-1 color=#000055>HTML, CGI & JavaScript by Bulent
Sarinc</font> <font size=-1 color=#00ff00>20<font
color=#ffff00>©</font><font color=#ff0000>00</font>, <a
href="mailto:IT@khio.no">IT@khio.no</a></font>
</center>
</body>
</html>
--
-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/free_video/
------------------------------
Date: Thu, 10 Aug 2000 10:36:54 +0200
From: Bulent Sarinc <Bulent@khio.no>
Subject: Perl, CGI, Linux and Forms, need help, urgent
Message-Id: <399269A6.39B00A8C@khio.no>
> Hi,
>
> I need help to solve an attachment problem due to a application form.
>
> I want people/users to attach their files to the application form, just
> as you do at www.hotmail.com but i cant figure out how to this.
> I need to know the code beyond these scripts: attach, doattach
>
> i know these codes is copyrighted, i really dont need code itself, but
> how write one self.
>
> thanx i advance
>
> Bulent@khio.no
>
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> <meta name="Author" content="Bulent Sarinc">
> <meta name="GENERATOR" content="Mozilla/4.7 [en] (Win98; I)
> [Netscape]">
> <title>SØKNADSSKJEMA ATTACHMENTS</title>
> </head>
>
> <body bgcolor="#aaaaaa">
>
> <!-- FILE: title.asp-->
> <table border=0 cellpadding=0 cellspacing=0 width="100%">
> <tr bgcolor="#eeeecc" align="center">
> <td><font face="arial, sans-serif"><b>Vedlegg til søknadskjema,
> Kun Word97 format!</b>
> </font></td>
> </tr></table>
>
> <! Legge ved vedlegg>
>
> <form name="doattach" ENCTYPE="multipart/form-data" method="POST"
> action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/doattach">
> <input type="hidden" name="disk" value="216.33.240.70_d286">
> <input type="hidden" name="login" value="miraculix25">
> <input type="hidden" name="f" value="52224">
> <input type="hidden" name="curmbox" value="ACTIVE">
> <input type="hidden" name="_lang" value="">
>
> <input type="hidden" name="smsg" value="miraculix25.saved">
> <input type="hidden" name="attfiles" value="">
> <input type="hidden" name="stationery" value="">
> <input type="hidden" name="ref" value="">
> <table align="center" width="400">
> <tr><td>
> <ol>
> <LI>Klikk på <B>Browse</B> knappen for å velge filen du vil
> legge ved søknaden.<BR>
> <center><nobr>
> Legg ved filen: <input name="attfile" type="file" value="Bla i
> gjennom">
> </nobr></center>
> <p>
> <LI>Klikk på <B>Legg ved vedlegget</B> knappen.<br>
> <center>
> <input type="submit" name="Attach.x" value="Legg ved
> vedlegget"><br>
> </center>
> <p>
> <LI>Repeter Trinn 1 og 2 for å legge ved flere filer eller klikk
> på <B>Ferdig</B> knappen for å returnere til din søknad.<BR>
> </ol>
> </td></tr></table>
> </form>
>
> <! Ferdig med vedlegg>
>
> <form name="doneattach" ENCTYPE="multipart/form-data" method="POST"
> action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/doattach">
> <input type="hidden" name="disk" value="216.33.240.70_d286">
> <input type="hidden" name="login" value="miraculix25">
> <input type="hidden" name="f" value="52224">
> <input type="hidden" name="curmbox" value="ACTIVE">
> <input type="hidden" name="_lang" value="">
>
> <input type="hidden" name="smsg" value="miraculix25.saved">
> <input type="hidden" name="attfiles" value="">
> <input type="hidden" name="stationery" value="">
> <input type="hidden" name="ref" value="">
> <center>
> <input type="submit" name="Done.x" value="Ferdig">
> </center>
> </form>
>
> <! Slette vedlegg>
>
> <form name="attach" method="POST"
> action="http://lw8fd.law8.hotmail.msn.com/cgi-bin/attach">
> <input type="hidden" name="disk" value="216.33.240.70_d286">
> <input type="hidden" name="login" value="miraculix25">
> <input type="hidden" name="f" value="52224">
> <input type="hidden" name="curmbox" value="ACTIVE">
> <input type="hidden" name="_lang" value="">
>
> <input type="hidden" name="smsg" value="miraculix25.saved">
> <input type="hidden" name="attfile" value="">
> <input type="hidden" name="stationery" value="">
>
> <hr width=400>
> <table width="400" border=0><tr><td>
> <select name="attachlist" size=5 multiple>
> <option value="nOT">-- Vedlegg til søknaden --
>
> </select>
> </td>
> <td>
> <input type="submit" name="Remove.x" value="Fjern vedlegget">
> </td></tr>
> <tr><td><b>Total antall størrelse på filene = 0K</b></td></tr>
> </table>
> </form>
>
> <!-- File: bottomstuff.asp -->
> <p></center>
>
> <center>
> <hr>
> <font size=-1 color=#000055>HTML, CGI & JavaScript by Bulent
> Sarinc</font> <font size=-1 color=#00ff00>20<font
> color=#ffff00>©</font><font color=#ff0000>00</font>, <a
> href="mailto:IT@khio.no">IT@khio.no</a></font>
> </center>
> </body>
> </html>
>
> --
> -----------------------------------------------------
> Click here for Free Video!!
> http://www.gohip.com/free_video/
------------------------------
Date: Thu, 10 Aug 2000 11:03:54 +0200
From: "Marr, Lincoln [HOOF:4713:EXCH]" <lincolnmarr@europem01.nt.com>
Subject: Re: Pop Ups
Message-Id: <39926FFA.63574CB3@europem01.nt.com>
But you can embed HTML in the CGI script and then put javascript
commands within the HTML to create a pop-up alert window. But still
you'd be better off talking to a JavaScript person.
Tony Curtis wrote:
> >> On Tue, 8 Aug 2000 19:51:08 -0500 (CDT),
> >> dennis100@webtv.net (BUCK NAKED1) said:
>
> > I think I understand what you're asking. Though a pop-up
> > window alert (with or without confirms) is usually done
> > with javascript, there are occasions when I also want
> > perl to do it. Is Perl capable of doing something
> > similar to the JS version of alert('Message Goes Here');
> >?
>
> No, perl is server-side. It does not run in the browser.
>
> hth
> t
> --
> "With $10,000, we'd be millionaires!"
> Homer Simpson
------------------------------
Date: Thu, 10 Aug 2000 08:41:06 GMT
From: sneha.shenoy@wipro.com
Subject: Unable to execute perlcc
Message-Id: <8mtpr1$6n1$1@nnrp1.deja.com>
Hi,
I have a .pl file which I want to convert it to a .c file or an
executable (.exe) using perlcc. But using perlcc is either generating
a .c file which cannot be compiled or an executable(.exe) which
generates an application error whenever executed. I have also tried
using the options for perlcc. Have anyone tried to do this before? If
yes, is there a method to do it.
I am using perl version 5.6.0.613
Thanks and Regards,
Sneha
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 07:08:26 GMT
From: fvw+usenet@var.cx (fvw)
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <965883340XBQ.fvw@var.cx>
Thanks for the help everybody, I guess the way to troubleshoot
these things is indeed use strict...
--
Frank v Waveren
fvw@var.cx
ICQ# 10074100
------------------------------
Date: Thu, 10 Aug 2000 00:44:26 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <MPG.13fbfd3975d209b698ac5c@nntp.hpl.hp.com>
In article <965883340XBQ.fvw@var.cx>, fvw+usenet@var.cx says...
> Thanks for the help everybody, I guess the way to troubleshoot
> these things is indeed use strict...
Ssssh! Don't let Godzilla! hear you!!!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Aug 2000 10:31:15 +0200
From: Javier Hijas <jhijas@yahoo.es>
Subject: What is "pack()" used for?
Message-Id: <39926853.2C51F710@yahoo.es>
Ok, I know what it does, but I wonder when may I need it.
------------------------------
Date: Thu, 10 Aug 2000 09:29:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: What is "pack()" used for?
Message-Id: <hct4pskvb0bve94vi0plcqfnmf09e5hg07@4ax.com>
Javier Hijas wrote:
>Ok, I know what it does, but I wonder when may I need it.
Converting plain, human form data into binary structures. unpack() does
the reverse.
For example, if you explicitely want to process binary files, unpack()
will help in turning the rawbytes into numbers. See the module
Image::Size for examples. pack() is usefule if you want to generate such
binary files.
--
Bart.
------------------------------
Date: Thu, 10 Aug 2000 11:19:48 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Who has used ---------> Net::Telnet ???? Kick ASS idea
Message-Id: <3992733c@news.datev.de>
"Savant_cubed" <superegoNOsuSPAM@execs.com.invalid> schrieb im Newsbeitrag
news:0092d81c.821796ec@usw-ex0101-008.remarq.com...
> Does anyone know a better way to telnet to other servers ? I
> keep getting timeout errors using the Net::Telnet module.
> Everytime I try to Change directories once I've telnetted to
> some server with ( cd /bin), it times out. Is there anyway I can
> do this ? Please help. Email --> superego@execs.com
Net::Telnet works very well.
Changing directories works as good as any other commands.
Try to use logging
telnet->input_log(STDERR);
telnet->output_log(STDERR);
and/or tell me more details.
Regards
Guenther
------------------------------
Date: Thu, 10 Aug 2000 10:41:51 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: XML to HTML with Perl
Message-Id: <39926ACF.DE9DD5AC@bigfoot.com>
marius@bluebrush.com wrote:
> In article <8mghhd$5q9$1@nnrp1.deja.com>, harris_m@my-deja.com wrote:
> > Hello,
> > I have a CGI program, which reads XML document and XSLT style sheet
> > translation document. XSLT defines translation from XML elements to HTML
> > elements.
> >
> > Is there some XSLT processor avilable in Perl? I found one in Java but
> > since CGI is written in Perl, I am looking if there is somethig
> > available in Perl.
There is an initial XSLT processor available from CPAN. It does not
implement XSLT fully yet.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
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 3973
**************************************