Hi there,
Your code looks OK...but first I'd tie the -NAME key to = $your_true_reference
and also eliminate the comma after the $user value.
It should work that way.
Good luck.
Marcos
Kirk W. Batzer [EMAIL PROTECTED] 10/30/01 10:38PM
I'm attempting to port a perl CGI application
from:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Carl Franks) wrote:
I'm having trouble with a cgi script, the main problem is the snippet below,
is there anything obvious wrong with it?
if (quotemeta $url =~ /$bad/i) {
$error = '1';
}
The rest of the code is posted below.
When
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Jimmy Lewis) wrote:
I have a project where the CGI form is being displayed in Netscape as raw
HTML but in IE it works fine. Are you familiar with this problem?
which version of netscape
does your form pass the validator test at
--- Jimmy Lewis [EMAIL PROTECTED] wrote:
I have a project where the CGI form is being displayed in Netscape as raw
HTML but in IE it works fine. Are you familiar with this problem?
Jimmy Lewis
Web Programmer
Jimmy,
This is a very common problem. You need to check the headers that your
Jimmy Lewis wrote:
I have a project where the CGI form is being displayed in Netscape as raw
HTML but in IE it works fine. Are you familiar with this problem?
Generally, this means that Netscape (version?, platform?) does not
recognize the MIME type of the data sent by the server as HTML.
-Original Message-
From: Jimmy Lewis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 30, 2001 11:24 PM
To: [EMAIL PROTECTED]
Subject: CGI Login in IE but NOT Netscape
I have a project where the CGI form is being displayed in
Netscape as raw
HTML but in IE it works fine. Are
--- Kirk W. Batzer [EMAIL PROTECTED] wrote:
I'm attempting to port a perl CGI application
from: perl, 5.005_02 built for 3446-svr4.0
to:perl, v5.6.1 built for sun4-solaris
The application uses cookies to maintain state information. The
following code is successfully creating and
Good afternoon,
Can some one point out where I am off?
use CGI qw/:standard/;
@fields = param(); # I think it returns a list of all the fields,
# maybe we want to inslist a hash to get the values.
foreach (@fields){
if ( $_ ~= /(|\?+|\d)/ ) {
# match or ??? or 0
# do something
Yeah I noticed that 5.6.1a4 (2001-07-20) couldn't handle a script I wrote
that was 40k (had a bunch of HTML blocks hard-coded in). Bit disappointing.
I should use MacOS X, which can run Perl and Apache due to it's unix
underpinnings, but I hate the UI and so many other things about it (mouse
David,
What I *think* you are asking is how to assign default values to form parameters and
then, after
reading all form values, have special handling of those parameters that have those
default values.
Your question is a bit vague (or maybe it's me?), so I'm just guessing. I'll respond
by
Hi,
On Tue, 30 Oct 2001, Guy Tubbs wrote:
Does anybody know if it is possible to trap errors in Perl when they occur
and then send them with a bit of info with sendmail?
Sure it is. In fact, you always want to trap errors in a web app so you
can die gracefully and give the user some nice
Thanks again for the help. If you don't mind me asking, would you happen to
know how to predefine the realm and site for the popup that happens when
a user logs in? I just got on this project and once the user logs in to the
area when they click on a link they get a second prompt for username and
I am attempting to use the DEFAULT parameter within a popup_menu to set the
displayed value to what I want based on the passed parameters in the URL.
I am using Mozilla 0.9.4 on a Linux machine, and hope that isn't the reason
I'm not seing what I want to see. Here is the code:
CODE
open(FL,c:\cygwin_syslog.txt);
Walter
Hi, How do u create an empty file named c:\cygwin_syslog.txt in Perl?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Do You
Could be a problem of path of a.out
(Why you use kill -9 ? You can use a normal TERM signal, with kill $pid)
Walter
Below is some perl code which works fine when executed locally, however when
I telnet to the system it is on and and it is run things are not run in the
correct order.
I think that the best way to do that is to use the Win32::ODBC module.
You have to create an odbc source to your SQL server db, then use the
Win32::ODBC::new($datasource) function to bind
it.
I never find a DBI module for MSSQL, may be you can try the Sybase DBI module because
this 2 dbs were
I agree, this sort of thing is probably a path issue. You should put an or
die or or warn conditional after your system call and have it report the
OS error. I believe the variable is $! for the system error. Might help if
you run with the -w switch, and I have recently gotten a lot of usage out
hi Pathi,
I believe that you would use DBD::ODBC module, then there won't be a big
problem. ^^
http://search.cpan.org/search?dist=DBD-ODBC
good luck
Pathi Erramilli [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
I am new to perl...I am trying to use DBI
Hi all,
I'm trying to read an html file from an URL.
It seemsOpen(FL,http://www.somesite.com/afile.html;)doesn't work.
Does anyone know how I can read this file?
Thanks,
Paul van Dijk
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
I'm quite new to perl hoping someone here can help me.
I need my perl program to change to a different user and I'm not sure how to
do it.
What I want;
run program a
run program b
change to user fred
move files
move more files
change back to root
run another program
I have perl running the
Thanks,
This version seemed to work with a lttle hacking, sue to our firewall. I
needed to download the .ppd file into the C:|perl\bin directory, download
the zip file that the ppd references, then edit the ppd file to point to the
local copies of these, but it worked.
Simon
-Original
When I put warnings on and have a block of printed text with
printEND;
or printEND;
it gives me a warning Use of uninitalized value at (filename)
(linenumber)
Any clue how to get rid of this?
Etienne
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
If running on Unix, one can use the su command to
change to a different user. Then the perl script would have
to be run as root on the host.
To change user, the shell syntax is :
su - fred
So one could set up something like:
system(su - fred -c \shell commands, mv a f, etc...\);
Inside the
There is a package LPW.
Shold be in the standard distribution of perl, anyhow you can dowload from
CPAN
Ex1.
use LWP::Simple;
$data = get(http://$host/;);
print $data\n;
Ex2.
use LWP::UserAgent;
$cnt=http://$host/;;
$agente=new LWP::UserAgent;
$rqs=new HTTP::Request('GET',$cnt);
I'm using Perl 5.6.0 on Linux.
I've written a program to take a given directory passed in via command
line,
traverse the directory, and for each user who owns a file in that
directory,
print out their total usage.
My first attempt captured the directory using `ls -alR` and storing the
results
hi,
Is there any way to return 2 or 3 scalar variables from a subroutine (like
passing a variable by reference in C)?
I would like to avoid returning an array, if possible, because it makes
the script very non-intuitive.
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
use Fcntl qw(:flock);
until(flock $fh, LOCK_EX|LOCK_NB)
{
$lockwait++;
if($lockwait == 10)
{
print STDERR timed out waiting for lock\n;
exit 1;
}
sleep 1;
}
this will do a non-blocking attempt to get the lock, and try 10
sub return_scalars {
$scal1 = 5; Assign values to scalars somehow
$scal2 = 7;
return \$scal1, \$scal2;
}
($test_scalar1, $test_scalar2) = return_scalars();
-Original Message-
From: Roy Peters [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31,
If I understand your question correctly, this will work:
#!/usr/bin/perl -w
use strict;
my ($a, $b, $c, $one, $two, $three);
$a=1; $b=2; $c=3;
($one, $two, $three)=Change($a, $b, $c);
print $one $two $three\n;
sub Change {
my ($x, $y, $z)=@_;
$x++;
$y=0;
$z=10;
return ($x, $y,
On Oct 30, 2001 at 11:01 +0530, Rajesh took the soap box and proclaimed:
: Hi All,
: I am trying to use an array of class::Struct as a member of
: another Class::Struct.
: This is something like a array of strcutures within structure in C.
: The code is like:
:
: use Class::Struct;
:
Etienne Marcotte wrote:
printEND;
or printEND;
it gives me a warning Use of uninitalized value at (filename)
(linenumber)
How does your text look like? Remember that variables are interpolated
in your text, if you don't want that use 'END' instead.
- RaFaL Pocztarski, [EMAIL PROTECTED]
On Oct 31, Roy Peters said:
Is there any way to return 2 or 3 scalar variables from a subroutine (like
passing a variable by reference in C)?
I would like to avoid returning an array, if possible, because it makes
the script very non-intuitive.
Subroutines can return any number of arguments.
Well it's an html print function
sub PrintTopOfPage{
my $body = $_[0];
printEND;
htmlbody $body
...
END
}
It works fine, variables are printed (it prints the value of the variable,
which is what I want), but I get that warning. I don't have the warning
when using individual print
Hello,
I'm brand new to the world of Perl. The topic I'm about to ask about
might have been addressed before. Sorry for the duplication, if that's
the case.
My understanding is that whatever is between the parens in a regexp get
stored in a variable ($1,$2,...). And, if you do a
this code just returns a reference to a scalar, which is rather pointless in
this case and really doesn't solve the problem.
sub return_scalars {
$scal1 = 5; Assign values to scalars somehow
$scal2 = 7;
return \$scal1, \$scal2;
}
($test_scalar1, $test_scalar2) = return_scalars();
you
Hey,
On an Oct 25 thread, someone asked how to remove trailing spaces.
The response was $Value =~ s/\s+$//.
Question.
1. The string upon which this operation was made is on $_ correct?
2. If I've made the assignment $tempstring = substr($_ ,0,20) how do I
remove trailing spaces from
-Original Message-
From: Matthew Blacklow [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 30, 2001 8:24 PM
To: [EMAIL PROTECTED]
Subject: Order of operations!
$pid = getppid;
...
$run = kill -9 $pid;
system($run);
So is this your automatic logout mechanism?
Can't I defeat
From: Gary M Rocco [EMAIL PROTECTED]
How can perl be used to manipulate windows?
You need Win32::Setupsup
May be installed by PPM from http://Jenda.Krynicky.cz/perl :
ppm install --location=http://Jenda.Krynicky.cz/perl Win32-
Setupsup
HTH, Jenda
=== [EMAIL
From: Roy Peters [EMAIL PROTECTED]
Is there any way to return 2 or 3 scalar variables from a subroutine
(like passing a variable by reference in C)?
I would like to avoid returning an array, if possible, because it
makes the script very non-intuitive.
Sorry? You think
I am attempting to create a hash slice from a hash. The hash is:
%hash =(test1 = test10,
test2 = test12 ,
test3 = test13)
I want the slice to include only the keys test1 and test3. How can I
accomplish this?
--
To
-Original Message-
From: Frank Newland [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 29, 2001 4:40 PM
To: [EMAIL PROTECTED]
Subject: Regex syntax
Hey,
On an Oct 25 thread, someone asked how to remove trailing spaces.
The response was $Value =~ s/\s+$//.
Question.
1.
--- Lisa Neclos [EMAIL PROTECTED] wrote:
I am attempting to create a hash slice from a hash. The hash is:
%hash =(test1 = test10,
test2 = test12 ,
test3 = test13)
I want the slice to include only the keys test1 and test3.
I have a systems hash that contains the type of system
as keys and the name of the machines as values:
%systems = (
sgi = [sgi1, sgi2],
linux = [linux1, linux2],
dec = [dec1, dec2]
};
Now, each type of system has default values like an
email help address, shell used, users home
LN I am attempting to create a hash slice from a hash. The hash is:
LN %hash =(test1 = test10,
LNtest2 = test12 ,
LN test3 = test13)
LN I want the slice to include only the keys test1 and test3. How can I
LN accomplish this?
FN Hey,
FN On an Oct 25 thread, someone asked how to remove trailing spaces.
FN The response was $Value =~ s/\s+$//.
FN Question.
FN 1. The string upon which this operation was made is on $_ correct?
no - $Value.
$Value = 'foo';
$Value =~ s/\s+$//;
$Value eq 'foo';
FN 2. If I've
Folks,
I have been converting several shell scripts to perl, one of my recent tasks
has
been to convert several egreps into an efficient perl subroutine.
each egrep (5 total) is kicked off to parse a single log dir of ~350 log
files
that grow in size as a process runs. The total size of a log
S I have a systems hash that contains the type of system
S as keys and the name of the machines as values:
S %systems = (
Ssgi = [sgi1, sgi2],
Slinux = [linux1, linux2],
Sdec = [dec1, dec2]
S };
S Now, each type of system has default values like an
S email help address, shell
There are many ways to do this. Here is just one example using a
closure.
package Remember;
# this is a closure
{
my $savedData = 0;# only accessible within this scope; side
effect is that
# it stays around as long as the module since
the following
unsubscribe
--
Gregory D. Tomczyk
IBM - Contractor
(503) 578-5390
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Daniel,
I am recreating the systems password, group and shadow
(when applicable) files.
So if the script is run on an sgi system, for example,
the files location is /etc. If it is run on a linux
machine is /usr/local/system. If there are new users,
create new directories for them: for sgis on
On Tue, Oct 30, 2001 at 03:22:33PM -0800, John W. Krahn wrote:
$ perl
-le'$_=;tr/A-Za-z//s;print'
DESCRIPTION
Ah, that was a good try, but what happens when you have:
A better solution would be:
So in the example that Daniel shows, how would I get
(reference) the value for the shell path for the sgi
system?
--- Daniel Gardner [EMAIL PROTECTED] wrote:
S I have a systems hash that contains the type of
system
S as keys and the name of the machines as values:
S %systems = (
Ssgi
On Oct 31, Sofia said:
So in the example that Daniel shows, how would I get
(reference) the value for the shell path for the sgi
system?
Using the data structure:
%systems = (
sgi = { defaults =
[sgi-help,/bin/csh,/home],
machines = [sgi1, sgi2],
},
On Wed, Oct 31, 2001 at 09:53:58AM -0800, Sofia wrote:
[snip]
%systems = (
sgi = [sgi1, sgi2],
linux = [linux1, linux2],
dec = [dec1, dec2]
};
[snip]
%default = (
sgi = [sgi-help,/bin/csh,/home],
linux =
[someaddress-help,/bin/bash,/usr/home],
dec =
On Tue, 30 Oct 2001 [EMAIL PROTECTED] wrote:
Chris Zubrzycki [EMAIL PROTECTED] wrote:
prefixed
by onion.perl.org (qpsmtpd/0.04) with SMTP; Tue Oct 30 16:22:25 2001
-
Looks like there is a config error in ezmlm, this is exactly what I'm
getting (and its really confusing
On Wed, 31 Oct 2001, Roy Peters wrote:
Is there any way to return 2 or 3 scalar variables from a subroutine (like
passing a variable by reference in C)?
I would like to avoid returning an array, if possible, because it makes
the script very non-intuitive.
In what ways does it make it
Kurt writes:
if ($client ne $newclient and $method ne $newmethod){
print something\n;#I'll actually be
printing this to my report once I get this worked out
}
Problem is that this seems to work for only the first set of variables and
ignores the
From: Jon Cassorla [EMAIL PROTECTED]
There are many ways to do this. Here is just one example using a
closure.
package Remember;
# this is a closure
{
my $savedData = 0;# only accessible within this scope;
sub rememberData
{
my $class =
It all started out as a simple script to rename some files.
Now I can't find my way out!
I have several hundred files that are named like this:
'ENDPNA.PROD.HRBANS(EDIFACT)'
Note that the file name includes single ticks, dots, and parens.
Here's what I've done so far:
snip
while (*) {
--- Jon Cassorla [EMAIL PROTECTED] wrote:
There are many ways to do this. Here is just one example using a
closure.
package Remember;
# this is a closure
{
my $savedData = 0;# only accessible within this scope; side
effect is that
# it stays around
Rich Fernandez a écrit :
It all started out as a simple script to rename some files.
Now I can't find my way out!
I have several hundred files that are named like this:
'ENDPNA.PROD.HRBANS(EDIFACT)'
Note that the file name includes single ticks, dots, and parens.
Here's what I've
Hello all,
I am trying to process a menu option but for some reason perl causes the
value to come up blank can anyone help? This is only hapening on the menu
items.
Is there a trick to sending drop down menus?
TNX,
Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
--- [EMAIL PROTECTED] wrote:
Hello all,
I am trying to process a menu option but for some reason perl causes the
value to come up blank can anyone help? This is only hapening on the menu
items.
Is there a trick to sending drop down menus?
TNX,
Mike
Mike,
What do you mean by menu?
On Wed, Oct 31, 2001 at 04:12:03PM -0500, Rich Fernandez wrote:
Rearranged a bit for clarity.
First, your error:
When I run this script, I get an error that says: A file or directory in
the path name does not exist.
This means that you tried to do something like:
mv foo bar/foo
where
Hey all,
Just wondering what the best way to find out what encryption I am
running on my Unix maxchine. Basically I have a problem where I need to
add a user from a Perl script something similar to the following...
use Crypt::PasswdMD5;
my $salt;
$password = password;
$cryptedpassword =
Hello,
I am working on a script that uses the backticks to execute a shell command,
and I want to output the results to a webpage. The problem I am having is that the
command I am running seems to take too long and the cgi does not return anything for
that variable. Is there a way to
Sorry bout that... I do mean select drop-downs from HTML. What I want to
do is have it email me all the info, which it does email me. Everything but
the dropdown menu information. see attached.
Thanks again...
Mike
Curtis Poe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
67 matches
Mail list logo