Re: Script Required to Check a range of IP's

2006-06-29 Thread Anthony Ettinger
If it helps, I wrote a script to ping a list of mirrors, from a list of fqdn's... http://perl-e.chovy.com/sample/ping-mirrors http://perl-e.chovy.com/sample/ping-mirrors.txt -- Anthony Ettinger Resume: http://chovy.dyndns.org/resume.html (I'm currently available for contract/telecommute work

Re: best way of getting a web document

2006-06-25 Thread Anthony Ettinger
do some simple XML validation and manipulation in some cases. I've used HTTP::Request, curl is easy too...watch what you pass to the command line though. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Comparing dates

2006-06-25 Thread Anthony Ettinger
://www.msn.co.uk/newsletters -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: CPAN::Shell install into customer dir

2006-06-24 Thread Anthony Ettinger
-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: using (sharing) variables between perl files

2006-06-19 Thread Anthony Ettinger
://learn.perl.org/first-response read about object oriented perl. or you can always use a config file. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
platform you cannot write a line-oriented script. If files are too big to slurp then you'd work on chunks, but need to check by hand whether a CRLF has been cut in the middle. I'm reading each line in a while loop, so it should work fine on a large file? -- Anthony Ettinger Signature: http

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
On 6/19/06, John W. Krahn [EMAIL PROTECTED] wrote: Anthony Ettinger wrote: # order matters $raw_text =~ s/\015\012/\n/g; $raw_text =~ s/\012/\n/g unless \n eq \012; $raw_text =~ s/\015/\n/g unless \n eq \015; Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g

two process writing simultaneously

2006-06-17 Thread Anthony Ettinger
with an strace at the same time. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: About Encryption/ Decription

2006-06-16 Thread Anthony Ettinger
available in http://search.cpan.org/~aar/Module-Crypt-0.04/Crypt.pm Module::Crypt -- Prabu -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http

newlines on win32, old mac, and unix

2006-06-13 Thread Anthony Ettinger
replacing CR (not followed by LF) with LF should work on mac, and CRLF with LF on dos, and leaving LF untouched on *nix (other)then it shouldn't be a problem...however it appears that \cJ is actually different on win32 than it is on unix. so is \cJ is actually \cM\cJ on win32? -- Anthony

Re: subroutine?

2006-06-12 Thread Anthony Ettinger
! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: How to bind values in IN value

2006-06-10 Thread Anthony Ettinger
$result-execute(@$userid); You declared an array @userid, not an arrayref, so you don't need to dereference it. $result-execute(@userid); should do the trick. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Problem installing captcha

2006-06-10 Thread Anthony Ettinger
] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response t/1Can't locate GD.pm in @INC (@INC install GD (requires the C library for GD as well) -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
way to ensure not dropping tables on accident, especially if you load an sql file with drop table foo if foo exists. I almost did that at work the other day on a table with 1 character diff in the name (i was lucky, and added dp_ to all my table namespaces). -- Anthony Ettinger Signature: http

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
{ my $self = shift; return $self-{'table_prefix'}; } So now when you can print Dumper($self-{'table_prefix'}); and it should have the value from the config file. my $log = new Log; print $log-getTablePrefix(); -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
my ($option) = $_ =~ s/(.*?)#/; #skip inline comments should be m//, not s// On 6/8/06, Anthony Ettinger [EMAIL PROTECTED] wrote: On 6/8/06, Graeme McLaren [EMAIL PROTECTED] wrote: Hi Anthony, good idea about overriding the table names. I had a feeling there would be a conf file

Re: Yet another OO question

2006-06-08 Thread Anthony Ettinger
-{'foo'} = shift; } return $self-{'foo'}; } -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Yet another OO question

2006-06-08 Thread Anthony Ettinger
On 6/8/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: On Thu, 2006-08-06 at 10:56 -0700, Anthony Ettinger wrote: i prefer the return once method: sub foo { my $self = shift; if (@_ == 1) { $self-{'foo'} = shift; } return $self-{'foo'}; } I would prefer it to return the old

modifying @INC permanently

2006-06-08 Thread Anthony Ettinger
Is there a way to modify @INC for the perl installation as a whole? All my scripts have logic to push the same directory to @INC. It's rather repetative. I know I can export PERL_LIB environment variable, but I need something for all system users (including win32). -- Anthony Ettinger

Re: modifying @INC permanently

2006-06-08 Thread Anthony Ettinger
accordingly, based on path names. I tried File::Spec, but use lib won't take a variable as it's evaluated before runtime, so that left me with push. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: modifying @INC permanently

2006-06-08 Thread Anthony Ettinger
/path/ ?? -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Yet another OO question

2006-06-08 Thread Anthony Ettinger
On 6/8/06, Lawrence Statton [EMAIL PROTECTED] wrote: I would prefer it to return the old value: sub foo { I see...I i've been more or less looking at the current state $curr = $foo-bar(); $old = $curr; $curr = $foo-bar('new value'); -- Anthony Ettinger Signature: http

Re: regex to match a range of numbers?

2006-06-07 Thread Anthony Ettinger
{1,2}([1..31])}; __END__ -- Joshua Colson [EMAIL PROTECTED] iNation, LLC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org

Re: Multiple Page Scrape

2006-06-06 Thread Anthony Ettinger
://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: What are the problems with my CGI script

2006-06-06 Thread Anthony Ettinger
. Setting it as empty is still a value, so you potentially could have empty values in your database. if (defined($name)) would be better, but can be rather cumbersome. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: reading Perl syntax

2006-06-06 Thread Anthony Ettinger
{ my $self = shift; if (@_== 1) { #if there's another param, set that as the value $self-{'fookey'} = shift; } return $self; } 1; -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: reading Perl syntax

2006-06-06 Thread Anthony Ettinger
just execute it with perl -wl foo or add the shebang line: #!/usr/bin/perl -w On 6/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Anthony Ettinger [EMAIL PROTECTED] writes: The syntax {} is for a hashref, it's just an un-named hashref inside that object. my $foo = new Foo; print $foo

Re: reading Perl syntax

2006-06-06 Thread Anthony Ettinger
There's a good book PHP5 Patterns and Object Oriented Programming which I found very instrumental in my understanding of object-oriented programming, before applying it to Perl. There are of course Perl books on the subject, and the perldocs, but I found PHP's object oriented support to be less

Re: searching word in script

2006-06-02 Thread Anthony Ettinger
; Following is the error readline() on closed filehandle FH at C:\irfan\search.pl line 13. can anybody plz help Regards Irfan Sayed -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Escaping a plus sign

2006-05-30 Thread Anthony Ettinger
Nowosielski -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: accessor problem in OO

2006-05-27 Thread Anthony Ettinger
-- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: GnuPG again: problem with if statement evaluation

2006-05-25 Thread Anthony Ettinger
-- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: GnuPG again: problem with if statement evaluation

2006-05-25 Thread Anthony Ettinger
ps...you're checking if it has a value, 256 (a typical error return code) would pass that test. On 5/25/06, Anthony Ettinger [EMAIL PROTECTED] wrote: check $? or $! $gp-foo() or die $!; my $output = $gp-foo(); print return code: $?; see perldoc perlvar On 5/25/06, Jason Balicki [EMAIL

Re: sub never called

2006-05-23 Thread Anthony Ettinger
, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org

Re: Running perl from perl?

2006-05-23 Thread Anthony Ettinger
sub routine defined inside foo.pl -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread Anthony Ettinger
On 5/23/06, John W. Krahn [EMAIL PROTECTED] wrote: Japerlh wrote: What are the most successful applications of Perl? http://www.oreillynet.com/pub/a/oreilly/perl/news/success_stories.html movable type is one that I know of off hand. -- Anthony Ettinger Signature: http://chovy.dyndns.org

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread Anthony Ettinger
ebay.com started out as a perl, but it's been revamped as java for a few years now. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread Anthony Ettinger
...course everybody uses perl here and there for batch processing :) On 5/23/06, Anthony Ettinger [EMAIL PROTECTED] wrote: ebay.com started out as a perl, but it's been revamped as java for a few years now. -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- Anthony

Re: Create Directories

2006-05-22 Thread Anthony Ettinger
warnings; use File::Path; eval { mkpath(c:\\a\\test\\path) }; if ($@) { print Couldn't create: $@; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature

Re: regex..gah

2006-05-09 Thread Anthony Ettinger
; } -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

using our across blocks

2006-05-02 Thread Anthony Ettinger
at ./script.pl line yy. Is this the correct way to import globals? $perldoc vars says...: NOTE: For variables in the current package, the functionality provided by this pragma has been superseded by our declarations, available in Perl v5.6.0 or later. See our in perlfunc. -- Anthony

Re: using our across blocks

2006-05-02 Thread Anthony Ettinger
On 5/2/06, Jay Savage [EMAIL PROTECTED] wrote: On 5/2/06, Anthony Ettinger [EMAIL PROTECTED] wrote: I want to double-check that it is correct to use our to import globals. [snip] What do you mean by import? Variables aren't imported from BEGIN blocks. They're declared in BEGIN blocks

Re: using our across blocks

2006-05-02 Thread Anthony Ettinger
On 5/2/06, Charles K. Clarkson [EMAIL PROTECTED] wrote: Anthony Ettinger wrote: : #!/usr/bin/perl -w : : use vars qw($foo); #globals; : use strict; : : sub foo { : $foo = 'foo'; : my $baz = 'baz'; : } : : my $baz = 'pre-baz'; : foo(); : : print $foo, \n; : print $baz, \n; I

Re: using our across blocks

2006-05-02 Thread Anthony Ettinger
. On 5/2/06, Charles K. Clarkson [EMAIL PROTECTED] wrote: Anthony Ettinger wrote: : #!/usr/bin/perl -w : : use vars qw($start_time $end_time); : use strict; : : BEGIN { : $start_time = time(); : } : : sub log_time { : my $exit_code = shift; : my $elapsed_time

Re: What is the function of BEGIN in perl

2006-05-01 Thread Anthony Ettinger
://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html

executing block on STDIN

2006-05-01 Thread Anthony Ettinger
, but with PRE-STDIN, POST-STDIN functionality? Thanks, -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: executing block on STDIN

2006-05-01 Thread Anthony Ettinger
On 5/1/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: On Mon, 2006-01-05 at 16:28 -0700, Anthony Ettinger wrote: I'm tracking execution time of a bunch of scripts, and want to drop in tracker.pl into each script...the problem I'm faced with is if a user walks away from their computer while

Re: executing block on STDIN

2006-05-01 Thread Anthony Ettinger
Thanks, I'll look into this...looks good so far though. I can just stick my @t = times; print join(\n, @t), \n; at the bottom of the script. On 5/1/06, John W. Krahn [EMAIL PROTECTED] wrote: Anthony Ettinger wrote: I'm not trying to benchmark, just gather some real-world data in my tools