On 1/15/2008 3:09 PM, S.A. Birl wrote:
Sometimes I find the need to comment out a block temporarily.
My roots go back to C where I could quickly throw a
#if 0
#endif
if(0){
[...]
}
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
On 12/31/2007 7:10 PM, Chas. Owens wrote:
Use the embedded pattern-match modifier. See perldoc perlre or
http://perldoc.perl.org/perlre.html#'(%3fpimsx-imsx)' for more
information.
That's good info, thanks for the pointer!
--
Jeremy Kister
http://jeremy.kister.net./
--
To
On 12/31/2007 7:09 PM, Tom Phoenix wrote:
There is no correct way to use a variable as an operator.
[...]
This is why '(?i)' was invented. You want something like this:
perfect. Thanks!
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROT
print "match\n";
}
Thanks,
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
even possible, but I can't see any reason to need it, either.
Oops. I knew I was making a new hash (hence the variable name). I read
his message (and subject) to imply that all he wanted was dereferencing.
My fault.
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-ma
On 10/29/2007 7:23 PM, Aaron Priven wrote:
my $hashref = \%hash;
But as near as I can tell, there is no way to do the reverse
operation: making a "my %hash" that is an alias for a hash reference.
my %newhash = %{$hashref};
--
Jeremy Kister
http://jeremy.kister.net./
--
To u
oreach my $word (split(/\W+/, $_)){
print "<$word>\n" if($DEBUG);
}
}
also, you probably mean /^q$/i in that first regex, otherwise you're
matching any letter q -- quick, squid, etc
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PRO
go {
my $variable;
push @variable, 1;
return([EMAIL PROTECTED]);
}
1;
__END__
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 9/10/2007 5:13 PM, Rob Dixon wrote:
use List::Util qw/max/;
my %hash = (x => [ 'a','b','c' ],
y => [ 'd','e' ],
z => [ 'f' ],
);
my $most = max map scalar @$_, values %hash;
Woah!
On 9/10/2007 4:45 PM, Jeremy Kister wrote:
if(@{$hash{$key}} > $highest){
oops, that's if(@{$hash{$key}} > $most){
not $highest.
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROT
my $most = @{$hash{(sort { @{$hash{$b}} <=> @{$hash{$a}} } keys %hash)[0]}};
I ran each 500,000 times. I expected the second version finish sooner,
but it is noticeably slower than the first.
Can someone show me a better way to get this done ?
--
Jeremy Kister
http://jeremy.ki
";
print "\n";
or use a module that does it for you..
use Term::ReadKey;
print "passwd: ";
ReadMode 2;
chop(my $passwd=);
ReadMode 0;
print "\n";
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 5/26/2007 8:27 PM, Jeremy Kister wrote:
> I'm sure I'm just using the code incorrectly, but can't figure the
> right way to do it.
I've figured out the logic. $peer->update must go inside on of the peer
callbacks. I can simply add conditionals inside my time
Then the bgp session establishes, but the /32 is not injected.
If put
$peer->add_timer(\&foo, 20);
right before $bgp->event_loop, and put $peer->update inside sub foo,
then the injection works, but I resend the update every x seconds.
I'm sure I'm just using the code incorre
st.
Should I take this over to the mysql-perl list ?
Thanks!
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 5/8/2007 6:46 PM, Jeremy Kister wrote:
> I'm utilizing fork for the first time, and am having an issue which I
> can't track down.
I sent this original email with a bad return address. Four and a half
hours later, when the post still didnt make it to the list, I realized
tha
SULT: 1
SQL RESULT: 1
DBD::mysql::st execute failed: MySQL server has gone away at ftest.pl
line 36, line 3.
DBD::mysql::st execute failed: MySQL server has gone away at ftest.pl
line 36, line 3.
What's gone wrong?
perl 5.8.3, sun4-solaris
DBI 1.55
DBD::mysql 3.0007
--
Jeremy Kister
htt
nal to parent,maybe this
> break the dbh connection?try to add these 2 lines in parent code:
>
> use POSIX qw(:signal_h WNOHANG);
> $SIG{CHLD}=sub {while((my $child=waitpid(-1,WNOHANG))>0){}};
Nope, same problem.
Thanks,
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubs
as it can.
But instead:
SQL RESULT: 1
SQL RESULT: 1
SQL RESULT: 1
DBD::mysql::st execute failed: MySQL server has gone away at ftest.pl
line 36, line 3.
DBD::mysql::st execute failed: MySQL server has gone away at ftest.pl
line 36, line 3.
What's gone wrong?
perl 5.8.3, sun4-solaris
DBI
n with an empty line?
If not, you're not separating the header from the message body, and your
MUA thinks the whole message is a header.
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");
$smtp->datasend($file);
--
Jeremy Kister
http://jeremy.kister.
;,$y), "\n",
$q->hidden('a',$y), "\n",
$q->end_html();
using script.pl?x=5, you'll see that the cgi prints x=5 but a=6
apparently only happens when you're setting a parameter via 'hidden'
that was read by 'param'
perldoc -q quote talks about \Q before a regex to escape special characters.
how do you use \Q when you want to anchor the regex with a dollar sign ?
my $string = my $regex = "foo";
print "match\n" if($string =~ /^\Q${regex}$/);
--
Jeremy Kister
http://jeremy
On 6/19/2006 11:54 PM, Jeremy Kister wrote:
I wrote a word descrambler that works very well, but is very slow
compared to http://www.jumble.org
already found a very important piece that I missed ($lfound)..
while(1){
print "word: ";
chop(my $scramble = );
next unless($found == $slen);
print "$word\n";
}
}
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
han a 10 character message?
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
"[EMAIL PROTECTED]';
it also doesnt appear that you need m/ --- / will do fine by itself in
this context.
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Can't use string ("string1") as a HASH ref while "strict refs" in use
What's the correct method for this?
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 8/9/2005 8:43 AM, John W. Krahn wrote:
> Jeremy Kister wrote:
>>I've apparently dumbed down my code and question a bit too much: I have
>>multiple hashrefs in each element of the array, and I need the resulting
>>sorted array to contain all the data in the original
ontain all the data in the original array, simply
sorted by the value of N.
my @a = ( {N => '10.1.2.1', ID => 1},
{N => '10.1.9.1', ID => 2},
{N => '10.3.5.1', ID => 3},
{N => '10.1.1.3', ID =>
$a->[3] <=> $b->[3] }
map { [ $_, split /\./ ] } $a->{N};
but that simply fails to produce. I've replaced $a->{N} with multiple
variations, but I'm confused.
If someone can give me code, I'd also appreciate a clue.
thanks,
--
Jerem
after the while loop, I'm trying to build a new version of @array,
sorted by the 'name' key.
Anyone feel like throwing example code my way?
--
Jeremy Kister
http://jeremy.kister.net./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P
fine with perl 5.6.0,
5.6.1, and 5.8.5 (assuming perl is the difference, and not the differences
between Solaris 7 and 9)
Is there a more compatible way to check my overly-long string?
Is this a problem with perl 5.8.0?
Is this simply some kind of resource exaustion on my system ?
--
Jeremy K
<=> $b->[4]
> > ||
> > $a->[5] <=> $b->[5]
> > } map { [ $_, split /[. ]/ ] } @unsorted;
wild.. But since the data is already in a hash, are you suggesting to first
loop through the hash, pushing the
uot;;
}
foreach my $sorted (map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [$_,split] } @unsorted){
print "$sorted\n";
}
--
Jeremy Kister
http://jeremy.kister.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
on.
there doesnt seem to be any warning or error when you ($$$) but only provide
1 argument, for example.
Jeremy Kister
http://jeremy.kister.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
correctly.
Either solution from myself or from Gunnar will work.
Jeremy Kister
http://jeremy.kister.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
sh){
print "$value\n";
}
Jeremy Kister
http://jeremy.kister.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On Wednesday, August 25, 2004 5:57 PM, loan tran wrote:
> So for example here is my file:
> 1 5 4
> 1 0 2
> 1 2 2
> 2 0 2
> 3 0 3
> 3 4 6
> And here is the output file I want:
> 1 2 2
> 2 0 2
> 3 4 6
not extensively tested:
#!/usr/local/bin/perl
open(F, "file.txt");
while(){
On Monday, August 23, 2004 3:12 AM, Edward Wijaya wrote:
> @array = (10,11,12) #fix to three element
>
> is there any way I can assign each any of these
> elements into variable ($A, $B, $C) in a quick way.
> Such that $A = 10, $B =11, $C=12 (this is fixed).
($a,$b,$c) = @array;
inary gamble (or maybe a "blind" bet)
> and say POE can do it :-)
I'm looking at it now... thanks again.
Jeremy Kister
http://jeremy.kister.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On Wednesday, August 18, 2004 5:56 PM, I wrote:
> can anyone give me a clue as to how to use IO::Multiplex on top of
> Net::DNS::Nameserver?
Is there a more advanced Perl list than perl-beginners, where someone may
have hints?
I've browsed lists.perl.org but found nothing appropria
can anyone give me a clue as to how to use IO::Multiplex on top of
Net::DNS::Nameserver?
I'm assuming that $ns->main_loop would go inside the mux_input sub, but am
confused on how IO::Multiplex actually gives data to Net::DNS::Nameserver.
Thanks,
Jeremy Kister
http://jeremy.ki
e (which could cause it to wait for
input) ?
I've looked at Net::SMTP, but see that it incorrectly assumes only the first
line is the banner.
Note that I'm not looking for a solution for only SMTP (where the /200\s/
give me a way to cheat), but a solution to the problem as a whole.
Jer
43 matches
Mail list logo