[21960] in Perl-Users-Digest
Perl-Users Digest, Issue: 4182 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 26 18:05:44 2002
Date: Tue, 26 Nov 2002 15:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 26 Nov 2002 Volume: 10 Number: 4182
Today's topics:
Apache/MySQL/DBI problem (Lord V)
back quotes in NT (Marc)
Re: back quotes in NT <pkent77tea@yahoo.com.tea>
Re: back quotes in NT <nospam@nospam.com>
Re: Converting UTF-8 to ISO-8859-1 (Francesco Moi)
DBI question... (joel)
Re: DBI question... <nospam@nospam.com>
Re: DBI question... <pkent77tea@yahoo.com.tea>
GDGraph module <knjaz@hotmail.com>
Re: HELP! --> "Can't call method prepare!" <pkent77tea@yahoo.com.tea>
How do I find sendmail path? <bbsouth@bellsouth.net>
Re: How do I find sendmail path? (Walter Roberson)
how do I uninstall old version of Perl? (Matt Oefinger)
Re: IP and Host differences <ian@WINDOZEdigiserv.net>
Re: IP and Host differences (Tad McClellan)
Re: IP and Host differences <ian@WINDOZEdigiserv.net>
Re: IP and Host differences (Tad McClellan)
Re: IP and Host differences <ian@WINDOZEdigiserv.net>
LWP::UserAgent does not return a Response ?? <stuart.flowers@t-online.de>
Re: mozilla & netscape. incapable of CSS word-break ? <ian@WINDOZEdigiserv.net>
need help assigning reference numbers (flinky)
Re: need help assigning reference numbers (Walter Roberson)
Re: need help assigning reference numbers <nobody@dev.null>
One more question about sockets... <extendedpartition@NOSPAM.yahoo.com>
Re: Order of return trap <eighner@io.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Nov 2002 15:02:05 -0800
From: lordvee@tin.it (Lord V)
Subject: Apache/MySQL/DBI problem
Message-Id: <64fe533f.0211261502.3c5eca9e@posting.google.com>
Hi,
I have a script that connects to MySQL and checks for login and pw.
the thing is that when i try to log in with a name that's not in the
database row i get a:
"Premature end of script headers: /usr/lib/cgi-bin/reg.cgi"
I read somewhere that the above is a compile time error, so i'm trying
to get the picture clear about what could be wrong. Any quick clue?
using perl -wT doesn't give out any new info, while using "use
strict;" makes a infinite serie of warnings...
If the login name exists, the script keeps on running the way it's
supposed to.
Any hint would be greatly apreciated :)))
This is the relevant part of it:
--
elsif ($in{'loginscript'} ne "") {
my $dbh = DBI->connect("DBI:mysql:utenti_registrati", $user,
$pwd) or print "Impossibile connettersi al database: " . DBI->errstr;
my $verifica_utente = $dbh -> prepare('SELECT * FROM
dati_personali WHERE login = ?');
$verifica_utente -> execute($in{'nomelog'}) or die "Per
ragioni tecniche il riconoscimento non puo' avvenire. Codice di
errore: " . $verifica_utente -> errstr;
while (@dati_pers = $verifica_utente->fetchrow_array){
if ($dati_pers[5] eq $in{'parola'}) {
&print_header;
&pagesetup("Pagina di Login");
print "<h5>Buongiorno
",ucfirst($dati_pers[0]),"</h5>";
&pageclose;
}
else {
&errore("Riconoscimento non avvenuto!
Controlla che login e password siano immessi correttamente!");
exit;
}
}
$verifica_utente->finish;
$dbh -> disconnect;
exit;
--
Valerio M.
------------------------------
Date: 26 Nov 2002 13:27:13 -0800
From: brownjenkn@aol.com (Marc)
Subject: back quotes in NT
Message-Id: <28b74d11.0211261327.aaa67d3@posting.google.com>
Hi all,
Please advise this newbie. I have a small perl script that calls an
executable. e.g.
...
system "some.exe";
...
There's been some problems on our network where processes weren't
getting properly terminated and it's been suggested, for shell
execution, to move to back quotes rather than the system() command.
Problem is, `some.exe`, doesn't appear to be recognized in my script.
However, print `some.exe` seems to work okay.
I'm in NT so I'm not certain if the problem is there. And, is there
anything wrong with using "print" as a hackey way to fix the problem?
Thanks. Marc
------------------------------
Date: Tue, 26 Nov 2002 22:45:41 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: back quotes in NT
Message-Id: <pkent77tea-36F4AE.22453726112002@news-text.blueyonder.co.uk>
In article <28b74d11.0211261327.aaa67d3@posting.google.com>,
brownjenkn@aol.com (Marc) wrote:
> Problem is, `some.exe`, doesn't appear to be recognized in my script.
> However, print `some.exe` seems to work okay.
On all my copies of perl locally these two are "recognized":
`ls`;
# and
print `ls`;
although, of course, they do slightly different things. AFAIK you only
need to use qx() or `` when you want to capture the output of a command.
So, if you want the oputput of the command use qx(), if you don't then
use system().
What's the exact error message you got? I had some problems when trying
to exec() and system() single-argument command lines that contained
spaces in the command name, for example. If you give us the exact error
message and your example code other users of perl on windows can
recognise the problem you'regetting and suggest what could fix it. AIUI
forking any kind of process is done quite differently on windows
compared to unix.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 26 Nov 2002 14:58:53 -0800
From: "Tan Nguyen" <nospam@nospam.com>
Subject: Re: back quotes in NT
Message-Id: <3de3fc0f_2@nopics.sjc>
"Marc" <brownjenkn@aol.com> wrote in message
news:28b74d11.0211261327.aaa67d3@posting.google.com...
> There's been some problems on our network where processes weren't
> getting properly terminated and it's been suggested, for shell
> execution, to move to back quotes rather than the system() command.
Well, I don't think eliminate the use of "system" will solve the problem.
Could you be more specific about the problem?
> Problem is, `some.exe`, doesn't appear to be recognized in my script.
> However, print `some.exe` seems to work okay.
BTW, they're called backticks. Make sure you appropriately call the
executable.(ie. escaping backslashes, giving correct path etc.)
------------------------------
Date: 26 Nov 2002 13:54:29 -0800
From: francescomoi@europe.com (Francesco Moi)
Subject: Re: Converting UTF-8 to ISO-8859-1
Message-Id: <5b829932.0211261354.2631528d@posting.google.com>
Thank you, Bart, for answering.
I've got 5.006001 version installed on my server. Do you know
any routine?
Thank you very much.
Bart Lateur <bart.lateur@pandora.be> wrote in message news:<ghb5uu47659im148g961lulnmg41iirrag@4ax.com>...
> Francesco Moi wrote:
>
> >Does anybody have any routine/function to convert a string from UTF-8
> >to ISO-8859-1 by using Perl?
>
> Yes. What version of Perl? Sadly enough, the best way to do it is
> largely dependent on the perl version: Pre-5.6 needs manual conversion,
> 5.6 has some pack/unpack tricks up its sleeve, and 5.8 allegedly has a
> nice conversion module (but I forgot the name... Encode? I think it is).
------------------------------
Date: 26 Nov 2002 14:10:33 -0800
From: jarmenta@espiritu.org (joel)
Subject: DBI question...
Message-Id: <4dc11ecd.0211261410.22e480d9@posting.google.com>
Hi, I'm getting ready to interface to a MySQL database using the DBI
module. I downloaded DBI from CPAN but I'm not sure if I have to
compile it to use it. If somebody has a compiled version... Any answer
would be apreciated.
------------------------------
Date: Tue, 26 Nov 2002 14:53:04 -0800
From: "Tan Nguyen" <nospam@nospam.com>
Subject: Re: DBI question...
Message-Id: <3de3fab2$1_5@nopics.sjc>
"joel" <jarmenta@espiritu.org> wrote in message
news:4dc11ecd.0211261410.22e480d9@posting.google.com...
> Hi, I'm getting ready to interface to a MySQL database using the DBI
> module. I downloaded DBI from CPAN but I'm not sure if I have to
> compile it to use it. If somebody has a compiled version... Any answer
> would be apreciated.
Take a look at README. It should tell you what to do.
------------------------------
Date: Tue, 26 Nov 2002 22:50:59 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: DBI question...
Message-Id: <pkent77tea-2E6176.22505626112002@news-text.blueyonder.co.uk>
In article <4dc11ecd.0211261410.22e480d9@posting.google.com>,
jarmenta@espiritu.org (joel) wrote:
> Hi, I'm getting ready to interface to a MySQL database using the DBI
> module. I downloaded DBI from CPAN but I'm not sure if I have to
> compile it to use it. If somebody has a compiled version... Any answer
> would be apreciated.
I've certainly seen compiled versions around. I'm _sure_ that the Win32
DBI stuff was all binary. There are binaries for MacOS aswell. If you
have a Unix-like system building the DBI from CPAN is pretty simple
(unless you don't have the same C compiler that perl was built with, I
believe, like the perl that comes with solaris 9 (?) which was built
with Sun's cc that costs money).
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 26 Nov 2002 16:14:26 -0600
From: "Mick Z." <knjaz@hotmail.com>
Subject: GDGraph module
Message-Id: <uu7si2qrf36d16@corp.supernews.com>
I am experimenting with the GD Graph module in creating a Bar Chart.
The following code produces a 3 column bar chart, but I cannot get the
columns to have different colors. They are all being set to the first value
in the 'dclrs' array. Any ideas?
use strict;
use GD::Graph::bars;
use GD::Graph::hbars;
use GD::Graph::Data;
require 'save.pl';
my $data = GD::Graph::Data->new([
["1ST","2ND","3ND"],
[100,200,150],
]);
{
my $name = "TEST";
my $my_graph = GD::Graph::bars->new;
$my_graph->set(
'dclrs' => [ qw(lblue lyellow blue) ] ,
'title' => "Test Bar Chart" ,
'x_label' => "X" ,
'y_label' => "Y" ,
'long_ticks' => 1 ,
'tick_length' => 0 ,
'x_ticks' => 0 ,
'x_label_position' => .5 ,
'y_label_position' => .5 ,
'cumulate' => 2 ,
'bgclr' => 'white' ,
'transparent' => 0 ,
'accent_treshold' => 100_000
);
$my_graph->plot($data);
save_chart($my_graph, $name);
}
------------------------------
Date: Tue, 26 Nov 2002 22:58:57 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: HELP! --> "Can't call method prepare!"
Message-Id: <pkent77tea-B393A2.22585426112002@news-text.blueyonder.co.uk>
In article <27ad91d2.0211260730.45c78b7c@posting.google.com>,
dave_h4@yahoo.com (Hunter) wrote:
> I need to do an INSERT foreach line in a text file. There are only two
> values in the files, separeted by |
> The error I am getting is:
> "Can't call method "prepare" on an undefined value at ./inputD.run line 52,
> <ADDFILE> chunk 75."
You check whether $sth is true, but you don't check $dbh is true before
calling a method on it. Use the $dbh->ping method if the database handle
exists, and defined(), ref() or just '||' to check that $dbh is actually
something.
> &connectPgDB();
I suspect that this routine is supposed to set $dbh, but doesn't. Maybe:
$dbh = new DBI( blah blah ) or die "blah $DBI::errstr blah";
would help? Check out the PrintError and RaiseError settings too in the
constructor. Also, lose the '&' as it's Ye Old Perl Style :-)
> # did I get a file on the command line ?
> if ($ARGV[0] eq '-f') {
You may also like to use Getopt::Std or Getopt::Long - both part of the
stabndard distro. Very useful command line parsing.
> $sql = "INSERT INTO acronyms (acry, titl)
> VALUES ($one, $two)";
>
> $sth = $dbh->prepare($sql) || die "prepare: $stmt: $DBI::errstr";
> $sth->execute || die "execute: $sql: $DBI::errstr";
You might also want to use placeholder values here. I would prepare the
statment once, outside the loop, then execute it once for each valid
line in the file.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 26 Nov 2002 13:42:43 -0600
From: "Brett" <bbsouth@bellsouth.net>
Subject: How do I find sendmail path?
Message-Id: <6WPE9.13968$sT3.4058@news.bellsouth.net>
I'm running Perl on Win2k Server. I need to know the path to the sendmail
program for a CGI app. I'm not even sure which mail prog Perl might be
using. I only installed Perl for this one CGI app.
Thanks,
Brett
------------------------------
Date: 26 Nov 2002 20:06:40 GMT
From: roberson@ibd.nrc.ca (Walter Roberson)
Subject: Re: How do I find sendmail path?
Message-Id: <as0k8g$bsm$1@canopus.cc.umanitoba.ca>
In article <6WPE9.13968$sT3.4058@news.bellsouth.net>,
Brett <bbsouth@bellsouth.net> wrote:
:I'm running Perl on Win2k Server. I need to know the path to the sendmail
:program for a CGI app. I'm not even sure which mail prog Perl might be
:using. I only installed Perl for this one CGI app.
sendmail isn't usually installed on Win2K server. You will likely
have to install it yourself.
You might perhaps not need sendmail: there are perl SMTP modules that
send email directly. If, though, you are using a pre-written
module and it requires sendmail, you should probably do a
double-check to ensure that the module is supported under NT.
--
Studies show that the average reader ignores 106% of all statistics
they see in .signatures.
------------------------------
Date: 26 Nov 2002 12:39:38 -0800
From: oefinger@mit.edu (Matt Oefinger)
Subject: how do I uninstall old version of Perl?
Message-Id: <e9b08c9f.0211261239.63fbef7c@posting.google.com>
For some reason when I invoked the CPAN module to retrieve and install
a WWW module the CPAN module decided to install a new version of Perl.
I now have two versions of Perl on my system (5.6.0 and 5.8.0) and
there is some serious contamination. I'd like to uninstall one or both
versions and start over. How do I uninstall?
Thanks,
matt
------------------------------
Date: Tue, 26 Nov 2002 20:27:31 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: IP and Host differences
Message-Id: <39m7uu860du3is89ea2l2vvkm4ffeg69rn@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Tue, 26 Nov 2002 09:03:25 -0600,
tadmc@augustmail.com (Tad McClellan) managed to scribble:
> Marc Rasell <mrasell@hotmail.com> wrote:
> > I'm working on a hit counter. In the logs I record date, IP and
> > Host. Sometimes I can get the same IP and Date with a different
> > Host name. I'm running the counter to records unique IP and Host
> > per day. Would a different Host indicate with the same IP address
> > on the same day indicate a new visitor? Why does the Host change? I
> > thought IP and Host were supposed to be linked together?
>
>
> What is your Perl question?
_Assuming_ this hit counter is a Perl script...
I'd opt to check to see if the HTTP_X_FORWARDED_FOR header existed, if
so, return that in the script, if not, return the REMOTE_ADDR and this
should cover IPs form behind proxies/trans. caches.
Maybe I misread the OP, but this was my observation/assumption.
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPePZhGfqtj251CDhEQJp7gCeONWI/s8Mvb7OBdiUUpsExouKlkoAoM6H
vREvmfZWDw2yf6qB2B8+xa6o
=u1CR
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Tue, 26 Nov 2002 14:31:13 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: IP and Host differences
Message-Id: <slrnau7mgh.56u.tadmc@magna.augustmail.com>
Ian.H [dS] <ian@WINDOZEdigiserv.net> wrote:
> In a fit of excitement on Tue, 26 Nov 2002 09:03:25 -0600,
> tadmc@augustmail.com (Tad McClellan) managed to scribble:
>
>> Marc Rasell <mrasell@hotmail.com> wrote:
>> > I'm working on a hit counter. In the logs I record date, IP and
>> > Host. Sometimes I can get the same IP and Date with a different
>> > Host name. I'm running the counter to records unique IP and Host
>> > per day. Would a different Host indicate with the same IP address
>> > on the same day indicate a new visitor? Why does the Host change? I
>> > thought IP and Host were supposed to be linked together?
>>
>>
>> What is your Perl question?
>
> _Assuming_ this hit counter is a Perl script...
>
> I'd opt to check to see if the HTTP_X_FORWARDED_FOR header existed, if
> so, return that in the script, if not, return the REMOTE_ADDR and this
> should cover IPs form behind proxies/trans. caches.
And if this hit counter was written in Python or Java...
... you would do the same thing.
This thread is free of Perl content.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 26 Nov 2002 20:37:07 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: IP and Host differences
Message-Id: <dqm7uu0gajof28nrbtmf51slnilcc4dufv@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Tue, 26 Nov 2002 14:31:13 -0600,
tadmc@augustmail.com (Tad McClellan) managed to scribble:
[snip]
> >> What is your Perl question?
> >
> > _Assuming_ this hit counter is a Perl script...
> >
[snip]
>
> And if this hit counter was written in Python or Java...
>
> ... you would do the same thing.
>
>
> This thread is free of Perl content.
Tad,
Please see my above statement. '_Assuming_ this hit counter is a Perl
script...'.
_IF_ it is, then you'd be dealing with headers using _Perl_.
As I said and I'll repeat.. this was my _assumption/observation_.
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPePbvWfqtj251CDhEQJRZgCfT2J4oBQRL52q31EJG4Dli7vbgOsAoOI4
SBFnjm2MjO2ZcaL6u21DAWBi
=MWhk
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Tue, 26 Nov 2002 15:55:35 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: IP and Host differences
Message-Id: <slrnau7ren.5om.tadmc@magna.augustmail.com>
Ian.H [dS] <ian@WINDOZEdigiserv.net> wrote:
> In a fit of excitement on Tue, 26 Nov 2002 14:31:13 -0600,
> tadmc@augustmail.com (Tad McClellan) managed to scribble:
>> >> What is your Perl question?
>> >
>> > _Assuming_ this hit counter is a Perl script...
> [snip]
What was snipped there was:
I'd opt to check to see if the HTTP_X_FORWARDED_FOR header existed, if
so, return that in the script, if not, return the REMOTE_ADDR and this
should cover IPs form behind proxies/trans. caches.
>> And if this hit counter was written in Python or Java...
>>
>> ... you would do the same thing.
>>
>>
>> This thread is free of Perl content.
> Please see my above statement. '_Assuming_ this hit counter is a Perl
> script...'.
Yes I saw that.
Your comments (that I put back in above) apply equally well if
they had been posted in the Python or Java newsgroup.
> _IF_ it is, then you'd be dealing with headers using _Perl_.
_How_ you "check to see" the header values would have been
a Perl question, but that was not the question asked nor answered.
> As I said and I'll repeat.. this was my _assumption/observation_.
I got that the first time.
And if you made a different assumption, you would not need
to change a single character of what I re-quoted above,
hence the assumption makes no difference in the conclusion.
Neither the problem nor the solution has any Perl content yet.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 26 Nov 2002 22:20:13 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: IP and Host differences
Message-Id: <ips7uu0ao93jnajk3jphcko643t9m21sr9@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Tue, 26 Nov 2002 15:55:35 -0600,
tadmc@augustmail.com (Tad McClellan) managed to scribble:
[snip]
> Neither the problem nor the solution has any Perl content yet.
^^^
Tad,
If I understand you correctly this time round, had the OP asked about
retrieving the headers via $ENV{} in Perl, this would _then_ have
become a Perl question? If your reply is "yes", then I apologise, and
agree with you; the OP should have specified Perl as the solution they
were after to actually retrieve the headers.. and maybe I shouldn't
have assumed the question was really about Perl retrieving them.
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPePz7mfqtj251CDhEQJvJwCfU4Lc4qhfXUub7GdFi61xSbwFnOoAoIsM
lQOpEac/Rm0NREJrCi94/rfN
=YDwr
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Tue, 26 Nov 2002 23:46:06 +0100
From: Stuart Flowers <stuart.flowers@t-online.de>
Subject: LWP::UserAgent does not return a Response ??
Message-Id: <as0tjk$833$03$1@news.t-online.com>
Hello All.
I'm writing a script to check if a URL is available - and using the LWP
suite of modules. (Perl 5.8.0)
Problem is that after the:
$reponse = $ua->request($request);
any call to the $response object just gives me an error like
"Can't call method "content" on an undefined value at urltester line
74.". However "if ($reponse->is_success)" seems to return true.
I'm really at a loss :( and it's getting near the deadline!!
Thanks
Stuart Flowers
------------------------------
Date: Tue, 26 Nov 2002 20:15:06 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: mozilla & netscape. incapable of CSS word-break ?
Message-Id: <6fl7uu4ru52g538s5lmjgfro08a2uq7g7d@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Tue, 26 Nov 2002 21:29:01 +0900, "Hyungjin
Ahn" <ahj6@hotmail.com> managed to scribble:
>
> "Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in message
> news:9tm6uusgi863t59e525gmed0k0cf7jcn3f@4ax.com...
> > In a fit of excitement on Tue, 26 Nov 2002 20:10:00 +0900,
> > "Hyungjin Ahn" <ahj6@hotmail.com> managed to scribble:
> > > If you want to share your 'cool script' written in PHP, you'd
> > > better visit php newsgroup and find someone who seeks 'cool
> > > script' in the very PHP newsgroup.
> > Sir, are you _deliberately_ ignorant? or just plain stupid?
> > You tell me where 'cool script' defines a Perl issue, and I'll
> > agree with you, until then, I'd recommend you go and code in VBS or
> > something, as you obviously fail to even realise what Perl is.
>
> If you mean the subject 'differences between perl & Perl' in FAQ, I
> completely read.
> I don't care about differentiating perl from Perl, of course do not
> use as "awk & Perl" and "Phython & perl".
Tell me where I said that!
> Do you want to argue on a word 'script'?
That _wasn't_ my issue either.
> 'script' means nothing but 'script' itself. If you regarded 'script'
> as 'VBS or something',
> in this case, what kind of FAQ do you refer?
_NOTHING_ within CSS/browser rendering has anything to do with Perl (no
matter how you spell it.. Perl PeRl peRL et al.)
> Is there any difference between "Script & script"?
No, but CSS isn't a script.
> Larry told about "differences between perl & Perl".
You've confirmed my above thoughts.. you're not deliberately ignorant
are you.
> And do you want to define "Script & script"? Even though you will
> define it, I don't care about your opinion.
>
> I'd recommend you go and open dictionary for 'script'.
>
> thanks for your recommend, but I don't deal with VBS as well as
> PHP. -Hyungjin Ahn(ahj6@hotmail.com)
This has to be the most blatant display of idiocy I've encountered on
Usenet for a _long_ time.
Once you comprehend the questions being asked, _then_ I suggest you
reply.. until then.....................
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPePWmmfqtj251CDhEQIFnwCfS50edCzGYyMHtGc0wATlg/lOLH4AoPU5
3YCZfLga92T/rFt2+DJFkF4o
=4Iwv
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: 26 Nov 2002 12:38:45 -0800
From: alanluc@rogers.com (flinky)
Subject: need help assigning reference numbers
Message-Id: <9b921b8d.0211261238.2f3bd33c@posting.google.com>
Hello All
I am very very very new to perl, and I really need help. I am
currently working on a online form that needs to be tagged with a
sequential reference number. For example, if one person filled out
the form and submit, that form will be 1. Another person filled it
out, that will be 2, and so on. Any help is appreciated, and an
advance thanks for everyone!
------------------------------
Date: 26 Nov 2002 21:24:23 GMT
From: roberson@ibd.nrc.ca (Walter Roberson)
Subject: Re: need help assigning reference numbers
Message-Id: <as0oq7$e0j$1@canopus.cc.umanitoba.ca>
In article <9b921b8d.0211261238.2f3bd33c@posting.google.com>,
flinky <alanluc@rogers.com> wrote:
:I am very very very new to perl, and I really need help. I am
:currently working on a online form that needs to be tagged with a
:sequential reference number. For example, if one person filled out
:the form and submit, that form will be 1. Another person filled it
:out, that will be 2, and so on. Any help is appreciated, and an
:advance thanks for everyone!
This is essentially the same problem as doing cgi visit counters.
Looks like you might want to look at the CPAN module File::CounterFile
http://search.cpan.org/author/SHERZODR/CGI-Session3/Session/File.pm
Some questions:
Suppose the first person went back and filled out the form again. Does
that need to be tagged with the original '1', or should it be tagged
with '3'?
Suppose someone refreshes the page that they are shown upon submitting
the form, thus effectively re-submitting the form with the same data.
What value should that resubmission be tagged with?
Suppose someone goes "back" after getting the submission results and
again clicks on submit: how should the new one be tagged?
Suppose someone goes "back" after getting the submission results,
modifies the entered data, and clicks on submit: how should that be
tagged?
Suppose someone goes back the next day and completes the form again
and submits it: how should that be tagged?
I suspect that as you think through these issues, you will find that
you want something more complex than just straight sequential
numbering.
--
"There are three kinds of lies: lies, damn lies, and statistics."
-- not Twain, perhaps Disraeli, first quoted by Leonard Courtney
------------------------------
Date: Tue, 26 Nov 2002 21:24:52 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: need help assigning reference numbers
Message-Id: <3DE3E651.8040103@dev.null>
flinky wrote:
> Hello All
>
> I am very very very new to perl, and I really need help. I am
> currently working on a online form
Be sure to use the CGI module to create your form. It's just so much
easier and so much less error-prone than doing it yourself. Also, read
the docs by typing
perldoc cgi
and also
perldoc -q cgi
that needs to be tagged with a
> sequential reference number. For example, if one person filled out
> the form and submit, that form will be 1. Another person filled it
> out, that will be 2, and so on.
You might want to keep a file on your server with the next reference
number. When your script receives a form submission, it could then read
the reference number, store it with the info submitted by your visitor
and increment the number in the file. You will probably want to lock the
reference number file while lest two submissions should occur at the
same time, messing up the reference numbers.
perldoc -f flock
for more info.
------------------------------
Date: Tue, 26 Nov 2002 13:36:02 -0600
From: "Extended Partition" <extendedpartition@NOSPAM.yahoo.com>
Subject: One more question about sockets...
Message-Id: <3de3cde9_2@nntp2.nac.net>
Hello Again Everyone,
I'm wanting to scan my LAN for open ports so I'm writing a port scanner.
Yes, I know that I can download many freeware ones but I want the experience
of rolling my own in perl. My problem is that my scanner never actually
makes the remote connection. I know my SMTP port is open but it doesn't
identify it as being so. I placed a print statement right after the new
socket creation method and it is never executed either. Can anyone tell me
what's wrong? My best guess is that program is actually timing out on the
closed sockets and not reporting but I could be wrong. Any advice would be
greately appreciated...
CODE:
sub doScan{
for($THIS_PORT=$START_PORT; $THIS_PORT <= $END_PORT; ++$THIS_PORT){
$sock = new IO::Socket::INET(PeerAddr=> "$HST_ADDRESS",
PeerPort=>$THIS_PORT,
Proto=>'tcp');
} print "Scanning $THIS_PORT\n";
}
Thanks!
--
Anthony M. Saffer
SCS Consulting Services
Professional Web, Software, and Database Development
www.safferconsulting.com
ICQ 96698595
------------------------------
Date: Tue, 26 Nov 2002 15:52:00 -0600
From: Lars Eighner <eighner@io.com>
Subject: Re: Order of return trap
Message-Id: <slrnau7r7h.2cgg.eighner@dumpster.io.com>
In our last episode,
<qgME9.600$qe.145@nwrddc03.gnilink.net>,
the lovely and talented Jürgen Exner
broadcast on comp.lang.perl.misc:
> Lars Eighner wrote:
>> It appears to me that if you return an array and a
>> reference, the array will swallow the reference (or
>> something).
> The answer can be found in the documentation.
> Excerpt from 'perldoc perlsub':
> The Perl model for function call and return values is simple: all
> functions are passed as parameters one single flat list of scalars, and
> all functions likewise return to their caller one single flat list of
> scalars. Any arrays or hashes in these call and return lists will
> collapse, losing their identities--but you may always use
> pass-by-reference instead to avoid this. [...]
I know. I'd read it dozens of times without quite getting
it. Now, of course, it seems the soul of clarity.
Just more proof that one sad experience is worth a ton of
docs.
--
Lars Eighner -finger for geek code- eighner@io.com http://www.io.com/~eighner/
An effective way to deal with predators is to taste terrible.
------------------------------
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 4182
***************************************