Detecting the Country and other information of a IP address

2004-05-25 Thread LRMK
I want one of my scripts to process IP addreses and detect the country and
other information like city, ISP, and the IP range which has the same
attributes

I tryied writing a script to post the IP address to regional network
information center's web site's who is form and then process the resulting
web page but this only work for the IPs within that region. An also I think
this is illegal

What is the better and professional way of doing this?
Is there a module for this.






Rakhitha Karunarathne
Web Master
www.Ad-Man.tk - Free Unlimited Banner Rotators



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to execute a Perl script in Linux??? (I havent seen linux)

2004-05-25 Thread John W. Krahn
Lrmk wrote:
> 
> I have never used a computer with linux so I need a very clear answer
> I have a script uploaded to
> 
> /home/myusername/public_html/cgi-bin/rating/rank.pl
> 
> in my web host
> 
> I want it to execute once a week So I am gonna use Cron Jobs I can set the
> timing its very simple
> But I dont know what is the command to execute the above script.
> 
> Somebody tell me what should I give to the cron jobs as the "command" ?

1.  Ensure that the script is recognized by the system as a perl script.
The _FIRST TWO_ characters of the script should be #! followed by
the FULL absolute path of the perl executable.

- start of rank.pl -
#!/usr/bin/perl -T
use warnings;
use strict;
- the rest of rank.pl follows -

2.  Ensure that the script is executable by the OWNER of the cron job.

man chmod
man chown

3.  Ensure that any files or programs used by the script include the
FULL
absolute path of the file or program.

4.  Ensure that the crontab entry uses the FULL absolute path of any
files
or programs.



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: entering text within a file

2004-05-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote:
> 
> All,

Hello,

> I am having some trouble figuring this out.  I want to enter some text
> within a pre-existing file.  Here is what the file would look like
> 
> E00140
> E00141
> E00143
> .
> .
> .
> 
> here is my code thus far
> 
> #!/usr/local/bin/perl -w
> use strict;
> my $ejectapes = "/usr/local/bin/perld/exports";
> open (ACSLS, "$ejectapes") || die "cannot open file ejectapes \n: $!";
> while (defined($ejectapes = <>)) {
> print "eject", "\t", "0,0,0", "\t", "\n", $_;
> close (ACSLS);
> }
> 
> I want to print eject 0,0,0 before the tapeid

You can either use Perl's "in-place" edit feature or use a second file
to write the data to.  Using in-place edit would look something like
this:

#!/usr/local/bin/perl -w
use strict;
( $^I, @ARGV ) = ( '', '/usr/local/bin/perld/exports' );

s/^(?=E\d{5})/eject\t0,0,0\t\n/ while <>;




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: array population from system app call

2004-05-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote:
> 
> yes it does thanks!  Will you be so kind and answer my other question too?
> 
> maybe I am not understanding when a multidimensional array would be
> useful?  when are these references useful?
> is there a perldoc I can read as well?

perldoc perldata
perldoc perllol
perldoc perldsc


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: array population from system app call

2004-05-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote:
> 
> All,

Hello,

> was hoping anyone could provide some syntax help.
> 
> I want to populate an array from a system app call like so and then
> print out each element.
> 
> my @ftapes = system ("evmvol -w label_state=3|grep barcode");
> print $ftapes[0]
> 
> or
> 
> print $ftapes[0,1]
> 
> The problem is it prints out all the lines for print $ftapes[0] and does
> not print for print $ftapes[0,1]
> 
> OR
> should I just run the system call,  put it to a file
> then open the file,  read line by line
> chomp
> foreach $_
> print $_
> close file

Either:

my @ftapes = grep /barcode/, `evmvol -w label_state=3`;


Or:

open PIPE, 'evmvol -w label_state=3 |' or die "Cannot open pipe from evmvol: $!";
my @ftapes = grep /barcode/, ;
close OUTPUT or warn $! ? "Cannot close pipe from evmvol: $!"
: "Exit status $? from evmvol";

print $ftapes[ 0 ];

or

print @ftapes[ 0, 1 ];



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Finding a string in a file

2004-05-25 Thread John W. Krahn
Debbie Cooper wrote:
> 
> I need to search for the occurrence of a string in a file that is buried in
> directories.  So, for example, I have a directory structure that looks like
> this C:\data\elec\1\220\webdata.tab.  The last three folders change
> frequently so I can have c:\data\appl\3\180\webdata.tab and so on.  The file
> I'm searching will always be called webdata.tab.  It is a tab delimited file
> with headers and I need to search the header for a specific word like
> "Brand" and somehow return the directory structure where the word is found.
> Can this be done in "beginning" perl?

You could do something like this (untested):

@ARGV = glob 'C:/data/*/*/*/webdata.tab';

my @files;
while ( <> ) {
push @files, $ARGV if /string/;
close ARGV if $. == 5;  # five header lines?
}

print "$_\n" for @files;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




entering text within a file

2004-05-25 Thread DBSMITH
All, 

I am having some trouble figuring this out.  I want to enter some text 
within a pre-existing file.  Here is what the file would look like

E00140
E00141
E00143
.
.
.


here is my code thus far

#!/usr/local/bin/perl -w
use strict;
my $ejectapes = "/usr/local/bin/perld/exports"; 
open (ACSLS, "$ejectapes") || die "cannot open file ejectapes \n: $!";
while (defined($ejectapes = <>)) {
print "eject", "\t", "0,0,0", "\t", "\n", $_;
close (ACSLS);
}


I want to print eject 0,0,0 before the tapeid

thanks again!

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



Re: array population from system app call

2004-05-25 Thread James Edward Gray II
On May 25, 2004, at 2:45 PM, [EMAIL PROTECTED] wrote:
James,
yes it does thanks!  Will you be so kind and answer my other question 
too?
Good news.  Yes, I will...
maybe I am not understanding when a multidimensional array would be
useful?  when are these references useful?
is there a perldoc I can read as well?
The docs are:
perlreftut
and
perlref
References are great for building complex data structures, ask you 
guessed.  However they add a degree complexity, so make sure you need 
them before you inflict that upon yourself.

James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: array population from system app call

2004-05-25 Thread DBSMITH
James, 

yes it does thanks!  Will you be so kind and answer my other question too?

maybe I am not understanding when a multidimensional array would be 
useful?  when are these references useful?
is there a perldoc I can read as well?

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams






James Edward Gray II <[EMAIL PROTECTED]>
05/25/2004 03:37 PM

 
To: [EMAIL PROTECTED]
cc: Perl Beginners <[EMAIL PROTECTED]>
Subject:Re: array population from system app call


On May 25, 2004, at 2:24 PM, [EMAIL PROTECTED] wrote:

> here is the sample output.
>
>
> barcode=E01124
> barcode=E01178
> barcode=E01195
> barcode=E01225
> barcode=E01232
>
> maybe I am not understanding when a multidimensional array would be
> useful?  when are these references useful?

I really doubt you need a multidimensional array here.  The first half 
of all those lines is the same and since you filtered the output to get 
just that, I assume we can throw it away.  You just want the codes 
after the = sign, right?  Let's ask for that:

my @codes = grep s/^barcode=//, `evmvol -w label_state`;

Does that get what you're after?

James





Re: array population from system app call

2004-05-25 Thread James Edward Gray II
On May 25, 2004, at 2:24 PM, [EMAIL PROTECTED] wrote:
here is the sample output.
barcode=E01124
barcode=E01178
barcode=E01195
barcode=E01225
barcode=E01232
maybe I am not understanding when a multidimensional array would be
useful?  when are these references useful?
I really doubt you need a multidimensional array here.  The first half 
of all those lines is the same and since you filtered the output to get 
just that, I assume we can throw it away.  You just want the codes 
after the = sign, right?  Let's ask for that:

my @codes = grep s/^barcode=//, `evmvol -w label_state`;
Does that get what you're after?
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Digest:MD5 compilation errors...

2004-05-25 Thread Jenda Krynicky
From: [EMAIL PROTECTED] (PerlDiscuss - Perl Newsgroups and mailing lists)
> I'm trying to install Digest:MD5 2.33 on RHES 3 and getting
> compilation errors:
> 
> perl Makefile.PL
> Perl's config says that U32 access must be aligned.
> Writing Makefile for Digest::MD5
> 
> make
> Makefile:85: *** missing separator.  Stop.
> 
> Here's a snippet of the Makefile starting with line #85:
> installman1
> INSTALLSITEBIN = /usr
> INSTALLVENDORBIN = /usr/bin'
> installvendorhtml1=''
> installvendorhtml3=''
> installvendorlib='/u

This looks wrong.

Please look into your .../lib/Config.pm and search for 
installvendorlib there. Does it have a sane value?

I have 
installvendorlib=''
but you may need to have something different there.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: array population from system app call

2004-05-25 Thread DBSMITH
here is the full output.


volid=
name=
luname=st_9840_acs_0
slot_index=1
barcode=E01124
mtype=35
atype=0
sequence=0
mside=0
state=0
open_count=0
v_flags=0
comment=
flags_value: 0x108
flags: RVM_IS_FOREIGN RVM_IS_IN_REAL_LU 

volid=
name=
luname=st_9840_acs_0
slot_index=4
barcode=E01178
mtype=35
atype=0
sequence=0
mside=0
state=0
open_count=0
v_flags=0
comment=
flags_value: 0x108
flags: RVM_IS_FOREIGN RVM_IS_IN_REAL_LU 

volid=
name=
luname=st_9840_acs_0
slot_index=0
barcode=E01195
mtype=35
atype=0
sequence=0
mside=0
state=0
open_count=0
v_flags=0
comment=
flags_value: 0x108
flags: RVM_IS_FOREIGN RVM_IS_IN_REAL_LU 

volid=
name=
luname=st_9840_acs_0
slot_index=17
barcode=E01225
mtype=35
atype=0
sequence=0
mside=0
state=0
open_count=0
v_flags=0
comment=
flags_value: 0x108
flags: RVM_IS_FOREIGN RVM_IS_IN_REAL_LU 

volid=
name=
luname=st_9840_acs_0
slot_index=24
barcode=E01232
mtype=35
atype=0
sequence=0
mside=0
state=0
open_count=0
v_flags=0
comment=
flags_value: 0x108


Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145





James Edward Gray II <[EMAIL PROTECTED]>
05/25/2004 02:59 PM

 
To: [EMAIL PROTECTED]
cc: Perl Beginners <[EMAIL PROTECTED]>
Subject:Re: array population from system app call


On May 25, 2004, at 1:34 PM, [EMAIL PROTECTED] wrote:

> ok so now I can get all elements printed using
>
> my @ftapes = ( );
> my @ftapes = `evmvol -w label_state=3|grep barcode`;
>
> foreach $_  (@ftapes) {
> print $_ , "\n";
> }
>
> so now I want to use multidimensional arrays using print $ftapes[0,1]
> does print $ftapes [0,1] mean print element 0 and element 1 or address 
> 0,1
> am I confusing a normal array with a MDarray?

Perl arrays are not multidimensional.  Using references though, we can 
get there.

Backticks return LINES, not fields.  If we want to break them down, 
we'll need to do that.

Can you show a sample output of `evmvol -w label_state`?

James





Re: array population from system app call

2004-05-25 Thread DBSMITH
here is the sample output.


barcode=E01124
barcode=E01178
barcode=E01195
barcode=E01225
barcode=E01232

maybe I am not understanding when a multidimensional array would be 
useful?  when are these references useful?


Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams






James Edward Gray II <[EMAIL PROTECTED]>
05/25/2004 02:59 PM

 
To: [EMAIL PROTECTED]
cc: Perl Beginners <[EMAIL PROTECTED]>
Subject:Re: array population from system app call


On May 25, 2004, at 1:34 PM, [EMAIL PROTECTED] wrote:

> ok so now I can get all elements printed using
>
> my @ftapes = ( );
> my @ftapes = `evmvol -w label_state=3|grep barcode`;
>
> foreach $_  (@ftapes) {
> print $_ , "\n";
> }
>
> so now I want to use multidimensional arrays using print $ftapes[0,1]
> does print $ftapes [0,1] mean print element 0 and element 1 or address 
> 0,1
> am I confusing a normal array with a MDarray?

Perl arrays are not multidimensional.  Using references though, we can 
get there.

Backticks return LINES, not fields.  If we want to break them down, 
we'll need to do that.

Can you show a sample output of `evmvol -w label_state`?

James





Re: array population from system app call

2004-05-25 Thread James Edward Gray II
On May 25, 2004, at 1:34 PM, [EMAIL PROTECTED] wrote:
ok so now I can get all elements printed using
my @ftapes = ( );
my @ftapes = `evmvol -w label_state=3|grep barcode`;
foreach $_  (@ftapes) {
print $_ , "\n";
}
so now I want to use multidimensional arrays using print $ftapes[0,1]
does print $ftapes [0,1] mean print element 0 and element 1 or address 
0,1
am I confusing a normal array with a MDarray?
Perl arrays are not multidimensional.  Using references though, we can 
get there.

Backticks return LINES, not fields.  If we want to break them down, 
we'll need to do that.

Can you show a sample output of `evmvol -w label_state`?
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: array population from system app call

2004-05-25 Thread DBSMITH
ok so now I can get all elements printed using

my @ftapes = ( );
my @ftapes = `evmvol -w label_state=3|grep barcode`;
 
foreach $_  (@ftapes) {
print $_ , "\n";
}

so now I want to use multidimensional arrays using print $ftapes[0,1]
does print $ftapes [0,1] mean print element 0 and element 1 or address 0,1
am I confusing a normal array with a MDarray?

where 

[0] is a subscript address so to get the first element I would say print 
$ftapes [0]

thanks

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



Re: array population from system app call

2004-05-25 Thread DBSMITH
excellent I did not know that about system!

thanks again!

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams






James Edward Gray II <[EMAIL PROTECTED]>
05/25/2004 02:08 PM

 
To: [EMAIL PROTECTED]
cc: Perl Beginners <[EMAIL PROTECTED]>
Subject:Re: array population from system app call


On May 25, 2004, at 1:03 PM, [EMAIL PROTECTED] wrote:

> cool, but why doesn't
> my @ftapes = system ("evmvol -w label_state=3|grep barcode");
> print $ftapes[0]
>
> OR
> print $ftapes[0,1]
>
> work?

Because system() does not return the program's output, it returns exit 
status.

> I see that it does not support multidimensional arrays, so how do I
> implement this using system?

Multi-dimensional arrays are possible in Perl, with references.  If you 
want to talk about that, please send a new message asking your 
questions about that topic.

You don't do what you show with system() because that's not what it's 
for.  Backticks fill that role.

James





Re: array population from system app call

2004-05-25 Thread James Edward Gray II
On May 25, 2004, at 1:03 PM, [EMAIL PROTECTED] wrote:
cool, but why doesn't
my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]
OR
print $ftapes[0,1]
work?
Because system() does not return the program's output, it returns exit 
status.

I see that it does not support multidimensional arrays, so how do I
implement this using system?
Multi-dimensional arrays are possible in Perl, with references.  If you 
want to talk about that, please send a new message asking your 
questions about that topic.

You don't do what you show with system() because that's not what it's 
for.  Backticks fill that role.

James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: array population from system app call

2004-05-25 Thread DBSMITH
cool, but why doesn't 
my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]

OR
print $ftapes[0,1] 

work? 

I see that it does not support multidimensional arrays, so how do I 
implement this using system?

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145





"Halkyard, Jim" <[EMAIL PROTECTED]>
05/25/2004 01:58 PM

 
To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc: 
Subject:RE: array population from system app call




To capture output you need the backticks 

my @output = `put your command here`;

The return value of a system call is the return value of the program you 
call.

See perldoc perlfaq8 for more info

Jim

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 May 2004 18:45
To: [EMAIL PROTECTED]
Subject: array population from system app call


All, 

was hoping anyone could provide some syntax help.

I want to populate an array from a system app call like so and then 
print out each element.


my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]


or 

print $ftapes[0,1]

The problem is it prints out all the lines for print $ftapes[0] and does 
not print for print $ftapes[0,1]


OR 
should I just run the system call,  put it to a file
then open the file,  read line by line 
chomp
foreach $_
print $_
close file

thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 






Re: array population from system app call

2004-05-25 Thread James Edward Gray II
On May 25, 2004, at 12:45 PM, [EMAIL PROTECTED] wrote:
All,
was hoping anyone could provide some syntax help.
I want to populate an array from a system app call like so and then
print out each element.
my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0];
You're looking for backticks:
my @ftapes = `evmvol -w label_state=3|grep barcode`;
# etc...
Hope that helps.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: array population from system app call

2004-05-25 Thread Halkyard, Jim


To capture output you need the backticks 

my @output = `put your command here`;

The return value of a system call is the return value of the program you call.

See perldoc perlfaq8 for more info

Jim

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 May 2004 18:45
To: [EMAIL PROTECTED]
Subject: array population from system app call


All, 

was hoping anyone could provide some syntax help.

I want to populate an array from a system app call like so and then 
print out each element.


my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]


or 

print $ftapes[0,1]

The problem is it prints out all the lines for print $ftapes[0] and does 
not print for print $ftapes[0,1]


OR 
should I just run the system call,  put it to a file
then open the file,  read line by line 
chomp
foreach $_
print $_
close file

thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




array population from system app call

2004-05-25 Thread DBSMITH
All, 

was hoping anyone could provide some syntax help.

I want to populate an array from a system app call like so and then 
print out each element.


my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]


or 

print $ftapes[0,1]

The problem is it prints out all the lines for print $ftapes[0] and does 
not print for print $ftapes[0,1]


OR 
should I just run the system call,  put it to a file
then open the file,  read line by line 
chomp
foreach $_
print $_
close file

thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



Re: Finding a string in a file

2004-05-25 Thread Chris Charley

- Original Message - 
From: "Debbie Cooper" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 25, 2004 12:11 PM
Subject: Finding a string in a file


> I need to search for the occurrence of a string in a file that is buried
in
> directories.  So, for example, I have a directory structure that looks
like
> this C:\data\elec\1\220\webdata.tab.  The last three folders change
> frequently so I can have c:\data\appl\3\180\webdata.tab and so on.  The
file
> I'm searching will always be called webdata.tab.  It is a tab delimited
file
> with headers and I need to search the header for a specific word like
> "Brand" and somehow return the directory structure where the word is
found.
> Can this be done in "beginning" perl?
>
> Thanks,
> Debbie
>

Hi Debbie

The following code will do what you want, I think.

#!/usr/bin/perl
use strict;
use warnings;
use File::Find;

my @directories = ("C:/data/");

find(\&wanted,  @directories);

sub wanted {
if ($_ eq "webdata.tab") {
open my $fh, "<", "$_" or die "open $_: $!";
while (my $line = <$fh>) {
if ($line =~ /\bBrand\b/) {
print"$File::Find::dir\n";
last;
}
}
close $fh;
}
}


HTH
Chris



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Finding a string in a file

2004-05-25 Thread Jan Eden
Debbie Cooper wrote on 25.05.2004:

>I need to search for the occurrence of a string in a file that is
>buried in directories.  So, for example, I have a directory
>structure that looks like this C:\data\elec\1\220\webdata.tab.  The
>last three folders change frequently so I can have
>c:\data\appl\3\180\webdata.tab and so on.  The file I'm searching
>will always be called webdata.tab.  It is a tab delimited file with
>headers and I need to search the header for a specific word like
>"Brand" and somehow return the directory structure where the word is
>found. Can this be done in "beginning" perl?
>

Sure. Make use of File::Find to traverse the directory structure. For each file, you 
will have the whole path in the $File::Find::name variable. You could do something like

use File::Find;
find(\&wanted, @directories_to_search);

sub wanted {
if $File::Find::name =~ /webdata.tab/ {
# open the file and look for the header
# return a message including the $FIle::Find::name if the header is found
}
}

HTH,

Jan
-- 
If all else fails read the instructions. - Donald Knuth

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Finding a string in a file

2004-05-25 Thread Debbie Cooper
I need to search for the occurrence of a string in a file that is buried in
directories.  So, for example, I have a directory structure that looks like
this C:\data\elec\1\220\webdata.tab.  The last three folders change
frequently so I can have c:\data\appl\3\180\webdata.tab and so on.  The file
I'm searching will always be called webdata.tab.  It is a tab delimited file
with headers and I need to search the header for a specific word like
"Brand" and somehow return the directory structure where the word is found.
Can this be done in "beginning" perl?

Thanks,
Debbie


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: matrix solving

2004-05-25 Thread Wiggins d Anconia
Please bottom post

> Hi,
> Can some one provide an example sample on how to use it? 
> 

There is an example at the bottom of the docs for the module,

http://search.cpan.org/~ulpfr/Math-Matrix-0.4/Matrix.pm#EXAMPLE

http://danconia.org

> Thank you & best regards,
> ABC
> 
> 
> -Original Message-
> From: Jose Alves de Castro [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 21, 2004 6:24 PM
> To: Boon Chong Ang
> Cc: [EMAIL PROTECTED]
> Subject: Re: matrix solving
> 
> Try using Math::Matrix (you can find it on CPAN)
> 
> 
> On Fri, 2004-05-21 at 11:18, Boon Chong Ang wrote:
> > Hi,
> > I want to use perl to do the matrix solving such as matrix inversion
and and matrix multiplication, matrix addition and matrix substraction.
However, i have no idea how to do it in perl. Any there anyone who can
give me some suggestion how to solve this?
> >  
> > 
> > Thank you & best regards,
> > 
> > ABC
> > 
> >  
> -- 
> José Alves de Castro <[EMAIL PROTECTED]>
> Telbit - Tecnologias de Informação
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Digest:MD5 compilation errors...

2004-05-25 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm trying to install Digest:MD5 2.33 on RHES 3 and getting compilation
errors:

perl Makefile.PL
Perl's config says that U32 access must be aligned.
Writing Makefile for Digest::MD5

make
Makefile:85: *** missing separator.  Stop.

Here's a snippet of the Makefile starting with line #85:
installman1
INSTALLSITEBIN = /usr
INSTALLVENDORBIN = /usr/bin'
installvendorhtml1=''
installvendorhtml3=''
installvendorlib='/u
INSTALLSCRIPT = /usr/bin
PERL_LIB = /usr/lib/perl5/5.8.0

What's wrong and how can I fix this?

Thanks!




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Modify $0 in Perl embedded in C

2004-05-25 Thread JupiterHost.Net

zentara wrote:
On Fri, 21 May 2004 20:37:33 -0500, [EMAIL PROTECTED]
(Jupiterhost.Net) wrote:

Hello group!
Maybe a bit much for a beginners list (I looked and looked and couldn't 
find any specific lists) but Perhaps a guru or two will know the answer :)

Have you tried the  perl.inline  list?
That's where the Inline::C experts are.
Nope but I will :) Thanks for the tip!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: How to find files in subdirectory

2004-05-25 Thread Jan Eden
LKTee wrote on 25.05.2004:

>Hi, after refer the File::Find, I write the script below:
>
>#!/usr/bin/perl
>use warnings;
>use strict;
>use File::Find;
>find ( \&callback, "/") ;
>
>sub callback{
>   print $File::Find::name, "\n";
>}
>
>but this script will list all the filename, from the disk. So, how I
>set the condition, only display the same filename in the same
>directory? Anybody can give me the solution? And your solution will
>appreciate.

print $File::Find::name, "\n" if $File::Find::name =~ /File1$/;

HTH,

Jan
-- 
Common sense is what tells you that the world is flat.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to execute a Perl script in Linux??? (I havent seen linux)

2004-05-25 Thread Ramprasad A Padmanabhan
Wow, you have learnt how to set up the cron. But havent seen linux ?
anyway you can run your command as 
perl  

RE: How to find files in subdirectory

2004-05-25 Thread LKTee
Hi, after refer the File::Find, I write the script below:

#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
find ( \&callback, "/") ;

sub callback{
print $File::Find::name, "\n";
}

but this script will list all the filename, from the disk. So, how I set the
condition, only display the same filename in the same directory? Anybody can
give me the solution? And your solution will appreciate.  




-Original Message-
From: Tim Johnson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 13, 2004 11:21 AM
To: LK Tee; [EMAIL PROTECTED]
Subject: RE: How to find files in subdirectory


Check the documentation for the File::Find module.  It comes standard
with most Perl distributions. 

-Original Message-
From: LK Tee [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 6:52 PM
To: '[EMAIL PROTECTED]'
Subject: How to find files in subdirectory

Hi, I'm perls beginner now, I have a problem when create a script find
all file in subdirectory that have the same filename. How I write the
script using perl and return the result like below:

 

File1: ~/A/File1~/A/AA/File1   ~/A/C/CC/CCC/File1

 

Kuan.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to execute a Perl script in Linux??? (I havent seen linux)

2004-05-25 Thread David Dorward
On 25 May 2004, at 10:25, LRMK wrote:
I have never used a computer with linux so I need a very clear answer
I have a script uploaded to
/home/myusername/public_html/cgi-bin/rating/rank.pl
in my web host
I want it to execute once a week So I am gonna use Cron Jobs I can set 
the
timing its very simple
But I dont know what is the command to execute the above script.

perl /home/myusername/public_html/cgi-bin/rating/rank.pl
--
David Dorward
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



How to execute a Perl script in Linux??? (I havent seen linux)

2004-05-25 Thread LRMK
I have never used a computer with linux so I need a very clear answer
I have a script uploaded to

/home/myusername/public_html/cgi-bin/rating/rank.pl

in my web host

I want it to execute once a week So I am gonna use Cron Jobs I can set the
timing its very simple
But I dont know what is the command to execute the above script.

Somebody tell me what should I give to the cron jobs as the "command" ?






Rakhitha Karunarathne
Web Master
www.Ad-Man.tk - Free Unlimited Banner Rotators



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to send "Net Send" messages from a Linux Server

2004-05-25 Thread Tarun Dua
Lrmk wrote:

> I want to write a Perl script to send net send messages to the windows
> based computers but my scripts are running on Linux computer.
You can use the smbclient command on linux.
echo "Message" | smbclient -M 
-Tarun

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Question of memory management in Perl

2004-05-25 Thread Marcos . Rebelo
Probably you notice that you have +- 1kb for each hexa values. This seems
that you have some global variables that are not necessary.

Usually the solution is having the variables scoped to the minimum code area
possible. Module 'strict' can help. 

for instance if you have something like.

my @array;
foreach (...) {
... 
}
... Code1 ...
... Code2 ...

and the @array is just used inside the array and in the Code1 area, this
shall be better.

{
   my @array;
   foreach (...) {
  ... 
   }
   ... Code1 ...
}
... Code2 ...


Is ugly but with big data struts, frees the unnecessary memory.


I don't know for sure the effect of:

@out_array_bin = map {""} (@out_array_bin);

instead of

for ($init_cnt=0;$init_cnt<=$#out_array_bin;$init_cnt++) {
   $out_array_bin[$init_cnt] = "";
}

But is more readable.

Probably better then evrithing is not having the 786432 values on the
memory.

Marcos

> -Original Message-
> From: Hari Krishnaan [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 24, 2004 9:38 PM
> To: [EMAIL PROTECTED]
> Subject: Question of memory management in Perl
> 
> 
> Hi all,
> I have question with respect to memory utilization using 
> perl. I am reading a huge file close to 786432 lines of hex 
> values & am storing in an array. I do a data reformatting 
> using the data in these array & in the sequence of process 
> generate a number of arrays & eventually write into a file at 
> the end of the subroutine. The problem I get is in the middle 
> of subroutine execution I get "Out of memory" indication & I 
> have used close to 2 Gigs of memory. So inorder to avoid this 
> Out of memory issue what I did was, after I send the array 
> elements to a different array, I initialize the original 
> array with null. For eg: this is what I do with one of the array,
>  
> for ($init_cnt=0;$init_cnt<=$#out_array_bin;$init_cnt++) {
> $out_array_bin[$init_cnt] = "";
> }
>  
> I followd the same approach with other arrays in my subroutine.
> I thought this would solve my Out of memory problem but it did not.
> Can some one tell me what could be an alternative solution 
> for this problem or kindly suggest me if sometning I should 
> need to correct in my existing solution.
>  
> Thanks for the help in advance,
> Hari
>  
>  
> 
> 
>   
> -
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]