Jack wrote:
Hello,
In my perl CGI script, I'm trying to extract the PID
that corresponds to it.
$$ contains the PID that corresponds to your script (perldoc perlvar)
How do I do this? I'm also trying to extract the
timestamp.
The built-in perl function localtime will interest you
perldoc -f loc
Jack wrote:
Hello,
In my perl CGI script, I'm trying to extract the PID
that corresponds to it.
How do I do this? I'm also trying to extract the
timestamp.
How come it's not possible to do something like:
print "";
print `time`;
print "";
Try this:
print "";
print scalar localtime;
print "";
--
Hello,
In my perl CGI script, I'm trying to extract the PID
that corresponds to it.
How do I do this? I'm also trying to extract the
timestamp.
How come it's not possible to do something like:
print "";
print `time`;
print "";
Any help would be greatly appreciated,
Jack
_
there has been one last post from my side, hope u will approve :)
its been one healthy and deep(??) discussion. thx, rajeev
__
There are as many paths as there are travellers...
From: Casey West <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
T
the clouds were dark and a lightining striked again.. obviously that was
when they parted.:)
Hello Brian,
To me Physics, mathematics and chemistry are capable enough to explain
certain things/phenomenons on their own. Or in other words one can not
explain/prove certain things in the ab
peter grotz wrote:
Hi,
[...]
Why don´t use $dbh as a global? Now in this way it works for me at this
time!
In general using globals in this way is considered bad form. It is
considered bad form because as the number of lines, modules, etc. grows
in the program it becomes harder and harder to
Okay folks, lets move on. I was hoping this thread would end on its
own. :-)
Casey West
--
"Everything that can be invented has been invented."
-- Charles H. Duell, Commissioner, U.S. Office of Patents, 1899.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
About as hard as figuring out how people can have so few problems in
their lives that it makes such a huge difference to them...
-Original Message-
From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 6:35 PM
To: [EMAIL PROTECTED]
Subject: Re: Training in t
> "Scott" == Scott E Robinson <[EMAIL PROTECTED]> writes:
Scott> (And, sorry for the top-posting. I haven't figured out how to fix that!)
Uh, press the down arrow about a dozen times. How *hard* is that?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EM
And the clouds parted, and Rajeev Prasad said...
>
>
> >And the clouds parted, and Rajeev Prasad said...
> >>
> >> computer science is no science at all. It is only layers of information.
> >> It is physics and mathematics which makes this number crunching plastic
> >> do its job. that is scienc
Hello Brian,
hmm nice reply. i like that. big names supporting the theory.. interesting.
and this time it was lghtining when the clouds parted
Computer is a Tool. To learn how to operate a tool can be science to some
people.
It has only increased in its power to to add/subtract/divide and
Yes. If you do it right after "use warnings;", then it will be in
effect for the rest of your script.
-Original Message-
From: Richard Heintze [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 4:15 PM
To: [EMAIL PROTECTED]
Subject: RE: Surpressing concatenation with null warnin
> I think what you want is this:
>
> no warnings qw(uninitialized);
>
Would I put this immediately after "use warnings;"?
__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
--
To unsubscribe, e-mail: [EM
From: "Rob Dixon" <[EMAIL PROTECTED]>
> To all.
>
> I wonder if any subscriber from the middle and far eastern
> countries can explain what training and IT experience people
> like them are likely to have had? It seems to me that a
> disproportionate number of posted questions coming from that
> r
George, Rob was asking for 'computer science' training for people from the
said region. second, people will ask questions which might look stupid to
you or others who have read some books or or learnt from someone. though i
am not saying that all people do not refer to books but sometimes checki
On Nov 5, Tore Aursand said:
>On Tue, 04 Nov 2003 13:58:41 -0500, mgoland wrote:
>> %hash=( 1 => funca(),
>> 2 => funcb(),
>> );
>
>Try this:
>
> %hash = (1 => \&funca(),
> 2 => \&funcb());
No; \&foo is a reference to the foo function, but \&foo() is a reference
to the re
On Tue, 04 Nov 2003 13:58:41 -0500, mgoland wrote:
> %hash=( 1 => funca(),
> 2 => funcb(),
> );
Try this:
%hash = (1 => \&funca(),
2 => \&funcb());
--
Tore Aursand <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
On Nov 4, 2003, at 5:23 PM, Rajeev Prasad wrote:
bhaiya Rob,
computer science is no science at all. It is only layers of
information. It is physics and mathematics which makes this number
crunching plastic do its job. that is science.
Whether computer science is a science (and there are many m
And the clouds parted, and Rajeev Prasad said...
>
> computer science is no science at all. It is only layers of information. It
> is physics and mathematics which makes this number crunching plastic do its
> job. that is science. rest of the stuff as Jerry said it is a BIGENNER's
> list. so i
Jerry Rocteur wrote:
>
> On Tuesday, Nov 4, 2003, at 21:10 Europe/Brussels, Rob Dixon wrote:
>
> > To all.
> >
> > I wonder if any subscriber from the middle and far eastern
> > countries can explain what training and IT experience people
> > like them are likely to have had? It seems to me that a
I think what you want is this:
no warnings qw(uninitialized);
Which should suppress only the warnings about an uninitialized value in
string or concatenation messages.
-Original Message-
From: Richard Heintze [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 10:24 AM
To: [EMAI
bhaiya Rob,
computer science is no science at all. It is only layers of information. It
is physics and mathematics which makes this number crunching plastic do its
job. that is science. rest of the stuff as Jerry said it is a BIGENNER's
list. so it will be like the way it is.
thx,
-r
I have just discovered the the following code causes
trouble when I have "use strict" and "use warn";
use strict;
use warnings;
my $k = $q->param('xyz');
print qq[ \$k = $k ];
The problem is that if there is no GET/POST param
called xyz, we are concatenating with a null value
and, when using CGI
Hi Richard.
Richard Heintze wrote:
>
> Sorry -- I was not quoting my own code precisely and I am using strict and
> warnings.
> I am using parenthesis. I attached the exact code for the subroutine below.
At the end of this post is my edited version of your program without line wraps.
It comp
Jenda,
Sorry -- I was not quoting my own code precisely and
I am using strict and warnings.
I am using parenthesis. I attached the exact code
for the subroutine below.
--- Jenda Krynicky <[EMAIL PROTECTED]> wrote:
> From: Richard Heintze <[EMAIL PROTECTED]>
> > After several hours I tracked i
Jerry,
Knowing Rob a little, I'd say he's not trying to exclude posters from the
East, but trying to help them. I agree with him, that many posts from the
East have much to do with basic computer science, and if so, we can suggest
resources to help build that understanding -- not as a prerequi
What a nasty question / paragraph...
This list is [EMAIL PROTECTED]
Rob, you are completely out of line with that question on this list.
People ask, how do I open a file and other people answer, this is a
beginner's list..
How many times have I cringed and you as well when we see base
questio
Hi
I want to open a file (testmesg.txt) for reading and writing. Ok,
normally that is no problem ;)
But my script runs by "www-data" and the file I want to edit belongs the
user "testuser" and
lays in /home/testuser/testmesg.txt. So I have no direct access to this
file...
But now, I put the use
From: Richard Heintze <[EMAIL PROTECTED]>
> After several hours I tracked it down to these line of
> code. The concantenation is failing suddenly!
>
> my $hidden="";
> &FormElements(\$hidden...);
>
> sub FormElements{
> my $hidden = @_;
This line is incorrect.
> my $t1 = qq[];
> $$hidden
On Tue, Nov 04, 2003 at 12:58:58PM -0800, Richard Heintze wrote:
> After several hours I tracked it down to these line of
> code. The concantenation is failing suddenly!
>
> my $hidden="";
> &FormElements(\$hidden...);
>
> sub FormElements{
> my $hidden = @_;
This sets $hidden to the number of
I'm running perl 5.6.1 on Apache HTTPD V2.
I noticed some values were not appearing on the web
page.
After several hours I tracked it down to these line of
code. The concantenation is failing suddenly!
my $hidden="";
&FormElements(\$hidden...);
sub FormElements{
my $hidden = @_;
my $t1 = qq
To all.
I wonder if any subscriber from the middle and far eastern
countries can explain what training and IT experience people
like them are likely to have had? It seems to me that a
disproportionate number of posted questions coming from that
region would be resolved better by a proper grounding
Why do the subs execute? Because you told them to. When you type
funca(), you're telling Perl to execute funca, but don't pass it any
parameters. You don't "declare" subs in Perl the way you would in C.
The only place you declare a sub is in the "sub mySub{BLOCK}" statement.
You CAN prototype a
Mark wrote:
>
> I am trying to create a hash where each key is a referance to
> subs. The bellow code produces the expected result, with one
> unexpected side-effect. Why are the subs executed when I only
> declare them ??
>
> <- cut
> #!/usr/local/bin/perl -w
>
>
> %hash=( 1 => funca(),
>
Jeff 'Japhy' Pinyan wrote:
>
> On Nov 4, Raghu Murthy said:
>
> >#!/usr/bin/perl
> >
> >use strict;
> >use warnings;
> >
> >my $result;
> >$result = system("cksum foo.c | cut -d ' ' -f2");
> >chomp $ckresult;
> >print "$ckresult\n";
>
> I doubt you did that; $result and $ckresult aren't the same.
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
>
> I tried modifying the script, but it still did not work:
>
> main.pl
> ~~~
> use vars qw/ $foo /; #So does our $foo
> $foo = 2;
> runtests @test
On Tuesday, November 4, 2003, at 12:58 PM, [EMAIL PROTECTED] wrote:
Hello Perler's
I am trying to create a hash where each key is a referance to subs.
The bellow code produces the expected result, with one unexpected
side-effect. Why are the subs executed when I only declare them ??
<- cut
#!
Hello Perler's
I am trying to create a hash where each key is a referance to subs. The bellow code
produces the expected result, with one unexpected side-effect. Why are the subs
executed when I only declare them ??
<- cut
#!/usr/local/bin/perl -w
%hash=( 1 => funca(),
2 => funcb(),
In article <[EMAIL PROTECTED]>, Brian Gerard wrote:
> And the clouds parted, and Kevin Pfeiffer said...
[...]
>> If I don't escape the slash in the char class -- i.e. /([^\/]+)$/ -- I
>> get this error:
>> Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^/ at ./test-0
>> line 7.
>>
>> T
I tried modifying the script, but it still did not work:
main.pl
~~~
use vars qw/ $foo /; #So does our $foo
$foo = 2;
runtests @tests;
t\1.t
~
print "1..1\n";
my $bar = $main::foo;
print $bar == 2 ? "ok 2\n" : "not ok 2\n";
--
Fails with message:
Running test
On Nov 4, Raghu Murthy said:
>#!/usr/bin/perl
>
>use strict;
>use warnings;
>
>my $result;
>$result = system("cksum foo.c | cut -d ' ' -f2");
>chomp $ckresult;
>print "$ckresult\n";
I doubt you did that; $result and $ckresult aren't the same.
>Cksum returns an exit status of 0 if successful. Thi
Raghu Murthy wrote:
>
> use strict;
> use warnings;
>
> my $result;
> $result = system("cksum foo.c | cut -d ' ' -f2");
> chomp $ckresult;
> print "$ckresult\n";
>
> Cksum returns an exit status of 0 if successful. This script gives out the
> exit status. How can I remove the exit status from the s
Chetak Sasalu M wrote:
>
> Does anybody know of a tool which can do a grep -c
> "HowManyTimesDoesThisOccur" on an ms word document.
> There is a tool called powergrep but it aint free :-(
Hi Chetak.
Within Perl on Windows the obvious way is to export
the document from Word into plain text format
Hi,
first, thanks fro your answer!
Wiggins d Anconia schrieb:
[...]
Your 'dbh' is lexically scoped, which means it goes out of view at the
end of the file, therefore it will not be available for use in your
subroutine. Using either 'our' or 'use vars' will fix the symptom, see
below for more a
#!/usr/bin/perl
use strict;
use warnings;
my $result;
$result = system("cksum foo.c | cut -d ' ' -f2");
chomp $ckresult;
print "$ckresult\n";
Cksum returns an exit status of 0 if successful. This script gives out the
exit status. How can I remove the exit status from the script.
Is there an alte
Luke,
Thanks for the reply and I'm very aware of being able to
Turn on SNMP on every system. But many sites I've been to
do not have those features turned on. The purpose of my
site discovery tool is to capture everything even if a feature
is turn on or off. I have to use several methods no
> "Richard" == Richard Heintze <[EMAIL PROTECTED]> writes:
Richard> Is there an editor out there that will properly indent
Richard> my perl code even if I use the stranger syntaxes for
Richard> literal strings?
It's never *completely* possible to parse Perl code outside of running
some of the
henq <[EMAIL PROTECTED]> wrote:
: HTML-Kit has color highlighting and a perl-tidy plugin.
: Give it a look. FTP is nicely integrated.
So does UltraEdit (UltraEdit.com). Ian is always
updating and perl-tidy is very customizable.
HTH,
Charles K. Clarkson
--
Head Bottle Washer,
Clarkson En
> The purpose of my script is to auto discover every system
> on a network
> Stack beginning using tcp/ip protocols and then later using
> snmp also.
>
> The data I will be collecting is for the sole purpose of gather
> information about a site and a site configuration. Similar to
> tools
> Hello,
>
> I have a main prog and some subs in different files.
> At runtime I use "require ´pathtofile/´;" to include these files to the
> main prog as subs. In the main prog I´m using the modul HandySQL3 with a
> databasehandle let´s say
>
> /snip/
> ##main prog ##
use strict;
use warnings
>
> Can someone help me understand how does one pass variable to a Perl test
> script from the calling program? Is such a mechanism available? To
> illustrate my question:
>
>
> main.pl
> ~~~
>
> print "Running tests...\n";
>
> my $var = 2;
Right here you have lexica
Take a look at HTML::Template (or one of the many other template modules)
on CPAN;
Thanks !!
I just got it fixed (2 min ago) using the following structure :
#---
&print_html($file_adapt);
sub print_html {
open(FF, "< @_");
while($line=) {
$line =~ s/(\$[\w\]\[\$]
On Tue, 04 Nov 2003 09:49:43 +0100, David van der G wrote:
> I have a CGI-script that needs to print an html-page containing variables
> dependent on the choise you make.
Don't mix Perl code and HTML (or other presentation data). Take a look at
HTML::Template (or one of the many other template m
Hi Friends,
Does anybody know of a tool which can do a grep -c
"HowManyTimesDoesThisOccur" on an ms word document.
There is a tool called powergrep but it aint free :-(
Cheers
Chetak
**Disclaimer
Information containe
Hello,
I have a main prog and some subs in different files.
At runtime I use "require ´pathtofile/´;" to include these files to the
main prog as subs. In the main prog I´m using the modul HandySQL3 with a
databasehandle let´s say
/snip/
##main prog ##
require ´./sub.pl´;
use HandySQL3;
my $dbh
Hi,
I have a CGI-script that needs to print an html-page containing variables
dependent on the choise you make.
Right now I do this using :
#!/opt/per/bin/perl
if ($submit) {
open(FH, "< $htmlfile");
my @contents=;
close(FH);
print "Content type text/html; \n\n";
print "Contents";
This does pri
Richard Heintze wrote:
> emacs and a number of other editors have the ability,
> with a single key stroke to properly indent java code.
>
> However, since perl has such unusual syntax for
> specifying literal character strings (my favorite is
> qq[]) emacs chokes when it attempts to indent my per
Can someone help me understand how does one pass variable to a Perl test
script from the calling program? Is such a mechanism available? To
illustrate my question:
main.pl
~~~
print "Running tests...\n";
my $var = 2;
runtests @tests;
-
t\0.t
~
p
"Richard Heintze" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
>
> Is there an editor out there that will properly indent
> my perl code even if I use the stranger syntaxes for
> literal strings?
>
> Thanks,
> Siegfried
>
HTML-Kit has color highlighting and a perl-tidy
Wiggins,
The purpose of my script is to auto discover every system on a network
Stack beginning using tcp/ip protocols and then later using snmp also.
The data I will be collecting is for the sole purpose of gather
information about a site and a site configuration. Similar to tools such as
60 matches
Mail list logo