Noah wrote:
okay I have a strange issue. all the lines as part of "my @lines = keys
%ip;" have a space at the beginning of the line of each key.
perldoc -q "Why do I get weird spaces when I print an array of lines?"
John
--
Perl isn't a toolbox, but a small machine shop where you
can speci
On Thu, 2008-07-24 at 10:06 -0400, yitzle wrote:
> On Thu, Jul 24, 2008 at 12:44 AM, Noah <[EMAIL PROTECTED]> wrote:
> >
> > Hi there,
> >
> > okay I have a strange issue. all the lines as part of "my @lines = keys
> > %ip;" have a space at the beginning of the line of each key.
> >
> > cheers,
>
On Thu, Jul 24, 2008 at 1:02 AM, Noah <[EMAIL PROTECTED]> wrote:
>
>>
>> Untested code.
>>
>> # Always...
>> use strict;
>> use warnings;
>>
>> my %ip = ...;
>>
>> #Get the lines as an array.
>> my @lines = keys %ip;
>>
>> # Slight modification to the regex. Someone else's reply will probably
>> ha
On Thu, Jul 24, 2008 at 12:44 AM, Noah <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> okay I have a strange issue. all the lines as part of "my @lines = keys
> %ip;" have a space at the beginning of the line of each key.
>
> cheers,
>
> Noah
Without knowing how %ip was formed or how you are decidin
Untested code.
# Always...
use strict;
use warnings;
my %ip = ...;
#Get the lines as an array.
my @lines = keys %ip;
# Slight modification to the regex. Someone else's reply will probably
have a more elegant method.
my $ipSearch = qr/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;
# Use v
yitzle wrote
Untested code.
# Always...
use strict;
use warnings;
my %ip = ...;
#Get the lines as an array.
my @lines = keys %ip;
# Slight modification to the regex. Someone else's reply will probably
have a more elegant method.
my $ipSearch = qr/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,
Noah
Untested code.
# Always...
use strict;
use warnings;
my %ip = ...;
#Get the lines as an array.
my @lines = keys %ip;
# Slight modification to the regex. Someone else's reply will probably
have a more elegant method.
my $ipSearch = qr/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;
On Thu, Jul 24, 2008 at 3:59 AM, Noah <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> I loaded a bunch of configuration lines into a hash called $Input
> now I am searching the hash to make sure specific lines are there.
>
> I want to print "NO" unless there is a match to the following ""check $ip
> h
Hi there,
I loaded a bunch of configuration lines into a hash called $Input
now I am searching the hash to make sure specific lines are there.
I want to print "NO" unless there is a match to the following ""check
$ip here";
but $ip could be the range as shown below.
so a key like "check 2.2