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
  forward to another URL         


Author: Naved
Date: Mar 25, 2008 23:38

Hello,

Can anyone tell me how can I forward to another URL from my page in
CGI PERL.
I don't want to use Redirect method as it is sending back to client
side and then redirecting the page.

Application::Forward is there but I don't get any example related to
that method.
It is not working properly, may be because I haven't implemented it
correctly.

any help will be appreciable.

Thanks in advance.
5 Comments
  What's better than Template Toolkit?         


Author: fishfry
Date: Mar 25, 2008 22:38

I'm starting a little project. I've used TT for the front end before,
but it has some limitations and quirks as I'm sure people know. I was
wondering if anyone can recommend a better templating package.
8 Comments
  4gb USB Flash drive for $14.49         


Author: craigtrucko
Date: Mar 25, 2008 19:10

Hey Guys,
dealsusb.com has a 4gb USB Flash drive for $14.49
Free Shipping and no rebates. Now we can backup our smaller Databases
onto a USB really cheap.

craig
no comments
  FAQ 7.15 How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?         


Author: PerlFAQ Server
Date: Mar 25, 2008 18: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.15: How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?

With the exception of regexes, you need to pass references to these
objects. See "Pass by Reference" in perlsub for this particular
question, and perlref for information on references.

See "Passing Regexes", later in perlfaq7, for information on passing
regular expressions.

Passing Variables and Functions
Regular variables and functions are quite easy to pass: just pass in
a reference to an existing or anonymous variable or function:

func( \$some_scalar );

func( \@some_array );
func( [ 1 .. 10 ] );
Show full article (5.25Kb)
no comments
  Output to file is not flushing immediately         


Author: void.no.spam.com
Date: Mar 25, 2008 13:19

I have a perl script that writes stuff to a text file. While the
script is running, I do a "tail -f" on the text file to see the
output. But I can tell that the output isn't being flushed
immediately, because the script writes something to the file
immediately before sleeping for 60 seconds, but I don't see that
output show up in the "tail -f" until after it comes back from
sleeping.

I thought that putting a "\n" at the end of a print would do a flush,
but that's obviously not the case.

I also read that if you put "$| = 1" at the beginning of your script,
then it would do a flush after every print or write command. I tried
that, and it still does not flush.
1 Comment
  FAQ 7.11 How do I create a class?         


Author: PerlFAQ Server
Date: Mar 25, 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.11: How do I create a class?

See perltoot for an introduction to classes and objects, as well as
perlobj and perlbot.

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

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
no comments
  FAQ 7.23 How do I create a switch or case statement?         


Author: PerlFAQ Server
Date: Mar 25, 2008 06: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.23: How do I create a switch or case statement?

In Perl 5.10, use the "given-when" construct described in perlsyn:

use 5.010;

given ( $string ) {
when( 'Fred' ) { say "I found Fred!" }
when( 'Barney' ) { say "I found Barney!" }
when( /Bamm-?Bamm/ ) { say "I found Bamm-Bamm!" }
default { say "I don't recognize the name!" }
};

If one wants to use pure Perl and to be compatible with Perl versions
prior to 5.10, the general answer is to use "if-elsif-else":
Show full article (4.86Kb)
no comments
  Readline using foreach and while         


Author: Saurabh Jain
Date: Mar 25, 2008 00:25

Hi,
Is there any difference in reading a file using a while or a
foreach in perl?

If I do :
foreach() {
my $local = ; # I assumed I will increment the file
descriptor here
print " local $local\n";
}

But if I do :
while() {
my $local = ; # I assumed I will increment the file
descriptor here
print " local $local\n";
}
It works fine....
Is there something wrong or some difference in the two operations? Or
am I missing something?
Show full article (1.03Kb)
51 Comments
  FAQ 7.22 What's the difference between calling a function as &foo and foo()?         


Author: PerlFAQ Server
Date: Mar 25, 2008 00: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.22: What's the difference between calling a function as &foo and foo()?

When you call a function as &foo, you allow that function access to your
current @_ values, and you bypass prototypes. The function doesn't get
an empty @_--it gets yours! While not strictly speaking a bug (it's
documented that way in perlsub), it would be hard to consider this a
feature in most cases.

When you call your function as "&foo()", then you *do* get a new @_, but
prototyping is still circumvented.
Show full article (1.87Kb)
no comments