comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
March 2008
motuwethfrsasuw
     12 9
3456789 10
10111213141516 11
17181920212223 12
24252627282930 13
31       14
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Redirecting to my own login page instead of Apache Login         


Author: nahanfee
Date: Mar 23, 2008 21:22

Hello,

I made one login page (in cgi perl) which authenticates the user using
Ldap data. It is working fine.
Now I want to prevent the Apache web server User authentication page
to display and use my login page instead.

The idea is I am redirecting to the restricted folder (directory) only
if the authentication made.
But if user itself type the URL of that directory it is showing Apache
login page.

I am new in CGI and apache web configuration things.
any help will be appreciable

Thanks in advance
2 Comments
  passing filename path with spaces to subs         


Author: news2003
Date: Mar 23, 2008 18:09

I have a basic question. It has to do with the way I pass files with
spaces. I have two versions of the same code. once calls $exifTool-
>ExtractInfo($file) directly as argument from the command line.

perl extract.pl /home/john/pictures 2/15.jpg

with the code like:

my $file = $ARGV[0];

# Create a new Image::ExifTool object
my $exifTool = new Image::ExifTool;

# Extract meta information from image
$exifTool->ExtractInfo($file);

The second version is taking the code from a file
perl extract2.pl fdir.output.txt

being the code in this case:

open( FILE, "< $filename" ) or die "Can't open $filename : $!";

foreach my $line ( ) {
chomp ($line);
print $line."\t";
extractInfo("$line");
}
Show full article (1.62Kb)
8 Comments
  FAQ 6.16 How do I efficiently match many regular expressions at once?         


Author: PerlFAQ Server
Date: Mar 23, 2008 18:03

This is an excerpt from the latest version perlfaq6.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

6.16: How do I efficiently match many regular expressions at once?

( contributed by brian d foy )

Avoid asking Perl to compile a regular expression every time you want to
match it. In this example, perl must recompile the regular expression
for every iteration of the "foreach" loop since it has no way to know
what $pattern will be.

@patterns = qw( foo bar baz );
Show full article (3.24Kb)
no comments
  FAQ 7.2 What are all these $@%%&* punctuation signs, and how do I know when to use them?         


Author: PerlFAQ Server
Date: Mar 23, 2008 12:03

This is an excerpt from the latest version perlfaq7.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

7.2: What are all these $@%%&* punctuation signs, and how do I know when to use them?

They are type specifiers, as detailed in perldata:

$ for scalar values (number, string or reference)
@ for arrays
%% for hashes (associative arrays)
& for subroutines (aka functions, procedures, methods)
* for all types of that symbol name. In version 4 you used them like
pointers, but in modern perls you can just use references.

There are couple of other symbols that you're likely to encounter that
aren't really type specifiers:

<> are used for inputting a record from a filehandle.
\ takes a reference to something.
Show full article (2.21Kb)
no comments
  FAQ 6.22 How can I match strings with multibyte characters?         


Author: PerlFAQ Server
Date: Mar 23, 2008 06:03

This is an excerpt from the latest version perlfaq6.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

6.22: How can I match strings with multibyte characters?

Starting from Perl 5.6 Perl has had some level of multibyte character
support. Perl 5.8 or later is recommended. Supported multibyte character
repertoires include Unicode, and legacy encodings through the Encode
module. See perluniintro, perlunicode, and Encode.

If you are stuck with older Perls, you can do Unicode with the
"Unicode::String" module, and character conversions using the
"Unicode::Map8" and "Unicode::Map" modules. If you are using Japanese
encodings, you might try using the jperl 5.005_03.

Finally, the following set of approaches was offered by Jeffrey Friedl,
whose article in issue #5 of The Perl Journal talks about this very
matter.
Show full article (3.83Kb)
no comments
  FAQ 6.18 Why does using $&, $`, or $' slow my program down?         


Author: PerlFAQ Server
Date: Mar 23, 2008 00:03

This is an excerpt from the latest version perlfaq6.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

6.18: Why does using $&, $`, or $' slow my program down?

(contributed by Anno Siegel)

Once Perl sees that you need one of these variables anywhere in the
program, it provides them on each and every pattern match. That means
that on every pattern match the entire string will be copied, part of it
to $`, part to $&, and part to $'. Thus the penalty is most severe with
long strings and patterns that match often. Avoid $&, $', and $` if you
can, but if you can't, once you've used them at all, use them at will
because you've already paid the price. Remember that some algorithms
really appreciate them. As of the 5.005 release, the $& variable is no
longer "expensive" the way the other two are.
Show full article (2.03Kb)
no comments