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
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
://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
-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
://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
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
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
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
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
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
!
--
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
$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
]
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
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
{
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
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
-{'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
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
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
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
/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
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
{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
://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
. 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
{
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
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
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
;
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
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
--
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
--
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
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
, 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
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
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
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
...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
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
; }
--
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
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
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
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
.
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
://learn.perl.org/first-response
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
, 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
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
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
48 matches
Mail list logo