comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
December 2006
motuwethfrsasuw
    123 48
45678910 49
11121314151617 50
18192021222324 51
25262728293031 52
2006
 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
  Perl's reference is the best compare with other languages         


Author: howa
Date: Dec 31, 2006 20:14

after learning many years of programming languages, e.g. C, pascal,
C++, PHP

I believe Perl reference is the best and easy to learn, much better
than C pointer
1 Comment
  FAQ 4.55 How do I process an entire hash?         


Author: PerlFAQ Server
Date: Dec 31, 2006 18:03

This is an excerpt from the latest version perlfaq4.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 .

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

4.55: How do I process an entire hash?

(contributed by brian d foy)

There are a couple of ways that you can process an entire hash. You can
get a list of keys, then go through each key, or grab a one key-value
pair at a time.

To go through all of the keys, use the "keys" function. This extracts
all of the keys of the hash and gives them back to you as a list. You
can then get the value through the particular key you're processing:

foreach my $key ( keys %%hash ) {
my $value = $hash{$key}
...
}
Show full article (3.23Kb)
no comments
  FAQ 4.60 How can I always keep my hash sorted?         


Author: PerlFAQ Server
Date: Dec 31, 2006 12:03

This is an excerpt from the latest version perlfaq4.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 .

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

4.60: How can I always keep my hash sorted?

You can look into using the "DB_File" module and "tie()" using the
$DB_BTREE hash bindings as documented in "In Memory Databases" in
DB_File. The "Tie::IxHash" module from CPAN might also be instructive.
Although this does keep your hash sorted, you might not like the slow
down you suffer from the tie interface. Are you sure you need to do
this? :)

--------------------------------------------------------------------
Show full article (1.46Kb)
no comments
  Perl LWP post to password protected script         


Author: jcharth
Date: Dec 31, 2006 10:49

Hello i have a form that posts to a password protected script. Is there
a way to enter the username and password and post to a script with LWP?
I manage to get the form out of a password protected link using the LWP
username/password feature. but I dont think ill be lucky to post that
way. thanks
4 Comments
  FAQ 5.15 Why do I sometimes get an "Argument list too long" when I use <*>?         


Author: PerlFAQ Server
Date: Dec 31, 2006 06:03

This is an excerpt from the latest version perlfaq5.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 .

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

5.15: Why do I sometimes get an "Argument list too long" when I use <*>?

The "<>" operator performs a globbing operation (see above). In Perl
versions earlier than v5.6.0, the internal glob() operator forks csh(1)
to do the actual glob expansion, but csh can't handle more than 127
items and so gives the error message "Argument list too long". People
who installed tcsh as csh won't have this problem, but their users may
be surprised by it.

To get around this, either upgrade to Perl v5.6.0 or later, do the glob
yourself with readdir() and patterns, or use a module like File::KGlob,
one that doesn't use the shell to do globbing.

--------------------------------------------------------------------
Show full article (1.71Kb)
no comments
  FAQ 4.46 How do I handle linked lists?         


Author: PerlFAQ Server
Date: Dec 30, 2006 18:03

This is an excerpt from the latest version perlfaq4.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 .

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

4.46: How do I handle linked lists?

In general, you usually don't need a linked list in Perl, since with
regular arrays, you can push and pop or shift and unshift at either end,
or you can use splice to add and/or remove arbitrary number of elements
at arbitrary points. Both pop and shift are both O(1) operations on
Perl's dynamic arrays. In the absence of shifts and pops, push in
general needs to reallocate on the order every log(N) times, and unshift
will need to copy pointers each time.

If you really, really wanted, you could use structures as described in
perldsc or perltoot and do just what the algorithm book tells you to do.
For example, imagine a list node like this:
Show full article (2.91Kb)
no comments
  Re: Assigning pattern matches to an array         


Author: DJ Stunks
Date: Dec 30, 2006 15:29

Graham Stow wrote:
> "DJ Stunks" gmail.com> wrote in message
> news:1167506565.933525.68510@a3g2000cwd.googlegroups.com...
>> Graham Stow wrote:
>>> push(@matches, $line=~/\b\w+@\w+\b/g); did it for me
>>> The pattern doesn't match an email address, but I can work on that...
>>
>> well, for one thing, the \w metacharacter doesn't match a literal .
>>
>> don't roll your own email address regexp.
>>
>> perldoc Email::Address
>
> Emaill::Address doesn't grab me
> Done a quick test between
> use Email::Address
> push(@matches, Email::Address->parse($line));
> and
> push(@matches, $line=~/\b[.-\w]*@[-\w]*\.+[-\w]*\.*[-\w]*\b/g);
> The latter pulled up a number of correct email address, while the former ...
Show full article (0.93Kb)
no comments
  Re: Assigning pattern matches to an array         


Author: Paul Lalli
Date: Dec 30, 2006 14:25

Graham Stow wrote:
> Emaill::Address doesn't grab me
> Done a quick test between
> use Email::Address
> push(@matches, Email::Address->parse($line));
> and
> push(@matches, $line=~/\b[.-\w]*@[-\w]*\.+[-\w]*\.*[-\w]*\b/g);
> The latter pulled up a number of correct email address, while the former
> pulled these up plus other stuff that weren't true email addresses

Says you. I trust Email::Address's belief of what a "true" email
address is a hell of a lot better than yours. Just because they don't
look like what you might consider "normal" addresses doesn't mean they
aren't valid. Email::Address follows the RFC. Your handrolled
solution does not.

Paul Lalli
1 Comment
  [Announce] ClieOp2psv         


Author: Pieter de Rijk
Date: Dec 30, 2006 14:23

Hi All,

Clieop2psv is a tiny perl-script which converts ClieOp03-files into a
pipe-seperated-values (|) file. ClieOp files are used in the Netherlands
by telebankingsystems to load banktransactions out of an administration
application (i.e. SAP).

Website: http://www.adslweb.net/links/clieop2psv

Some nice details... it converts 279.236 lines with 69.016 transactions
within 1 minute (on a IBM Lenovo T60, with Safequard and Windows XP).

Information regarding ClieOp can be found at:
http://www.adslweb.net/links/clieopdoc

Have fun with it, if you need it!
--
Greetz,

Pieter de Rijk
Show full article (1.20Kb)
no comments
  Re: Assigning pattern matches to an array         


Author:
Date: Dec 30, 2006 14:11

Graham Stow schreef:
> /\b\w+@\w+\b/g;

The \b's are superfluous there.

--
Affijn, Ruud

"Gewoon is een tijger."
no comments
 
1 2 3 4 5 6 7