[17428] in Perl-Users-Digest
Perl-Users Digest, Issue: 4848 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 8 18:10:43 2000
Date: Wed, 8 Nov 2000 15:10:16 -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: <973725016-v9-i4848@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 8 Nov 2000 Volume: 9 Number: 4848
Today's topics:
how do i ask for input? <me@privacy.net>
Re: how to wait for a child to end <tim@ipac.caltech.edu>
I do not Understand Perl Formats john_s_brown@my-deja.com
Re: I do not Understand Perl Formats (Clay Irving)
Re: Is this procedure called parsing? (Newbie) (Mark-Jason Dominus)
Re: Is this procedure called parsing? (Newbie) <support@bedroomisp.co.uk>
Re: javascript in perl CGI scripts. <thamus@my-deja.com>
Re: MS SQL & Perl <bart.lateur@skynet.be>
Need Help with a Regular Expression medi@cybershell.com
Re: Need Help with a Regular Expression <jeffp@crusoe.net>
Re: Need Help with a Regular Expression <thamus@my-deja.com>
Re: Newbie Question: Hiding password? drtsq@my-deja.com
NT4 - How do I display the current userid? <bill_border@agilent.com>
Perl DBD::ODBC compilation problem on Tru64 mshemer@my-deja.com
Re: Perl prototype for program in c <mjcarman@home.com>
Re: Perl prototype for program in c (Gwyn Judd)
Re: Perl vs. ActivePerl (newbie) (BUCK NAKED1)
Re: Perl vs. ActivePerl (newbie) <mjcarman@home.com>
Re: Problem converting data (second try with more info) <ren.maddox@tivoli.com>
Re: Pushing a hash on to a stack... (Mark-Jason Dominus)
Redirect a user by country ? <koeleman@cistron.nl>
Re: Redirect a user by country ? (Clay Irving)
Re: Redirect a user by country ? <koeleman@cistron.nl>
Re: Redirect a user by country ? tltt@my-deja.com
Re: Redirect a user by country ? <randy@theoryx5.uwinnipeg.ca>
this code uses cookies, but server still complains jawanth@att.net
Re: Tutorial on strings in perl? (Jon Ericson)
Use Eval to open file? <donv@webimpact.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 08 Nov 2000 22:57:16 GMT
From: "EM" <me@privacy.net>
Subject: how do i ask for input?
Message-Id: <gTkO5.2510$Nw6.7589@news.iol.ie>
I am using activeperl on windows
how do i ask for user input
like say i make a program that ask for a password
and i make a prompt "Please enter password:"
how do i allow the user to put in his password and put it in $password
Thanks in advance
Eric
------------------------------
Date: Wed, 08 Nov 2000 14:31:49 -0800
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: how to wait for a child to end
Message-Id: <3A09D455.E0892CCC@ipac.caltech.edu>
ghwen wrote:
>
> My script executes a ftp script in nohup mode and I'd like the first script
> to wait the end of transfert or kill the process after a delay.
> Thank you for your help
There was a thread on this topic just recently with excellent answers to this
question (and one mediocre answer: mine). Do a deja.com search and review that
thread.
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Wed, 08 Nov 2000 20:49:57 GMT
From: john_s_brown@my-deja.com
Subject: I do not Understand Perl Formats
Message-Id: <8uce9i$8jm$1@nnrp1.deja.com>
I have read through Programming Perl (3rd edition) chapter number 7,
which tells about Perl Formats. But still I don't understand even the
basics.
The book refers to the appropriate perldoc pages (write and format) and
the book's function list, but it is very difficult for me to understand
how formats work.
That is why I hereby ask you to spear a little bit of your time and try
to explane formats to me. The PP 3rd edition (in my humble opinion)
does not do a good work in explaining formats, because it just suddenly
jumps to an example and does not explaine it properly.
For example, I have no idea what are all these >>>>> and <<<<<
characters in the code and how can one assign a value to a variable
found inside a format!
The same example and the same text about Perl Formats are also found at
http://www.perl.com/.
I appreciate your help!
-John S. Brown.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Nov 2000 22:01:19 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: I do not Understand Perl Formats
Message-Id: <slrn90jj9e.lsv.clay@panix2.panix.com>
On Wed, 08 Nov 2000 20:49:57 GMT, john_s_brown@my-deja.com
<john_s_brown@my-deja.com> wrote:
>I have read through Programming Perl (3rd edition) chapter number 7,
>which tells about Perl Formats. But still I don't understand even the
>basics.
>
>The book refers to the appropriate perldoc pages (write and format) and
>the book's function list, but it is very difficult for me to understand
>how formats work.
>
>That is why I hereby ask you to spear a little bit of your time and try
>to explane formats to me. The PP 3rd edition (in my humble opinion)
>does not do a good work in explaining formats, because it just suddenly
>jumps to an example and does not explaine it properly.
>
>For example, I have no idea what are all these >>>>> and <<<<<
>characters in the code and how can one assign a value to a variable
>found inside a format!
>
>The same example and the same text about Perl Formats are also found at
>http://www.perl.com/.
>
>I appreciate your help!
Maybe this will help.
#!/usr/local/bin/perl -w
$string = "XXXXXXXXXXXXXXXXXXXXXX";
$~ = EXAMPLE;
write;
format EXAMPLE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$string
@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$string
.
Result
XXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXX
--
Clay Irving <clay@panix.com>
Philanthropy is the refuge of rich people who wish to annoy their fellow
creatures.
- Oscar Wilde
------------------------------
Date: Wed, 08 Nov 2000 20:44:36 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Is this procedure called parsing? (Newbie)
Message-Id: <3a09bb33.2e63$117@news.op.net>
Keywords: field, heliotrope, hemp, is
'Parsing' usually refers to the process of taking an unstructured
input and transforming it into a data structure. For example, on many
systems, an HTML file is represented (by the operating system) as a
simple sequence of characters. To assemble the characters into tags
and elements so that the structure of the file can be understood and
so that the file can be displayed, is a good eample of a parsing
process. A simpler example is the assembly of the characters in a
file into lines of text.
The process you suggest, of locating a certain segment of a file, is
indeed a parsing process of a very simple type. But searching for
'parsing' is unlikely to be helpful because most 'parsing' discussions
will refer to much more complicated processes.
>Many thanks
>
>Phil
>(a newbie for the last 10 months)
You're welcome
Dominus
(a newbie for the last 24 years)
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Wed, 8 Nov 2000 22:31:11 -0000
From: "Phil Latio" <support@bedroomisp.co.uk>
Subject: Re: Is this procedure called parsing? (Newbie)
Message-Id: <XpkO5.2559$y94.57817@stones>
Many thanks for your reply.
<nobull@mail.com> wrote in message news:u9vgtybafx.fsf@wcl-l.bham.ac.uk...
> "Phil Latio" <support@bedroomisp.co.uk> writes:
>
> > Is it possible to write a small perl program that will do the following:
> >
> > 1. Go to a text based file (no HTML in the document) on a web server
>
> LWP
>
> > 2. Find a particular text string
> > 3. Start capturing the text directly after this string
> > 4. Stop capturing text before another specified text string
>
> Pattern match
>
> > 5. Display this captured text on a webpage as an SSI
>
> CGI
>
> It would definitely straining the definition of parsing to consider
> steps 2-4 "ignore everything upto token1 then capture everything upto
> token2" to be parsing. However strictly speaking it is parsing.
>
> > I reckon this should be quite a simple task but I have searched the web
> > under "parsing" and not found any relevant help. It could be that I am
using
> > the wrong terminology for this procedure.
>
> You are. Parsing usually refers to a much more rigerous process of
> understanding the grammer on the input.
>
> The better thing to look for in such a simple case is "pattern matching".
>
> Of course another approach if you can't guess a suitable set of
> keywords is to manually look at _all_ the questions (not the answers)
> in the Perl FAQ and see if your question is "frequently asked".
> Admitedly, more often than not this won't find the solution, but even
> so you'll only have spent 5-10 minuites and this will be a valuable
> investment for the future. In this particualar case you'll also find
> your question _is_ "frequently asked"
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 08 Nov 2000 22:50:33 GMT
From: thamus <thamus@my-deja.com>
Subject: Re: javascript in perl CGI scripts.
Message-Id: <8uclbm$f65$1@nnrp1.deja.com>
In article <973639050.24885.0.nnrp-09.c1ed46c5@news.demon.co.uk>,
"steve" <home@aidans0.demon.co.uk> wrote:
Oops! In your BEGIN block:
">>C:\\perl\logs\mycgi-log.log"
Is not what it appears to be.
Try paths like:
">>C:/perl/logs/mycgi-log.log"
> #!perl -w
> BEGIN {
> use CGI::Carp qw(carpout);
> open(LOG, ">>C:\\perl\logs\mycgi-log.log") or
> die("Unable to open mycgi-log: $!\n");
> carpout(LOG);
> }
>
--
Tom Kliethermes 90% of people give the rest of us a bad name.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 08 Nov 2000 20:33:15 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: MS SQL & Perl
Message-Id: <20ej0tsda9ledil8id42drn36j0m0l9tlo@4ax.com>
Rich Parker wrote:
>2) I am running a plain vanilla WinNT 4.0 server with SQL 7.0 and Perl
>5.0.
I am sorry for the completely OR reply, but I can't let this pass just
by. Don't call this software "SQL 7.0"! You make it sound as if
Microsoft invented SQL, and/or makes the reference implementation. That
is, of course, the reason why MS chose this name, but no ordinary person
should support them in that. So, please please please, ALWAYS call it
"MS SQL Server", or "Microsoft SQL Server", but not plain and simple
"SQL"!
Heh. Bloody computer history revisionists.
--
Bart.
------------------------------
Date: Wed, 08 Nov 2000 21:10:32 GMT
From: medi@cybershell.com
Subject: Need Help with a Regular Expression
Message-Id: <8ucfg0$9os$1@nnrp1.deja.com>
I'm confused why my regular expression does'nt work, any ideas?
Here is the test code. The big picture is
I have defined a collection of RE pattersn such as $GramInt,
$GramFloat, etc. I then populate a hash with some test data
of all types; int, string, float, hex and simply iterate thru
and run them thru my parser.
$value{'int'} = 2345;
$value{'string'} = q{"some string"};
$value{'float'} = 23.45;
$value{'hex'} = '234AF';
$GramInt = '\d+';
$GramString = '".*"';
$GramFloat = '\d+\.\d+';
$GramHex = '[\da-zA-Z]+';
print "[$`][$&][$']\n" if ( $value{float} =~ /($GramFloat)/);
while(($k,$v) = each (%value))
{
$v =~ m/($GramInt)|($GramString)|($GramFloat)|($GramHex)/;
print "found [$`][$&][$'] in [$v]\n";
}
Here is what I get on the output
[][23.45][]
found []["Some String"][] in ["Some String"]
found [][23][.45] in [23.45]
found [][234][AF] in [234AF]
found [][2345][] in [2345]
Here is the problem
Note how the first line has successfully managed to capture the
float. In contrast when I'm looping thru the hash I don't match
the float correctly. Instead I get [][23][.45]. ie the matched
and post-matched are wrong. Similarly the hex part does not
work. Int and String are doing their job correctly.
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 8 Nov 2000 16:42:34 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Need Help with a Regular Expression
Message-Id: <Pine.GSO.4.21.0011081638550.11113-100000@crusoe.crusoe.net>
[posted & mailed]
On Nov 8, medi@cybershell.com said:
>$GramInt = '\d+';
>$GramFloat = '\d+\.\d+';
> $v =~ m/($GramInt)|($GramString)|($GramFloat)|($GramHex)/;
>found [][23][.45] in [23.45]
>found [][2345][] in [2345]
(You should REALLY try not to use the $` and $& and $' variables...)
The problem is that you're doing:
/$GramInt|$GramFloat/
Watch:
$num = 123.456;
($match) = $num =~ /(\d+|\d+\.\d+)/;
print $match; # '123'
($match) = $num =~ /(\d+\.\d+|\d+)/;
print $match; # '123.456'
See, Perl will see that '123' matches \d+, but '123.' does NOT match
\d+. But that's ok, since it's already matched '123', so it thinks it's
done. If you ask for the more specific match first -- \d+\.\d+ -- then it
will work as expected.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Wed, 08 Nov 2000 22:26:30 GMT
From: thamus <thamus@my-deja.com>
Subject: Re: Need Help with a Regular Expression
Message-Id: <8ucjud$dv2$1@nnrp1.deja.com>
Try adding the following line to your while loop
after the RE
print "DEBUG: \$1=$1, \$2=$2, \$3=$3, \$4=$4\n";
Your RE for ints is gobbling up the float.
You could try some "\b"'s a few "?"'s go along
way too (or actually a short way?).
Hope this helps,
-Tom
In article <8ucfg0$9os$1@nnrp1.deja.com>,
medi@cybershell.com wrote:
> I'm confused why my regular expression does'nt work, any ideas?
>
> Here is the test code. The big picture is
>
> I have defined a collection of RE pattersn such as $GramInt,
> $GramFloat, etc. I then populate a hash with some test data
> of all types; int, string, float, hex and simply iterate thru
> and run them thru my parser.
>
> $value{'int'} = 2345;
> $value{'string'} = q{"some string"};
> $value{'float'} = 23.45;
> $value{'hex'} = '234AF';
>
> $GramInt = '\d+';
> $GramString = '".*"';
> $GramFloat = '\d+\.\d+';
> $GramHex = '[\da-zA-Z]+';
>
> print "[$`][$&][$']\n" if ( $value{float} =~ /($GramFloat)/);
>
> while(($k,$v) = each (%value))
> {
> $v =~ m/($GramInt)|($GramString)|($GramFloat)|($GramHex)/;
> print "found [$`][$&][$'] in [$v]\n";
> }
>
> Here is what I get on the output
>
> [][23.45][]
> found []["Some String"][] in ["Some String"]
> found [][23][.45] in [23.45]
> found [][234][AF] in [234AF]
> found [][2345][] in [2345]
>
> Here is the problem
>
> Note how the first line has successfully managed to capture the
> float. In contrast when I'm looping thru the hash I don't match
> the float correctly. Instead I get [][23][.45]. ie the matched
> and post-matched are wrong. Similarly the hex part does not
> work. Int and String are doing their job correctly.
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
Tom Kliethermes 90% of people give the rest of us a bad name.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 08 Nov 2000 19:07:09 GMT
From: drtsq@my-deja.com
Subject: Re: Newbie Question: Hiding password?
Message-Id: <8uc88m$2s1$1@nnrp1.deja.com>
Look into PGP.
PGP is inexpensive public key encryption. Your script can call PGP
which can encrypt your data. It uses a public key rather than a
password to encrypt to. You can encrypt all you like without the
password. But when you wish to DEcrypt, then you need the password.
You said you want to 'zip'-- PGP won't zip, but you can use PGP on a
zipped file, or any other file.
In article <8u7iqg$9f1$1@nnrp1.deja.com>,
na0ise@my-deja.com wrote:
> Hi all,
>
> I am writing a perl script that reads data from a webform. I want to
zip
> the data I read with a password. I do not want to put the password in
> plain text inside the Perl script. Is there a more secure way to
achieve
> my purpose? Any helps will be greatly appreciated.
>
> Thanks
> Naoise. C
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 8 Nov 2000 14:48:26 -0700
From: "Bill Border" <bill_border@agilent.com>
Subject: NT4 - How do I display the current userid?
Message-Id: <8uchnf$f7k$1@nonews.col.hp.com>
Hi All,
I am running a Perl pgm that is invoked from a unix server (with
the resource kit rsh nt daemon) and in order to get an ODBC
Oracle application to work, I need to know what USERID it my
task is running under.
The $> variable returns 0. ??????
Thanks,
Bill
------------------------------
Date: Wed, 08 Nov 2000 22:37:31 GMT
From: mshemer@my-deja.com
Subject: Perl DBD::ODBC compilation problem on Tru64
Message-Id: <8uckja$egt$1@nnrp1.deja.com>
Hi -
I was hoping that someone would have a suggestion for the compilation problem
I'm having with Perl's DBD::ODBC module. The OS of the machine I'm on is
Tru64 OSF1 V5.0.
First, I have successfully installed the OpenLink software (Universal Data
Access Drivers Multi-Tier Editon and SDK). I have also tested it using the
odbctest and can successfully run SQL statements against the remote server.
Next, I have successfully installed the Perl DBI module.
Finally though, when trying to install the Perl DBD::ODBC module I get the
compilation errors saying that semicolons are missing from the isql.h and
isqlext.h files. (I'm including the perl Makefile.PL output and make output
at the end of this article)
Please let me know if you have any idea why this is happening and how to fix
it.
Thanks,
Mike
Michael Hemer
michael.hemer@cleardata.net
Output from Perl Module DBD::ODBC compilation:
$ perl Makefile.PL
Configuring DBD::ODBC ...
>>> Remember to actually *READ* the README file!
And re-read it if you have any problems.
Using DBI 1.14 installed in
/usr/lib/perl-5.004/lib/site_perl/alpha-dec_osf/auto/DBI
Using ODBC in /usr/users/improv/openlink/odbcsdk
Umm, this looks like a iodbc type of driver manager.
We expect to find the isql.h, isqlext.h and iodbc.h files (which were
supplied with iODBC) in $ODBCHOME/include directory alongside
the /usr/users/improv/openlink/odbcsdk/lib/libiodbc.a
/usr/users/improv/openlink/odbcsdk/lib/libiodbc.so library.
Checking if your kit is complete...
Looks good
Using DBI 1.14 installed in
/usr/lib/perl-5.004/lib/site_perl/alpha-dec_osf/auto/DBI
Writing Makefile for DBD::ODBC
The DBD::ODBC tests will use these values for the database connection:
DBI_DSN=dbi:ODBC:link e.g. dbi:ODBC:demo
DBI_USER=xxxxx
DBI_PASS=xxxxx
$ make
mkdir ./blib
mkdir ./blib/lib
mkdir ./blib/lib/DBD
mkdir ./blib/arch
mkdir ./blib/arch/auto
mkdir ./blib/arch/auto/DBD
mkdir ./blib/arch/auto/DBD/ODBC
mkdir ./blib/lib/auto
mkdir ./blib/lib/auto/DBD
mkdir ./blib/lib/auto/DBD/ODBC
mkdir ./blib/man3
cp ODBC.pm ./blib/lib/DBD/ODBC.pm
/bin/perl -p -e "s/~DRIVER~/ODBC/g" <
/usr/lib/perl-5.004/lib/site_perl/alpha-dec_osf/auto/DBI/Driver.xst >
ODBC.xsi
/bin/perl -I/usr/lib/perl-5.004/lib/alpha-dec_osf/5.00404
-I/usr/lib/perl-5.004/lib /usr/lib/perl-5.004/lib/ExtUtils/xsubpp
-typemap /usr/lib/perl-5.004/lib/ExtUtils/typemap ODBC.xs >ODBC.tc && mv
ODBC.tc ODBC.c
cc -c -I. -I/usr/lib/perl-5.004/lib/site_perl/alpha-dec_osf/auto/DBI
-fprm d -ieee -std -D__LANGUAGE_C__ -O4 -DVERSION=\"0.28\"
-DXS_VERSION=\"0.28\"
-I/usr/lib/perl-5.004/lib/alpha-dec_osf/5.00404/CORE
-I/usr/users/improv/openlink/odbcsdk/include ODBC.c
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 10:
Missing ";". (nosemi)
typedef void FAR *PTR;
-----------------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 11:
Missing ";". (nosemi)
typedef void FAR *HENV;
-----------------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 12:
Missing ";". (nosemi)
typedef void FAR *HDBC;
-----------------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 13:
Missing ";". (nosemi)
typedef void FAR *HSTMT;
-----------------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 151:
Missing ";". (nosemi)
RETCODE SQL_API SQLAllocConnect (HENV henv, HDBC FAR * phdbc);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 152:
Missing ";". (nosemi)
RETCODE SQL_API SQLAllocEnv (HENV FAR * phenv);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 153:
Missing ";". (nosemi)
RETCODE SQL_API SQLAllocStmt (HDBC hdbc, HSTMT FAR * phstmt);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 154:
Missing ";". (nosemi)
RETCODE SQL_API SQLBindCol (HSTMT hstmt, UWORD icol, SWORD fCType,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 156:
Missing ";". (nosemi)
RETCODE SQL_API SQLCancel (HSTMT hstmt);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 157:
Missing ";". (nosemi)
RETCODE SQL_API SQLColAttributes (HSTMT hstmt, UWORD icol, UWORD
fDescType,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 159:
Missing ";". (nosemi)
RETCODE SQL_API SQLConnect (HDBC hdbc, UCHAR FAR * szDSN, SWORD cbDSN,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 161:
Missing ";". (nosemi)
RETCODE SQL_API SQLDescribeCol (HSTMT hstmt, UWORD icol,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 165:
Missing ";". (nosemi)
RETCODE SQL_API SQLDisconnect (HDBC hdbc);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 166:
Missing ";". (nosemi)
RETCODE SQL_API SQLError (HENV henv, HDBC hdbc, HSTMT hstmt,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 169:
Missing ";". (nosemi)
RETCODE SQL_API SQLExecDirect (HSTMT hstmt, UCHAR FAR * szSqlStr,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 171:
Missing ";". (nosemi)
RETCODE SQL_API SQLExecute (HSTMT hstmt);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 172:
Missing ";". (nosemi)
RETCODE SQL_API SQLFetch (HSTMT hstmt);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 173:
Missing ";". (nosemi)
RETCODE SQL_API SQLFreeConnect (HDBC hdbc);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 174:
Missing ";". (nosemi)
RETCODE SQL_API SQLFreeEnv (HENV henv);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 175:
Missing ";". (nosemi)
RETCODE SQL_API SQLFreeStmt (HSTMT hstmt, UWORD fOption);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 176:
Missing ";". (nosemi)
RETCODE SQL_API SQLGetCursorName (HSTMT hstmt, UCHAR FAR * szCursor,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 178:
Missing ";". (nosemi)
RETCODE SQL_API SQLNumResultCols (HSTMT hstmt, SWORD FAR * pccol);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 179:
Missing ";". (nosemi)
RETCODE SQL_API SQLPrepare (HSTMT hstmt, UCHAR FAR * szSqlStr,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 181:
Missing ";". (nosemi)
RETCODE SQL_API SQLRowCount (HSTMT hstmt, SDWORD FAR * pcrow);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 182:
Missing ";". (nosemi)
RETCODE SQL_API SQLSetCursorName (HSTMT hstmt, UCHAR FAR * szCursor,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 184:
Missing ";". (nosemi)
RETCODE SQL_API SQLTransact (HENV henv, HDBC hdbc, UWORD fType);
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isql.h, line 189:
Missing ";". (nosemi)
RETCODE SQL_API SQLSetParam (HSTMT hstmt, UWORD ipar, SWORD fCType,
----------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isqlext.h, line
1052: Missing ";". (nosemi)
RETCODE SQL_API SQLColumns (HSTMT hstmt, UCHAR FAR * szTableQualifier,
--------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isqlext.h, line
1056: Missing ";". (nosemi)
RETCODE SQL_API SQLDriverConnect (HDBC hdbc, HWND hwnd,
--------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isqlext.h, line
1059: Missing ";". (nosemi)
RETCODE SQL_API SQLGetConnectOption (HDBC hdbc, UWORD fOption, PTR
pvParam);
--------^
cc: Error: /usr/users/improv/openlink/odbcsdk/include/isqlext.h, line
1060: Missing ";". (nosemi)
RETCODE SQL_API SQLGetData (HSTMT hstmt, UWORD icol, SWORD fCType,
--------^
cc: Severe: More than 30 errors were encountered in the course of
compilation. (toomanyerr)
*** Exit 1
Stop.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 08 Nov 2000 12:11:45 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Perl prototype for program in c
Message-Id: <3A099761.3511066C@home.com>
Milan Miladinovic wrote:
>
> Be shocked on the other place!
> Here is people who need help. I'm asking only to give me right way to
> resolve my problem... like the others do.
People are entitled to help whomever they please, but most of the people
here (the ones worth listening to, anyway) scoff at the idea of doing
someone's work for them, especially homework. Your teacher gives you an
assignment to help you learn. What do you learn from someone here giving
you the answer?
We here at c.l.p.misc like to help people with real problems (not
exercises) who have demonstrated that they have made a real effort to
help themselves and are stuck. We dislike those too lazy to do so.
The right way to resolve your problem is to start doing some research.
Do you have some sort of text on Perl? Read it. Read the documentation
that comes with Perl. Think about how you do basic things in each
language. How are they the same? How are they different? Exercise your
brain, man!
-mjc
------------------------------
Date: Wed, 08 Nov 2000 21:11:06 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Perl prototype for program in c
Message-Id: <slrn90jgb8.mk2.tjla@thislove.dyndns.org>
I was shocked! How could Milan Miladinovic <vortex@ptt.yu>
say such a terrible thing:
> Hello
>I need help once more.
>If this message posted twice, I'm sorry, because my brawser is ill.
It's not only ill, it's miss-spelled :) What's your teachers email
address? Can we email him and tell him you are trying to cheat?
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
In Boston, it is illegal to hold frog-jumping contests in nightclubs.
------------------------------
Date: Wed, 8 Nov 2000 13:24:23 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Perl vs. ActivePerl (newbie)
Message-Id: <1968-3A09A867-14@storefull-241.iap.bryant.webtv.net>
Will perl work correctly if Active Perl is installed into a local
directory on a Unix Server?
Regards,
Dennis
------------------------------
Date: Wed, 08 Nov 2000 15:11:32 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Perl vs. ActivePerl (newbie)
Message-Id: <3A09C184.B9544603@home.com>
BUCK NAKED1 wrote:
>
> Will perl work correctly if Active Perl is installed into a local
> directory on a Unix Server?
If your question is "Can I run perl via a network?" the answer is yes.
You do not have to install it on your local machine.
If your question is "Can I run a Win* binary on a *nix machine?" the
answer is "Of course not. What the h*ll are you thinking?" ;)
-mjc
------------------------------
Date: 08 Nov 2000 13:24:15 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Problem converting data (second try with more info)
Message-Id: <m3r94mmfmo.fsf@dhcp11-177.support.tivoli.com>
"P.A.G. Heinsbroek" <peter.heinsbroek@siemens.nl> writes:
> I have a variable containing a binairy/hex value 07cf
> This is representing the year 1999
> How kan I print this variable so that it says "1999"
>
> The data looks like this
> 0000 30 31 30 34 38 39 36 34 33 30 30 31 20 20 20 20
>
> 0010 20 20 20 20 20 20 20 20 20 20 20 20 07 cf 00 01
-----
>
> I already tried hex and unpack and printf
> head -1 file | test.pl |hd ----> 0000 30 0a
> 0.
>
> #!/usr/bin/perl -w
>
> while (<>)
> {
> #$ident = substr($_,0,28) ;
> $date1 = substr($_,28,2) ;
> $num = hex $date1 ;
> print $num."\n";
> }
The problem is that hex will convert the string "07cf" to "1999", but
you don't have the string "07cf". Instead, you have a two-character
string consisting of the characters \x07 and \xcf. This is a short,
though not on all architectures. It is also a network short,
independent of architecture. I'm not sure which is more appropriate
for your needs, as I do not know if your data is architecture specific
or not.
To extract typed data from a string, use unpack:
print unpack "n", $date1; # use "s" instead of "n" for arch-specific
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 08 Nov 2000 20:40:08 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Pushing a hash on to a stack...
Message-Id: <3a09ba27.2e20$28c@news.op.net>
Keywords: Rockefeller, involuntary, passer, phonon
In article <Pine.GSO.4.21.0011081010110.11113-100000@crusoe.crusoe.net>,
Jeff Pinyan <japhy@pobox.com> wrote:
>It can be done without references, and I fear for my life for displaying
>such a horrid and ugly solution here:
I thought about suggesting that, but it violated another one of
Christopher Burke's specific requirements:
Christopher Burke (the original poster) demanded:
>> print $fulldata[0]{X}."\n";
and the solution you showed doesn't do this.
Since I didn't want to receive any more of Christopher's scorn for
ignoring his stated requirements, I didn't mention anything like this.
I admire you for your bravery.
I still don't believe it can be done without references, and I'm
looking forward to Christopher's solution, or to his failure to
produce one.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Wed, 8 Nov 2000 21:36:36 +0100
From: "Erik" <koeleman@cistron.nl>
Subject: Redirect a user by country ?
Message-Id: <8ucdb3$d20$1@voyager.cistron.net>
Hello,
I'm looking for a perl script that redirect a user by country when they
arive on my site...
Can someone help me with that?
Erik
------------------------------
Date: 8 Nov 2000 20:48:05 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Redirect a user by country ?
Message-Id: <slrn90jf05.iqv.clay@panix2.panix.com>
On Wed, 8 Nov 2000 21:36:36 +0100, Erik <koeleman@cistron.nl> wrote:
>I'm looking for a perl script that redirect a user by country when they
>arive on my site...
>Can someone help me with that?
How are you going to know which country a user's request originates?
--
Clay Irving <clay@panix.com>
RECONSIDER, v. To seek a justification for a decision already made.
- Ambrose Bierce
------------------------------
Date: Wed, 8 Nov 2000 22:26:57 +0100
From: "Erik" <koeleman@cistron.nl>
Subject: Re: Redirect a user by country ?
Message-Id: <8ucg9m$peo$1@voyager.cistron.net>
Looking to the domain-extension from their ISP
.com/.net etc.. > English
.nl > Dutch
.fr > French
Etc...
"Clay Irving" <clay@panix.com> schreef in bericht
news:slrn90jf05.iqv.clay@panix2.panix.com...
> On Wed, 8 Nov 2000 21:36:36 +0100, Erik <koeleman@cistron.nl> wrote:
>
> >I'm looking for a perl script that redirect a user by country when they
> >arive on my site...
> >Can someone help me with that?
>
> How are you going to know which country a user's request originates?
>
> --
> Clay Irving <clay@panix.com>
> RECONSIDER, v. To seek a justification for a decision already made.
> - Ambrose Bierce
------------------------------
Date: Wed, 08 Nov 2000 22:22:22 GMT
From: tltt@my-deja.com
Subject: Re: Redirect a user by country ?
Message-Id: <8ucjml$dqt$1@nnrp1.deja.com>
Clay Irving wrote:
> How are you going to know which country a user's request originates?
Well, the information is out there (although I doubt if this is what the
OP had in mind):
http://www.quova.com/
tltt
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Nov 2000 22:52:47 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Redirect a user by country ?
Message-Id: <8uclfv$hp2$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Erik <koeleman@cistron.nl> wrote:
> "Clay Irving" <clay@panix.com> schreef in bericht
> news:slrn90jf05.iqv.clay@panix2.panix.com...
>> On Wed, 8 Nov 2000 21:36:36 +0100, Erik <koeleman@cistron.nl> wrote:
>>
>> >I'm looking for a perl script that redirect a user by country when they
>> >arive on my site...
>> >Can someone help me with that?
>>
>> How are you going to know which country a user's request originates?
>>
> Looking to the domain-extension from their ISP
> .com/.net etc.. > English
> .nl > Dutch
> .fr > French
What about, eg, http://www.nl.uu.net/?
best regards,
randy kobes
------------------------------
Date: Wed, 08 Nov 2000 19:58:04 GMT
From: jawanth@att.net
Subject: this code uses cookies, but server still complains
Message-Id: <8ucb86$5nq$1@nnrp1.deja.com>
I use the HTTP methods to set and load cookies(Netscape) before I send
the request using the get method.
The server still complains that my browser does not accept cookies.
Why is this so and what can I do to make this work ?
#### code cliver looks like this......
$cookiejar= HTTP::Cookies::Netscape->new( file => "C:/Program\
Files/Netscape/Users/default/cookies.txt", autosave => 1 );
$cookiejar->load("C:/Program\
Files/Netscape/Users/default/cookies.txt");
############ initailaize cookie-jar ####################
############ Piggybacking on cookies created by Netscape during login
############ sequence.
########### print debug satement #############################
print $cookiejar->as_string(1);
############ cookie jar is now loaded and initialized ########
$request=HTTP::Request->new(GET => "$url_string");
########## add cookie header so that server wont complain, hopefully
$cookiejar->add_cookie_header($request);
######### Now get the content by going over the net...
$response= $ua->request($request);
$html_source=$response->content;
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Nov 2000 22:33:50 GMT
From: Jonathan.L.Ericson@jpl.nasa.gov (Jon Ericson)
Subject: Re: Tutorial on strings in perl?
Message-Id: <8FE69B56FJonathanLEricsonjpln@137.78.50.25>
On 07 Nov 2000, klimetschek@t-online.de (Alex) wrote:
>Where can I find a good and comprehensive tutorial or faq for the handling
>and working with strings in perl?
'perldoc -q string'?
Jon
------------------------------
Date: Wed, 08 Nov 2000 17:02:30 -0500
From: Don Vaillancourt <donv@webimpact.com>
Subject: Use Eval to open file?
Message-Id: <3A09CD76.AD078BAC@webimpact.com>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I wrote a database application that creates and opens all its required
files at the beginning. These files include the table file and the
indexes. The problem is that I don't know how many indexes there
are. And using the same file handle to open a file and assigning
that handle to a list does not work because each successive opens uses
the same variable reference.
<p>So I tried using eval to open a file and to generate a unique file handle
every single time. Below is an example.
<p>$index_number is the number of the index which is never the same.
<br>$table is the name of the index table.
<p>The following code seems to work, but only for certain occasions.
It may be a bug in the code, but I do not think so, because prior to using
this method, everything worked as expected but with only one index.
<p>my $evaluation = "open(INDEX_HANDLE_$index_number, \"+<$table\");
my \$index_handle=*INDEX_HANDLE_$index_number; return \$index_handle;";
<br>my $index_handle = eval $evaluation;
<br>
<br> </html>
------------------------------
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 4848
**************************************