I've used LWP to call cgi scripts like that. This example is probably more
complicated than it needs to be, because I had to use the POST method to
call the scripts I was running behind the scenes:
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
...
my $em = new CGI;
$em-delete_all;
Quick question,
the server is on west coast time (California)
client is in Texas, central time (+2 hours)
How can I add two hours to offset for central time?
Thx,
Dave
#!/usr/local/bin/perl
use POSIX 'strftime';
my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime);
print $date;
--
--
To
Daniel:
-I've sent this to the mod_perl list but there seems to be no response.
I got the module working in the current directory executing on the command
line. But I have a problem calling a module in my mod_perl dir using
apache on redhat 9. I have a mystuff.pm in the same directory as the
Shlomi Fish [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all!
I believe learn.perl.org is very lacking:
1. Its design is ugly.
agreed
2. No links to many important online resources such as tutorials, books,
article collections, mailing lists, web forums, etc.
Well,
In article [EMAIL PROTECTED], Rob Dixon wrote:
Kevin wrote:
I've updated the docs and wrote ...based on version
xxx of Unix::AliasFile by Steve Snodgrass..., etc.
Mister Snodgrass is a character in The Pickwick Papers
invented by Charles Dickens. He is no Foo or Bar.
Proud of the soil
can anyone tell me how I can remove the period at the end of each line
below??
.
.
.
.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I found the answer!
This is the routine I use to see if the checkbox value is 1 and then if a
toplevel winodw exisits.
The method Exists has to be capitalized.
-
sub do_assists
if ($side_on == 0) {print side on=$side_on\n;
if
hey guys, I'm trying to figure out how to stripe Anything Else, 7:15pm
and 9:50pm from the below html code. Any ides?
tdfont class=smalllista
href=/showtimes/movie.adp?movieid=16038date=20030929theaterid=757
Anything Else/a nbsp;nobr(R, 108 min.)/nobrbra
I am usiing GD::Graph::lines to draw a graph with multiple lines. How
do I specify so that lines can be of different width?
yi
Set the line_width variable. E.g. line_width = [2] prints a thicker
line than 1, etc...
Danny
-
Do you Yahoo!?
The New Yahoo!
In article [EMAIL PROTECTED], Jeff
'Japhy' Pinyan wrote:
On Sep 29, Kevin Pfeiffer said:
[...]
My working copy is now called AliasFilePlus.
What do I do with this if I try to share it? The changes to the module
seemed too great (and too complex) for me to place them in the main
program and too
how to grep text by line?
anyone can help to guide me.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
According to
http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/argv.html
the following program will do ...whatever (make a backup of files) and it
takes the file specified at the command line. I guessed from this that one
has a .pl file with the following script, execute it at c:
Dillon, John would like to recall the message, @ARGV.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Silverfox wrote:
hey guys, I'm trying to figure out how to stripe Anything Else, 7:15pm
and 9:50pm from the below html code. Any ides?
tdfont class=smalllista
href=/showtimes/movie.adp?movieid=16038date=20030929theaterid=757
Anything Else/a nbsp;nobr(R, 108 min.)/nobrbra
Nicholas Yau wrote:
how to grep text by line?
anyone can help to guide me.
Please elaborate. No one can help you on such vague messages
I think you are looking for some text in some lines , Better study more
about regular expressions
Just type in
perldoc perlre
Bye
Ram
--
To unsubscribe,
On Monday, September 29, 2003, at 10:53 AM, SilverFox wrote:
can anyone tell me how I can remove the period at the end of each line
below??
Sure. Place your cursor at the end of each line in turn and push the
backspace (or similar key) once... Oh, did you mean in Perl? ;)
What part are you
Holeman, Douglas wrote:
Bob,
Thank you for the help. If I may ask you one more question, how do I
modify the randbits on a w32 install or do I have to recompile the
source to get the number higher. It is 15 right now so it stalls at
about 32563. Any help would be appreciated.
Doug, I'm
Would someone mind telling me what I am doing wrong here please. I am trying to tie
the SCP Expect module into a backup script I put together, but it keeps failing. I
stripped out all but the SCP example code and it still generates an error from the
module. I verified my login, directory and
can you add a check length into a oneliner but w/o the $_[0]?
Also, is this correct and I guess to be consistent since the A-z test
didn't have the explicit reference to $_[0].:
sub isValidChars { return length($_[0]) 4 shift =~ /^[A-Za-z_.]+$/ }
On Sep 29, [EMAIL PROTECTED] said:
Since,
On Mon, 29 Sep 2003 11:53:16 -0400, SilverFox [EMAIL PROTECTED] wrote:
can anyone tell me how I can remove the period at the end of each line
below??
.
.
.
.
Let's see if I can start a flame war ;-)...
perldoc -f chop
I have a long list of IP addresses I am going to be reading in (using
regexps) and then seperating out into a list of IP addresses. I don't
want the IP addresses to be printed if they are not unique.
Is there a way to check if a string already has an element in a stack?
i.e. push @stack, $_ if
I don't want the IP addresses to be
printed if they are not unique.
Unless you need to keep the ordering of the values you should use a hash
like this.
my %data;
for (@list_of_ip) {
$data{$_} = 1;
}
my @unique = keys %data;
Rob
-Original Message-
From: Dan Anderson
You could use a hash instead.
Set the key to the ipvalue and the value to 1.
If ($ips{$thisip}) {
}
HTH
Paul
-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 12:58 PM
To: [EMAIL PROTECTED]
Subject: Is there a function to see if
On Tue, 30 Sep 2003 12:58:21 -0400, Dan Anderson [EMAIL PROTECTED] wrote:
I have a long list of IP addresses I am going to be reading in (using
regexps) and then seperating out into a list of IP addresses. I don't
want the IP addresses to be
Is this doing what it is suppose to and how efficient?
rule
- valid chars A-z0-9 _ - .
- cannot start with a digit
- cannot start with a space
- must be greater than 3 in length
sub isValidChars
{ my ($z) = @_;
return length($z) 3 $z !~ /^[\d\s]/ $z =~ /^[\w.]+$/
}
thanks,
-rkl
--
To
Sorry if this comes across twice. It bounced back the first time...
Would someone mind telling me what I am doing wrong here please. I am trying to tie
the SCP Expect module into a backup script I put together, but it keeps failing. I
stripped out all but the SCP example code and it still
That isn't quite right, you may get better milage with this...
# untested
if ($z =~ /^[a-zA-Z_\-\.][\w\-\.]{2,}$/) {
# is ok
}
else {
# failed
}
Yours should also work, except that...
1. \s isn't needed in the first regex since a space would fail in the second
regex anyway.
2. You need to
Hello all,
(david, sorry if you receive this several times, I've had a hard time
with the email client).
Thank you all for your attention. I'll answer here for the three
who wrote about this thread.
The example David wrote is wonderful. I was missing : shared.
That was exactly what I wanted to
Big advice #2. Ebay. I buy all new books and expensive books through
trusted sellers for about a 50-60% savings. Make sure you can pay media
rate on the shipping. $4.00. I routinely buy books for $15-20 here.
I do the same thing, and would add the following sites:
http://www.alibris.com
Fernando wants to send the following thanks to all people who helped him on
this topic and some explanation of what he really wants to do. He somehow
sent it to myself only.
#- forward message started -#
Hello all,
Thank you all for your attention. I'll answer here for
How do you declare a var global versus local? It seems variables a local
and not static as in shell. That is, the sub does not see the vars from
the calling part. So, can someone modify the snipet to make it work?
a.pl
--
#my $x; any diff from the next line?
$x=abc;
doMe
sub doMe
{ $x=xyz;
--On Monday, September 29, 2003 23:53 -0700 [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
-I've sent this to the mod_perl list but there seems to be no
response.
I got the module working in the current directory executing on the
command line. But I have a problem calling a module in my mod_perl
On Tue, Sep 30, 2003 at 11:03:02AM +0100, Dillon, John wrote:
According to
http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/argv.html
the following program will do ...whatever (make a backup of files) and it
takes the file specified at the command line. I guessed from this
--On Tuesday, September 30, 2003 11:31 -0700 [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
How do you declare a var global versus local? It seems variables a
local and not static as in shell. That is, the sub does not see the
vars from the calling part. So, can someone modify the snipet to
make
John Dillon wrote:
According to
http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/argv.html
the following program will do ...whatever (make a backup of files) and it
takes the file specified at the command line. I guessed from this that one
has a .pl file with the following
Besides the advice given below, there are a few other things you can do...
To add the location of the Perl script to the lib path you can use this.
The FindBin module finds your script, then sets $Bin to that location.
use FindBin qw($Bin);
use lib $Bin;
Another way to do it is to set the
Thanks for your help. I had tried the use lib path/to/module; and use
module; but it is still complaining about the use module part.
However, I took the easy route but may annoy structured folks, like perl
is very structured. I put it in /usr/lib/perl5/5.8.0
It works! Yippee! Perl programming is
my redhat 9 is configured canned w/apache and mod_perl. The only
configuration I know is in /etc/httpd/conf.d/perl:
Alias /mp /var/www/mp
Directory /var/www/mp
SetHandler perl-script
PerlHandler ModPerl::Registry::handler
PerlOptions +ParseHeaders
Options +ExecCGI
put this
The only configuration I know is
in /etc/httpd/conf.d/perl
Yup, that looks like the one.
put this here?
I think it would go right above (or below) the Alias line.
Rob
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 3:12 PM
[EMAIL PROTECTED] wrote:
How do you declare a var global versus local? It seems variables a local
and not static as in shell. That is, the sub does not see the vars from
the calling part. So, can someone modify the snipet to make it work?
a.pl
--
#my $x; any diff from the next line?
Can a calling program reference a package variable?
It's not working for me.
test.pl
---
use fruit;
#I want to use this like a stub or struct
#this does not work - it errored
print mystuff::a;
print mystuff::b;
#this work
mystuff::mixIt;
fruit.pm
--
package mixIt;
$a=apple;
Does the use strict; impact the my $x; declaration any differently?
What does our $x; do?
in any case, usig the same variable name such as $x in the main and other
sub would occur as a temporary place holder. However, I was curious on how
to access the outer var in the sub whcih you desc with
But the analogy with return/last is likely to confuse -- why can
you use retlast() in places where neither return() or last() make
any sense?
You are mainly right. I was perhaps too fast and careless when writing that
example. Also return and retlast were just the first words that came in to
my
Never mind, I figured it out by put add the $ infront like:
print $mystuff::a;
print $mystuff::b;
Hope this help any newbies getting into package.
-rkl
Can a calling program reference a package variable?
It's not working for me.
test.pl
---
use fruit;
#I want to use this like a
From: John W. Krahn [EMAIL PROTECTED]
You don't need a do block, the conditional operator can handle it.
@udat{ 'x', 'y' } = $subs-anna_tilavuus( $x + $lisax, $y + $lisay, $z )
100
? do { $subs-paivita( $x ); ( $lisax, $lisay ) }
: $subs-anna_tilavuus( $x, $y +
Any diff between MYPKG::hello(); and MYPKG-hello(); ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Tuesday, September 30, 2003, at 05:03 PM, [EMAIL PROTECTED] wrote:
Any diff between MYPKG::hello(); and MYPKG-hello(); ?
Yes. MYPKG::hello() is a standard subroutine call, targeting a
definition for hello() found in MYPKG. You should rarely need this
form as you would usually import need
[EMAIL PROTECTED] wrote:
Does the use strict; impact the my $x; declaration any differently?
no. 'my $x;' creates a lexical variable $x which is local to the block $x is
declared no matter you 'use strict;' or not use strict.
What does our $x; do?
perldoc -f our
in any case, usig the
Thanks budwill look into that..
Ramprasad A Padmanabhan wrote:
Silverfox wrote:
hey guys, I'm trying to figure out how to stripe Anything Else,
7:15pm and 9:50pm from the below html code. Any ides?
tdfont class=smalllista
Hello,
I've tried to install bugzilla on my linux box but when i
try to run the perl-scripts as a user i get the message Can't do setuid.
When i'm logged in as root the scripts works.
Thank you in advance
Artur
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Can someone make this work like I want? I'm trying to create a package
USER and reference/change it. The only thing I'm able to do is to call the
sub prtAll. I just want a structure that I can pass around in perl.
test.pl
---
use USER;
#this does NOT work
#how do i reference these vars
#this does NOT work
#how do i reference these vars
USER::fname=bob;
USER::lname=Bingham;
You need the $, like this...
$USER::fname=bob;
$USER::lname=Bingham;
But this may be what you really want. It will allow you to create multiple
USER objects, each with different values stored in them.
On Tuesday, September 30, 2003, at 06:01 PM, [EMAIL PROTECTED] wrote:
Can someone make this work like I want? I'm trying to create a package
USER and reference/change it. The only thing I'm able to do is to call
the
sub prtAll. I just want a structure that I can pass around in perl.
test.pl
James and Bob,
OK version x.2
- I want to create a user object with value initialized.
- Initialize/Change it anytime
test.pl
---
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob;
$ui-(lname) = Bingham;
#change name
$ui-(fname) = robert;
print ui: [ . $ui-full_name() . ]\n;
exit
James and Rob,
OK version x.2
- I want to create a user object with value initialized.
- Initialize/Change it anytime
test.pl
---
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob;
$ui-(lname) = Bingham;
#change name
$ui-(fname) = robert;
print ui: [ . $ui-full_name() . ]\n;
exit
On Tuesday, September 30, 2003, at 06:51 PM, [EMAIL PROTECTED] wrote:
James and Bob,
OK version x.2
- I want to create a user object with value initialized.
I showed you how to do this in my last message. Go back and take a
look.
- Initialize/Change it anytime
It's best to do this with
James pretty much covered everything, but here are my two coppers.
First thing is that this line is wrong...
my $self = { fname, lname };
It should be this...
my $self = {fname = '', lname = ''};
If you had use strict or warnings on it would have yelled about that one.
The way you had it, it
Artur Wystub wrote:
Hello,
Hello,
I've tried to install bugzilla on my linux box but when i
try to run the perl-scripts as a user i get the message Can't do setuid.
When i'm logged in as root the scripts works.
perldoc perldiag
[snip]
Can't do setuid
(F) This typically
It did complain or else I would have sent a thank you for making it work
already ;)
James pretty much covered everything, but here are my two coppers.
First thing is that this line is wrong...
my $self = { fname, lname };
It should be this...
my $self = {fname = '', lname = ''};
If you
Hi,
I want to be able to create a browser popup window big enough to hold my
text data. Is this possible or do I need to use JavaScript or something
else?
Thanks,
Jerry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
OK version x.3
Please just change these lines to make it work. The calling program
test.pl fails on the assignment line:
Bareword fname not allowed while strict subs in use at utest line 8.
Bareword lname not allowed while strict subs in use at utest line 9.
Bareword fname not allowed while
Can't believe you guys didn't catch it. I had parenthesis instead of
braces ;)
$ui-(fname) = bob; #incorrect ()
$ui-{fname} = bob; #correct {}
Thank for you help. Now asome enlighten questions.
- Are the fname and lname implicitly declared?
- I guess you can't have vars outside of the methods
Hi!
I am trying to swap all the '||' in a string to or:
s/||/ or /g;
I have tried it a number of ways, but I am getting no where.
Any ideas?
Thanks,
Jerry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Have you tried this?
s/\|\|/ or /g;
-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 7:06 PM
To: [EMAIL PROTECTED]
Subject: how to regex or
Hi!
I am trying to swap all the '||' in a string to or:
s/||/ or /g;
I have tried it
Because you seem to have been asking several questions about scoping and
packages, etc. I found the following link extremely enlightening when
first tackling this subject:
http://perl.plover.com/FAQs/Namespaces.html
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Jerry Preston wrote:
Hi,
I want to be able to create a browser popup window big enough to hold my
text data. Is this possible or do I need to use JavaScript or something
else?
You are going to need something client side, as I am assuming you are
talking about from CGI/mod_perl, which are server
Tim,
Yes, but does not do the job.
Thanks,
Jerry
-Original Message-
From: Tim Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 9:09 PM
To: 'Jerry Preston'; [EMAIL PROTECTED]
Subject: RE: how to regex or
Have you tried this?
s/\|\|/ or /g;
-Original
Then maybe I'm not understanding what you're asking. Take the following
example:
###
my $string = him||her||him||her;
$string =~ s/\|\|/ or /g;
print $string;
###
The output is him or her or him or her
Is that not what you're asking?
-Original Message-
Tim,
Yes, I will try it again. A typo on my part!
Thanks,
Jerry
-Original Message-
From: Tim Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 10:59 PM
To: 'Jerry Preston'; Tim Johnson; [EMAIL PROTECTED]
Subject: RE: how to regex or
Then maybe I'm not
69 matches
Mail list logo