When you post perl code use the perl highlighter, not the php highlighter which can mangle some perl code.
Your shortcut character class in the regexp are wrong, the shortcut classes like a space need a backslash \s:
I don't know if that will make your code do anything useful but it at least corrects the mistake in the regex.
Sry about using perl code in the php code tag must of missed the <code> tag.
Anyway I know about escaping the metacharacters, and I did that, but dunno for what reason I copied it wrong, not sure. thx for pointing that out though :P
One more question :
Afaik in a sub $_[0],$_[1] refers to the first and second parameter which was sent to the function (correct me if im wrong please). So for example I have
the problem is that @a in getindex only gets the first value of @horse , and not the entire array. How do I manage to pass to it the whole array?
edit: i found out the answer I had to use @a= @_;
Hi :)
I just wanted to ask a few basic questions really. I'm telnetting to a remote host and I've finally found out that I'm using a csh shell.
My questions are:
1. Is the somename@something, the user group logged in?
2. How do I change user?
I'm really lost so I hope someone can help... (7 Replies)
Even though I have been logging in to a UNIX shell at school to complete school projects and write programs, but I had never really worked in UNIX environment. But a couple of weeks back I got hooked on to Solaris 9OE, read a book, a tutorial, a document provided on the Sun Microsystems website,... (1 Reply)
RH 7.2
I have 2 unrelated questions -
1.) I have been able to configure and run ntp but cannot figure out how to start the service upon reboot. I have read the man pages for ntsysv - this is a manual action, but I want to drop a tarball of config files on a new installation and cannot... (1 Reply)
I am relatively new to both KSH and Unix scripting, and I would like some help getting my script up and running. I would like to have the script attempt various commands (tar, copy, gzip etc) and then write the results (error msg or success msg) to a temp file. I would then like an email sent to... (2 Replies)
I have been an apple customer for years now, and am not satisfied with the direction that they are going. So I just ordered my first PC notebook the other day. I have no desire to use windows, however with microsoft's hold on the market, I feel that I may have a hard time doing this. I want to... (2 Replies)
Hi Unix gurus,
I know these are some easy questions.
But i just want to be sure about them.
Hope someone can help explain the following please?
1) if ]
- What does the "-r" means?
2) isql -U $DBUSER -D $DBNAME -S $DSQUERY -w 1000 -s";" << testfile > $FILE
- What does the -s";" mean and... (1 Reply)
Hello,
I want to learn LISP, and I have a GNU/Linux OS. I first sought a LISP compiler/interpreter and was told that GNU Emacs has a LISP mode. But I couldn't get into LISP mode, nor I don't know how to use it when I get into LISP mode.
How can I run LISP code under GNU Emacs?
And if... (1 Reply)
Hello everyone, I am brand spanking new to both Solaris and Unix. I thought I would give it a go after buying a SB2500 off ebay for a few hundred dollars.
I am having some issues that I am not sure how to correct, and I am wondering if I can get a few pointers?
The first one is that my system... (2 Replies)
Hi Guys, I am new in this forum and new with AIX however not new with Power System. I have worked with iSeries for many years. Now supporting AIX on Power.
Here are some basic questions I have.
1. I am using Putty to connect from my PC to the AIX boxes. Is there any other (better) program to... (6 Replies)
Discussion started by: 300zxmuro
6 Replies
LEARN ABOUT DEBIAN
authen::simple::http
Authen::Simple::HTTP(3pm) User Contributed Perl Documentation Authen::Simple::HTTP(3pm)NAME
Authen::Simple::HTTP - Simple HTTP authentication
SYNOPSIS
use Authen::Simple::HTTP;
my $http = Authen::Simple::HTTP->new(
url => 'http://www.host.com/protected'
);
if ( $http->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::HTTP
PerlSetVar AuthenSimpleHTTP_url "http://www.host.com/protected"
<Location /protected>
PerlAuthenHandler Authen::Simple::HTTP
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
DESCRIPTION
Authenticate against an HTTP server.
METHODS
* new
This method takes a hash of parameters. The following options are valid:
* url Url to authenticate against. Required.
url => 'http://www.host.com/protected'
* agent Any object that is a subclass of LWP::UserAgent.
agent => LWP::UserAgent->new;
* log Any object that supports "debug", "info", "error" and "warn".
log => Log::Log4perl->get_logger('Authen::Simple::HTTP')
* authenticate( $username, $password )
Returns true on success and false on failure.
SEE ALSO
Authen::Simple.
LWP::UserAgent.
LWPx::ParanoidAgent.
AUTHOR
Christian Hansen "ch@ngmedia.com"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-03-01 Authen::Simple::HTTP(3pm)