Net::POP3 & SSL?

2005-04-06 Thread David Garamond
How do I use Net::POP3 (or is there an alternative to Net::POP3) to talk to an SSL POP3 server (like gmail's)? Regards, dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: LWP: Accessing https URL from http proxy unimplemented?

2005-01-31 Thread David Garamond
Ing. Branislav Gerzo wrote: DG> I do have all three modules (Crypt::SSLeay, Net::SSLeay, DG> IO::Socket::Perl) installed, but still can't get https:// through an DG> http proxy. LWP::UserAgent would immediately return a response object DG> with code 501. I can access https:// URLs directly (without

Re: LWP: Accessing https URL from http proxy unimplemented?

2005-01-30 Thread David Garamond
David Garamond wrote: Peter Scott wrote: In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (David Garamond) writes: Is there an alternative to do this in Perl (without resorting to system "wget ..." or system "curl ...")? See http://search.cpan.org/src/GAAS/libwww-perl-

Re: LWP: Accessing https URL from http proxy unimplemented?

2005-01-30 Thread David Garamond
Peter Scott wrote: In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (David Garamond) writes: Is there an alternative to do this in Perl (without resorting to system "wget ..." or system "curl ...")? See http://search.cpan.org/src/GAAS/libwww-perl-5.803/README.SSL I

LWP: Accessing https URL from http proxy unimplemented?

2005-01-30 Thread David Garamond
Is there an alternative to do this in Perl (without resorting to system "wget ..." or system "curl ...")? -- sh -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread David Garamond
Gavin Henry wrote: I really like Perl, but lately everywhere I seem to go and talk to say I shouldn't be learning Perl as it's old and Python is better. My Good Lord, where have you been? Python is _already_ old news. Ruby, baby! :-) I am on the right path? The right path is probably to learn the

Weird SMTP filtering/blocking problem

2004-05-12 Thread David Garamond
I run a homegrown SMTP daemon written in Perl, on Redhat 7.3. Lately, emails sent from some clients are received in duplicates. The clients either run Communigate Pro, or IPlanet, MDaemon, all running some versions of Windows. The emails duplicate because the client sends it multiple times. The ca

Re: forcing stack backtrace in the case of unhandled exception/Perl error

2004-04-26 Thread David Garamond
Randy W. Sims wrote: On 4/26/2004 1:02 PM, David Garamond wrote: I've [re]discovered the wonderful world of Carp. I've now peppered most of my scripts with 'use Carp qw(verbose);'. However, whenever things go wrong (like my program calls an undefined subroutine, or I tried

forcing stack backtrace in the case of unhandled exception/Perl error

2004-04-26 Thread David Garamond
I've [re]discovered the wonderful world of Carp. I've now peppered most of my scripts with 'use Carp qw(verbose);'. However, whenever things go wrong (like my program calls an undefined subroutine, or I tried to modify a constant), my program dies without the stack backtrace. Any idea how I can

Re: exit perl script and cd in bash?

2004-01-20 Thread David Garamond
John W. Krahn wrote: It is very easy to change the directory from inside a Perl program however as soon as the program exits the changes will be lost. This is true of Perl or C or Bash or anything that runs as a child of the shell. A child process cannot change its parent's environment. This woul

Re: Perl equivalent of Ruby/DL?

2004-01-07 Thread David Garamond
Rob Dixon wrote: Ruby/DL is a Ruby module that enables one to load a .DLL/.so and start using exported functions available in the DLL. It's a nice alternative of using an external library without messing with XS or writing real C files. Ruby/DL has been included in the standard Ruby distribution si

Perl equivalent of Ruby/DL?

2004-01-06 Thread David Garamond
Ruby/DL is a Ruby module that enables one to load a .DLL/.so and start using exported functions available in the DLL. It's a nice alternative of using an external library without messing with XS or writing real C files. Ruby/DL has been included in the standard Ruby distribution since 1.8. ht

pick N random lines from a file

2003-12-10 Thread David Garamond
I'm trying to extend the Perl cookbook recipe on how to pick a random line from a file: #!/usr/bin/perl rand($.) < 1 && ($line = $_) while <>; print $line; for picking up to N random lines from a file: start code-- #!/usr/bin/perl die "Usage: $0 , where N is the number

Something like PHP's PEAR::DB_NestedSet?

2003-12-03 Thread David Garamond
This PHP module looks cool: http://pear.php.net/package/DB_NestedSet is there something like it in CPAN? -- dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: comparison between two regexes?

2003-10-24 Thread David Garamond
I wrote: Given two regex patterns R1 and R2, is it possible at all to determine/calculate: - whether R1 is "a subset of" R2, i.e. all strings that match R1 will also always match R2, but not necessarily the other way around; - whether R1 is "equivalent" or "equal" to R2, i.e. all strings that

comparison between two regexes?

2003-10-24 Thread David Garamond
Given two regex patterns R1 and R2, is it possible at all to determine/calculate: - whether R1 is "a subset of" R2, i.e. all strings that match R1 will also always match R2, but not necessarily the other way around; - whether R1 is "equivalent" or "equal" to R2, i.e. all strings that match R1

Re: limiting resource in regex matching

2002-11-30 Thread David Garamond
david wrote: The Perl book (I think it's the Programming Perl) has an example where a certain reg. exp and string combination can make Perl's reg. engine run forever (in terms of years!) because of backtracking. The solution the book generally recommand is to use one of the newer reg. exp exten

limiting resource in regex matching

2002-11-28 Thread David Garamond
i'm creating a web interface for users to add their own mail filtering rules. the rules allow them to specify regexes to match headers and mail body. however, i'm a little concerned with how users can accidentally/ intentionally use too complex regexes like this "(a+.*(b+.+(c*.+)*.*))*" and the

replace strings and preserve case

2002-11-06 Thread David Garamond
is there a short recipe to do this in perl? i want to replace all "die" with "paint" and preserve case (i.e. "Die" should be replaced by "Paint", "DIE" by "PAINT", and so on). there's a smart snippet on TPJ to do this: $string =~ s/($x)/"\L$y"^"\L$1"^$1/ie; but it only works if the replacemen

Re: detecting "visually similar" strings

2002-10-26 Thread David Garamond
hi perl, Perl wrote: For speed, I'd recommend caching a simplified 'eyedex' version of each person's username, either as a new column in their main record, or in a secondary list that is cross-indexed by the user_id. thanks for the suggestion. grouping visually similar characters (or chunks, m

detecting "visually similar" strings

2002-10-24 Thread David Garamond
hi, i want to develop a perl module to determine whether two strings are too "visually similar". for example, "ella" (double lowercase ell) and "e11a" (double 1 digit). so this is kind of Soundex but for the eyes. this checking is usable for avoiding "typo attacks" (like in the case of an atta

emacs perl mode

2002-10-12 Thread David Garamond
i've recently upgraded emacs from 20 to 21.2 and was delighted that the syntax coloring now works over telnet sessions. however, i've noticed that the perl mode which comes with the emacs distribution is not 'smart' enough. mainly, it can't detect strings which are quoted by q() or qq() (unfor

Re: how to get the last line of a file

2002-10-11 Thread David Garamond
alex chen wrote: > hi, all > > i want to know how to get the last line of > a file .i know the func read has a paramenter offset but i don't know how to > use it.please help!!! the easy way (but inefficient): # read until the last line open F, "file.txt" or die $!; $last=$_ while ; the m

Re: Problem with hashes

2002-10-10 Thread David Garamond
Nicole Seitz wrote: > 17 elsif ($line =~/^;([^\(]+)\s?[^\)]+\)\s?;(ZB-HP);Elsevier;/ ){ > 18#print "$1\t$2\n\n"; > 19$title = $1; > 20$title =~ s/\s$//; > 21$titles{$title}= $2; > 22} > 23} > 24 while ( ($

Re: private object attributes

2002-10-10 Thread David Garamond
James Edward Gray II wrote: > On Thursday, October 10, 2002, at 12:00 PM, David Garamond wrote: > >> thanks for the tip. the reason i am looking for "real" private >> attributes in the first place because i need to give objects (which >> are usually bles

Re: On script sandboxing

2002-10-10 Thread David Garamond
nkuipers wrote: > Pardon my ignorance, but what's the deal? Unless it comes authored, tested > and at least partially documented, like a CPAN module for example (other than > Safe.pm ;), why take the risk of exposing one's system to some script off the > Net? Saves time? Why reinvent the whe

Re: private object attributes

2002-10-10 Thread David Garamond
Paul Johnson wrote: > In general Perl treats this as a social rather than a programming problem. > This tends to unnerve some people coming from B&D (programming) > backgrounds. yes, i know this; i have a background in python, and the private attribute thingy is also not available in the langu

private object attributes

2002-10-10 Thread David Garamond
i've read the Object Orienter Perl book by Damian Conway, and in chapter 11 he explains about Tie::SecureHash that's supposed to provide capability to create private attributes. however, since a package is never closed, and we cannot override the 'package' op (via declaring sub CORE::GLOBAL::p

overriding builtin functions for sandboxing (Re: Safe.pm examples?)

2002-10-10 Thread David Garamond
i've been playing with Safe.pm for the past two days, and it's really giving me headaches :-) i can't seem to do anything really useful with it. the namespace "chroot"-ing makes me unable to use pretty much every extension modules i want to use. dynamic loading also doesn't seem to work at all

Re: Safe.pm examples?

2002-10-07 Thread David Garamond
i wonder if there is a way we can do this wrapping with the 'require' opcode top. i.e., i want to allow the 'require' opcode but trap every 'require' statements through my checking subroutine, which will only allow certain perl modules to be imported by the u

Re: Safe.pm examples?

2002-10-07 Thread David Garamond
david wrote: > sub main::open{ > #-- testing purpose > if($_[0] =~ m#^/#){ > die("Access under / not allowed\n"); > }else{ > open(FILE,$_[0]) || die $!; > return FILE; > } > } > > my $fh = &open('whatever'); oh, i di

Re: Safe.pm examples?

2002-10-07 Thread David Garamond
david wrote: > i won't say it's broken, it's just that the Safe.pm is not finalized yet and > thus will undergo(probably) major changes even in the interface level. > example: thanks for providing the example, david. i've been reading the Safe.pm and the Opcode documentation, and i am seeing a

Safe.pm examples?

2002-10-05 Thread David Garamond
i'm looking for something like a sandbox/compartment (like rexec module in python) so that i can be [reasonably] confident running untrusted snippets of code from inside the same process. Safe.pm seems like the perl way of doing it, right? however, from what i skimmed from the posts i got from go

Re: WHO IS NAVER-MAILER@naver.com ???

2002-10-05 Thread David Garamond
[EMAIL PROTECTED] wrote: > Every time I send a message to this list, I receive a message from > [EMAIL PROTECTED] immediately afterwards. It appears to be garbage > (lots of screwy characters...). > > Where is this coming from? Am I the only one receiving these? i suspect there is/are bounci

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Jeff 'japhy' Pinyan wrote: > %Foo::Bar::Constants::. But anyway, here's the trick I'd use: > > *short:: = *Foo::Bar::Constants::; > print $short::name; # $Foo::Bar::Constants::name ah thanks, this package aliasing thingie is what i had been trying to accomplish several hours earlier, to

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Jeff 'japhy' Pinyan wrote: > It's important to know that those "constants" aren't as efficient as their > non-method syntax cousins: > > package FOO; > use constant BAR => 10; > > package main; > print FOO::BAR; # at compile-time, Perl makes that 'print 10' > print FOO->BAR;

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Bob Showalter wrote: >use Foo::Bar::Constants (); >{ package X; Foo::Bar::Constants->import } >print $X::alice->{name};# prints "Alice" > > Here your using the Exporter functionality, but exporting symbols into the > "X" namespace instead of your current namespace. The empty paren

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
James Edward Gray II wrote: > Building on this though, if you made the constants module, couldn't you > make them subs? I believe this is even how the use constant pragma > functions. Heck make it an object oriented module with static methods > and it's even designed well. Just a thought. g

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
James Edward Gray II wrote: > I haven't tested it, but I'm quite sure: > > my $p = 'Long::Package::Name'; > $p->constant; > > ...works as expected. If memory serves this is even allowed under the > strict pragma. If not though, you could always localize a block with no > strict 'refs' where

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Timothy Johnson wrote: > I'm not sure if this is a GOOD idea, but I THINK you can actually get away > with something like this: In your module, insert a shorter package name, > but keep the module in the same place. So: > > package Foo::Bar::Constants; > > #do stuff here > >

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
thanks for the answer, bob. Bob Showalter wrote: > There's nothing that says the file Foo/Bar/Constants.pm must have a "package > Foo::Bar::Constants" declaration. true, and i've realized that. i come from a python background and by contrast, in python, filename and directory name dictate the

package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
i have several "constants" in a package: package Foo::Bar::Constants; $alice = {name=>"Alice", low=>-10, high=>21}; $bruce = {name=>"Bruce Wayne", low=>-17, high=>5}; $charlie = {name=>"Charlie", low=>-3, high=>3}; $devon = {name=>"Devon E.", low=>1, high=>29}; and i want to use t