Hi All
Please Help!
**
I am new to CGI and Perl.
I am trying to test a connect to the database
and execute a select against the TAB table.
The connect is hard coded for now. I am able
to pass the values in but I have not tried to
I'm having difficulty using the -T switch with perl in the #! line in cgi
scripts on my Win2K system using a Netscape 4.1 web server.If I use
something like "#!c:/perl/bin/perl.exe -wT" on the 1st line, the server
complains with an HTTP500 error about the script not producing valid
headers.
--- erotomek [EMAIL PROTECTED] wrote:
--- Curtis Poe [EMAIL PROTECTED] wrote:
You supplied some great information, however, your
example of plugging the security hole has a
security hole itself. From the command line on any
*nix system, enter the following (assuming you
are not in
Brice, Charles wrote:
my $dbh = DBI-connect(dbi:Oracle:aux,ceb,ceb);
my $cursor = $dbh-prepare(select * from tab) || die PREPARE
error $DBI::errstr\n;
what error is it putting in your error log?
you could try setting DBI's trace level to 2 like
What does the web server log file say that the problem is. The web server
log should contain something much more useful than a 500 error...
I am guessing that you are getting an insecure dependency or some type of
error like that when you run it via the web server
brent
Brent,
Unfortunately, it's not much more informative then I said in my first note. Here's a
representative error message:
[28/Feb/2002:14:46:37] failure ( 1892): for host 127.0.0.1 trying to GET
/cgi2/current_time.cgi, cgi-parse-output reports: the CGI program c:\Perl\bin\perl.exe
did not
Yup it prints valid HTML. Here's an example running it from the
command-line:
06:38pm ../ch06 perl -wT current_time.cgi
Content-type: text/html
HTML
HEAD
TITLECurrent Time/TITLE
/HEAD
BODY BGCOLOR=white
H1Current Time/H1
PWelcome. The current time is Fri Mar 1 18:38:18 2002./P
/BODY
++
Please read the disclaimer at the bottom of this e-mail.
++
TMTOWTDI.
I havent got my Mastering regular Expressions Book at hand, so Im sure
the syntax is wrong, but you get the drift...
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
my @a = (1, 2, 3 , 4 , 5);
$_ += 2 for (@a);
print @a\n;
3 4 5 6 7
my @a = (1, 2, 3 , 4 , 5);
$_ += 2 foreach (@a);
print @a\n;
3 4 5 6 7
why isn't
The problem lies in the second loop. Each time through the loop I am
writing to a separate file, which appears to be working, the body of the
report is in each file. The header is what I am having problems with. I
want to change the page length so the header appears at the top of each file
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
It merely depends on your
Hi, List !
I'm trying to build a linked list, containing hashrefs.
Walking through the %HashRef (-x %HashRef) i can see a lot of
'REUSED_ADDRESS'es in the list. At the end, all refs point to one single
adress, so every HashRef in my list points to the same hash.
I have considered trying the
From: Jan Gruber [EMAIL PROTECTED]
I'm trying to build a linked list, containing hashrefs.
Walking through the %HashRef (-x %HashRef) i can see a lot of
'REUSED_ADDRESS'es in the list. At the end, all refs point to one
single adress, so every HashRef in my list points to
Hi guys
I was wondering if you could help me
I have 2 files.
One file has 3 data rows, A, B and C
The file has 1 data row D.
I need to append row D to rows A and C in the first file, based on some
condition.
Any ideas how I could go about this ?
Another alternative would be for me to open
Hi, Jenda !
- code snipped -
Grr, i was playing around with eval and bless, but forgot the KISS !
Thx,
Jan
--
cat /dev/world | perl -e while () {(/(^.*? \?) 42 \!/) (print $1)}
errors-(c)
_
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I would use the second approach. I would think that it would be better
performance-wise, not to mention I always like to have a backup in case
things don't work the way I expected.
Alother thing you have to try to do is only read in as much data at one time
as you need to, because a million
why i can compile PERL script under Linux to binnary?
:
:.. Roman Fordinal
:.: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I am appearing to have some
troubles. It appears that it can not reach the hosts specified, but when I
try it manually it works just fine. Here is what I have for my code:
#!/usr/bin/perl -w
use strict;
use Net::Ping;
Initalize Variables#
my @hosts=
From: Roman Fordinal [EMAIL PROTECTED]
why i can compile PERL script under Linux to binnary?
I think you meant HOW :-)
I believe there is a Linux version of PerlApp from ActiveState
See http://www.ActiveState.com , look for Perl Development Kit.
You might also try perlcc.
Jan Gruber wrote:
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
Try changing the line below to:
$t = Net::Ping-new('icmp');
by default Net::Ping uses UDP packets, but not all hosts will respond to
this.
-Original Message-
From: Joseph Bajin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:43 AM
To: [EMAIL PROTECTED]
Subject: Trouble
Hi, Joseph list !
On Friday 01 March 2002 02:44 pm, you wrote:
I am appearing to have some
troubles. It appears that it can not reach the hosts specified, but when I
try it manually it works just fine.
# use TCP if we're not root, ICMP if we are
my $pong = Net::Ping-new( $ ? (tcp, 1) :
Hmmm. I tried putting in the icmp instead, but because I am not root I
am unable to run it. I don't understand why I can ping it from the
command line just fine but not in this program.
Any more ideas.
[EMAIL PROTECTED] wrote:
Try changing the line below to:
$t = Net::Ping-new('icmp');
by
On Mar 1, Jon Molin said:
Jan Gruber wrote:
On Friday 01 March 2002 11:29 am, you wrote:
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
I think it lies in the history of programming. Traditionally for loops look
like this (when written in perl)
for($i=1; $i=100; $i++){
print $i\n;
}
while foreach loops look like this.
@array = qw(one two three);
foreach (@array) {
print $_\n;
}
Even though you can do
for
On Fri, 1 Mar 2002, Jon Molin wrote:
It merely depends on your preferences, readable/maintanable code vs
quick dirty.
if there's no difference, what's the point of having both? I can't see
how readable/maintanable would increase by adding functions with the
same name, it'd rather
On Mar 1, Jon Molin said:
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
From perlsyn, Foreach Loops:
The foreach keyword is actually a synonym for the for
keyword, so you can use foreach
what the heck is TIMTOWDI?
I tried it at acronym finder and nothing..
http://www.acronymfinder.com/af-query.asp?String=exactAcronym=TIMTOWDIFind
=Find
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 10:22 AM
To: 'Jon Molin'; [EMAIL
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
which is the Perl Hackers motto.
Good Luck!
Dennis
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Fri, 1 Mar 2002, Nikola Janceski wrote:
what the heck is TIMTOWDI?
It's TMTOWTDI
There's More Than One Way To Do It 00 pronounced like tim-toady.
-- Brett
http://www.chapelperilous.net/
On Fri, 1 Mar 2002, Dennis G. Wicks wrote:
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
I prefer
http://www.chapelperilous.net/
On Fri, 1 Mar 2002, Brett W. McCoy wrote:
On Fri, 1 Mar 2002, Dennis G. Wicks wrote:
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
I prefer
Err, ignore that... I hit C-x instead of
On Friday, March 1, 2002, at 10:22 , John Edwards wrote:
I think it lies in the history of programming. Traditionally for loops
look
like this (when written in perl)
for($i=1; $i=100; $i++){
print $i\n;
}
from the Learning Perl book p63
One could write, as an alternative to for:
Yeah, yeah. So I made a typo. :p
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 01 March 2002 18:00
To: [EMAIL PROTECTED]
Subject: TIMTOWDI Was: RE: some questions about for, foreach
It is really sad when people can't get their MLA
(Multi-Letter Acronym)
If I have a string and the first character is a space,
may not always be a space.
Example: John
Tommy
Beth
John and Beth have a space, Tommy does not.
How do I strip that. I do not want to use the global
command because a want the space between First
and Last name.
my @arr = ( This has a leading space, This does not );
foreach my $string (@arr ) {
$string =~ s/^\s//;
print $string, \n;
}
prints:
This has a leading space
This does not
The regular expression
s/^\s//;
means
s/ # substitute
^ # at the beginning of the string
\s
Tanton Gibbs [[EMAIL PROTECTED]] quoth:
*
*The regular expression
*s/^\s//;
s/^\s+//g; would be even better as it would remove all whitspace at the
beginning of a line and it would replace all matches to the pattern
instead of just the first it finds.
e.
--
To unsubscribe, e-mail: [EMAIL
Thank you! While, what I worry about is that the Registry changes made buy
Active, will it effect my script which using a downloaded module not a
default installed module?
Timothy Johnson [EMAIL PROTECTED] wrote in message
$string =~ s/^\s+//; Removes leading whitespaces
$string =~ s/^\s+//g; /g (GLOBALLY) is redundant in the
case of leading whitespages
See PERL Cookbook page 30 for the answer to your question.
__
William Ampeh (x3939)
Federal Reserve Board
The registry changes made by ActivePerl are mainly to register the program
so that you can uninstall it and create the appropriate file associations
with .pl files. We run a perl script as part of our login process. So that
we don't have to install it on all of the clients, we run it from the
If I have a string and the first character is a space,
may not always be a space.
Example: John
Tommy
Beth
John and Beth have a space, Tommy does not.
How do I strip that. I do not want to use the global
command because a want the space between First
and
[EMAIL PROTECTED] [[EMAIL PROTECTED]] quoth:
*
*$string =~ s/^\s+//; Removes leading whitespaces
*
*$string =~ s/^\s+//g; /g (GLOBALLY) is redundant in the
*case of leading whitespages
For a beginner, it's a not a critical detail.
e.
--
To unsubscribe,
I'm really curious what the point of foreach is considering for does the same
exact thing? For example:
@myarray = (1 .. 10);
for (@myarray) {
print $_\n;
}
Or, you could swap the for for a foreach and the same thing would get
accomplished... The only difference I can think of is a
On Fri, 2002-03-01 at 14:43, Joseph Bajin wrote:
I am trying to get this program to send mail. Unfortunately I am having
a hard time using sendmail. Could someone please help me out.
Thanks,
##Error Reporting
sub Notifyanddie {
my $message = shift;
open(MAIL,
On Fri, 2002-03-01 at 14:52, James Taylor wrote:
I'm really curious what the point of foreach is considering for does the same
exact thing? For example:
@myarray = (1 .. 10);
for (@myarray) {
print $_\n;
}
Or, you could swap the for for a foreach and the same thing would get
On Fri, 2002-03-01 at 14:52, James Taylor wrote:
I'm really curious what the point of foreach is considering for does the same
exact thing? For example:
@myarray = (1 .. 10);
for (@myarray) {
print $_\n;
}
Or, you could swap the for for a foreach and the same thing would get
I am trying to get this program to send mail. Unfortunately I am having
a hard time using sendmail. Could someone please help me out.
Thanks,
##Error Reporting
sub Notifyanddie {
my $message = shift;
open(MAIL, |/usr/lib/sendmail -t -i)
or die Couldn't open sendmail $!\n;
print MAIL
According to
perldoc -f die
and
perldoc perlvar # look at %SIG{expr}
the die_handler will be called with the string die was passed. From the
perldoc -f die, die will concatenate all parameters together. Therefore,
your problem makes sense. You might try passing an array reference
containing
On Mar 1, Sethi, Pradeep said:
I have this in my code :
local $SIG{__DIE__} = \die_handler;
sub die_handler {
my (@vars)=@_;
print STDERR \nfirst : . $vars[0];
print STDERR \nsecond : . $vars[1];
}
if i give :
die ('goo','foo','bar');
Then I get the output :
first : goofoobar at
Oops, sorry it was just pointed out to me today that this was already asked
today :) There are over 1000 unread messages in my Perl folder and I didn't
think to look through them all
On Friday 01 March 2002 11:52 am, you wrote:
I'm really curious what the point of foreach is considering for
Hi Papo,
Thank you very much for your information. I can send to serial port from my
script now. But when I try to read from the port, my script died and showed
Device::SerialPort Aborted without match. Do you have any idea about how
can I fix the problem? My script is as followed.
Ok, I actually gave this a shot, and it works...sort of.
However, the original die still prints out the first argument of the array
which is an array reference. However, you can change what die is called
with from your die_handler by calling die again, so if you just want to
print a message, I
Jon Molin wrote:
Jan Gruber wrote:
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a
Tony Ho wrote:
Hi guys
Hello,
I was wondering if you could help me
I have 2 files.
One file has 3 data rows, A, B and C
The file has 1 data row D.
I need to append row D to rows A and C in the first file, based on some
condition.
Any ideas how I could go about this ?
Another
The perlsyn doc says that foreach is a synonym for for, so the two are
indeed interchangable. But you should also note that there are 2 different
modes in which the for/foreach statement works.
If you use it in the C-style for($x=1; $x10; $x++) {} way, then $x is not
localized to the loop
All I have to say is... (perldoc perlsyn; goto line 145)
The following compound statements may be used to control
flow:
if (EXPR) BLOCK
if (EXPR) BLOCK else BLOCK
if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK
LABEL while (EXPR) BLOCK
You should change the line
die Device::SerialPort Aborted without match\n unless (defined $data);
to read
die Device::SerialPort Aborted without match\n unless (defined
$bytein);
But be careful because the 'lookfor' method causes Device::SerialPort to
return an entire line (up to the
I have a hash tables that looks like this:
my(%data) = ();
my($csid) = '';
$data{$csid} = {};
$data{$csid}{duration_on} += 0;
$data{$csid}{duration_off} += 0;
$data{$csid}{under_peak} += 0;
$data{$csid}{over_peak} += 0;
$data{$csid}{under_off} += 0;
What do the letters after the %02 mean? I know about %02d, but I came
across a few scripts with %02u in it. I've never seen that, what does it
mean? What's the difference between the d and the u? And what ELSE can
you possibly use there?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Check the documentation on sprintf(). I don't have perl with me, but I
think perldoc -f sprintf will find it, otherwise you can look through the
perlfunc section of the docs for sprintf. Offhand I'd guess that %02u
refers to an unsigned integer in decimal format?
-Original Message-
On Fri, 1 Mar 2002, Troy May wrote:
What do the letters after the %02 mean? I know about %02d, but I came
across a few scripts with %02u in it. I've never seen that, what does it
mean? What's the difference between the d and the u? And what ELSE can
you possibly use there?
I can only
61 matches
Mail list logo