RE: need to parse and verify certain content..

2006-10-11 Thread Charles K. Clarkson
Vishwanath Chitnis wrote: : is there any other way other than above mentioned to do this? How can we possibly tell with only those lines? Show more code. Something we can run that will illustrate your problem. HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate W

RE: getting the File size of image URL

2006-10-11 Thread Thomas Bätzler
Anish Kumar K. <[EMAIL PROTECTED]> asked: > Is it possible to calculate the File SIZE which is from HTTP. > i.e if I wanted to know > > file size of http://www.yahoo.com/images/a.gif from PERL.. Send a HEAD request for the URI and look at the Content-Length header of the response object: #!/usr

Re: getting the File size of image URL

2006-10-11 Thread Jeff Pang
>From the $ENV{CONTENT_LENGTH} -Original Message- >From: "Anish Kumar K." <[EMAIL PROTECTED]> >Sent: Oct 11, 2006 2:17 AM >To: beginners@perl.org >Subject: getting the File size of image URL > >Is it possible to calculate the File SIZE which is from HTTP. i.e if I >wanted to know > >file

Re: Need your help to achieve this?

2006-10-11 Thread Dr.Ruud
Rob Dixon schreef: > open my $fh, $file or die "open '$file': $!"; OP had open my $fh, '<', $file or die "open '$file': $!" which I consider as better. >@data[0..6] = split /,/; Nice idiom. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: saving surrounding text in substitution

2006-10-11 Thread Dr.Ruud
Kathryn Bushley schreef: > #!/usr/bin/perl -w > use warnings; Make that: #!/usr/bin/perl use warnings ; use strict ; See `perldoc perllexwarn`. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
Dear All, My Code is to ping a range of IP reading from a text file and if they are not reachable then just write the IP's to a file. Regarding permissions i am running the same script using root previliges and i am able to run the script maually but it is failing if i write the script in cron l

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
The Answers are 1. Is /scripts/.pl the full path name? Yes the above is the correct path of the script : when i run perl /scripts/xxx.pl it runs fine 2. Does your script have execute permissions Yes it has execute permissions (i changed it chmod +x for the code file) 3. Does the shebang line

Re: Perl Script as a Cron Job

2006-10-11 Thread Owen Cook
On Wed, Oct 11, 2006 at 03:03:12PM +0400, Mazhar wrote: > Dear All, > > My Code is to ping a range of IP reading from a text file and if they are > not reachable then just write the IP's to a file. Regarding permissions i > am running the same script using root previliges and i am able to run the

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
I have set the Shebang in my code to the below #!/usr/bin/perl and below is top of my code below, --- #!/usr/bin/perl use strict; use warnings; use Net::Ping; my $file_name='hostnames.txt'; my $line; my @host_arra

Re: Perl Script as a Cron Job

2006-10-11 Thread Bjørge Solli
This is the last top-posted email from you that I will answer.. Please learn how to quote properly! On Wednesday 11 October 2006 13:14, Mazhar wrote: > 1. Is /scripts/.pl the full path name? > Yes the above is the correct path of the script : when i run perl > /scripts/xxx.pl it runs fine So

RE: Perl Script as a Cron Job

2006-10-11 Thread Thomas Bätzler
Mazhar <[EMAIL PROTECTED]> wrote: > My Code is to ping a range of IP reading from a text file and > if they are not reachable then just write the IP's to a > file. Regarding permissions i am running the same script > using root previliges and i am able to run the script maually > but it is fai

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
Sorry Solli, Below is the output what u asked for, 1. If i run the code /scripts/xxx.pl i get the below error... interpreter "/usr/bin/perl" not found sh: /scripts/xxx.pl: not found. 2. The first line in the code is below (i have added the Shepang Value) #!/usr/bin/perl I did not get

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
Dear Thomas, I am running PING from the package Net, can u tell me where can i find the logs of cron jobs as because with that i will be able to check the possibility of not running the script, please Regards Mazhar On 10/11/06, Thomas Bätzler <[EMAIL PROTECTED]> wrote: Mazhar <[EMAIL PROTEC

Re: need to parse and verify certain content..

2006-10-11 Thread Vishwanath Chitnis
ok, here is the code: $webserver=apache1; $platform=solaris; $uname=abc123; $password=abc123; my $ie = Win32::IEAutomation->new(visible=>1,maximized=>1); if ($webserver == apache1 && $platform == solaris){ $ie->gotoURL('http://xyz.test.com:8900/_cqr/test.cgi'); } $ie->getTextBox("name:", "lo

Re: Perl Script as a Cron Job

2006-10-11 Thread Bjørge Solli
On Wednesday 11 October 2006 13:35, Mazhar wrote: > I did not get the meaning of (Quote properly) http://www.xs4all.nl/~hanb/documents/quotingguide.html When it ways usenet, think email-lists too. -- Bjørge Solli - Office:+47 55205847 Mohn-Sverdrupsenteret, Nansensenteret, Høyteknologisente

Re: Perl Script as a Cron Job

2006-10-11 Thread Paul Johnson
On Wed, Oct 11, 2006 at 03:35:03PM +0400, Mazhar wrote: > 1. If i run the code /scripts/xxx.pl i get the below error... > > >>>interpreter "/usr/bin/perl" not found > sh: /scripts/xxx.pl: not found. So it would appear that this is not where perl is found on your system. You need to put th

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
On 10/11/06, Paul Johnson <[EMAIL PROTECTED]> wrote: On Wed, Oct 11, 2006 at 03:35:03PM +0400, Mazhar wrote: > 1. If i run the code /scripts/xxx.pl i get the below error... > > >>>interpreter "/usr/bin/perl" not found > sh: /scripts/xxx.pl: not found. So it would appear that this is not

Re: Perl Script as a Cron Job

2006-10-11 Thread Paul Johnson
On Wed, Oct 11, 2006 at 04:18:04PM +0400, Mazhar wrote: > >On Wed, Oct 11, 2006 at 03:35:03PM +0400, Mazhar wrote: > > > >> 1. If i run the code /scripts/xxx.pl i get the below error... > >> > >> >>>interpreter "/usr/bin/perl" not found > >> sh: /scripts/xxx.pl: not found. > i have added /

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
On 10/11/06, Paul Johnson <[EMAIL PROTECTED]> wrote: On Wed, Oct 11, 2006 at 04:18:04PM +0400, Mazhar wrote: > >On Wed, Oct 11, 2006 at 03:35:03PM +0400, Mazhar wrote: > > > >> 1. If i run the code /scripts/xxx.pl i get the below error... > >> > >> >>>interpreter "/usr/bin/perl" not found > >>

Re: Perl Script as a Cron Job

2006-10-11 Thread Ken Foskey
On Wed, 2006-10-11 at 16:45 +0400, Mazhar wrote: > I have created the file in Windows and have pasted the entries in HP-UNIX (i > mean copied). I cannot find the command dos2unix in HP UX. > easy check, change command line to this: #!/usr/bin/perl -w to strip the carriage returns try something

modules not found

2006-10-11 Thread Dennis Heuer
Am not shure if this is the right list. I installed perl into an unusual directory but new modules, like XML-Parser, weren't able to find installed modules, like ExtUtils. Though the @INC output in the error message was fully correct. I installed perl into /usr and it just worked for so. Can some

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
On 10/11/06, Ken Foskey <[EMAIL PROTECTED]> wrote: On Wed, 2006-10-11 at 16:45 +0400, Mazhar wrote: > I have created the file in Windows and have pasted the entries in HP-UNIX (i > mean copied). I cannot find the command dos2unix in HP UX. > easy check, change command line to this: #!/usr/bin

Re: need to parse and verify certain content..

2006-10-11 Thread Mug
Vishwanath Chitnis wrote: > ok, here is the code: > > $webserver=apache1; > $platform=solaris; > $uname=abc123; > $password=abc123; Missed the quotes ?? $webserver = "apache1" ; > > my $ie = Win32::IEAutomation->new(visible=>1,maximized=>1); > > if ($webserver == apache1 && $platform == solaris)

Re: Perl Script as a Cron Job

2006-10-11 Thread Beginner
On 11 Oct 2006 at 17:14, Mazhar wrote: > From the help above i created a new perl code and i was successfull in > running the code by typing the command /scripts/newxxx.pl but the same is > not executed by cron i have the cron entry as below > > 10 * * * * /scripts/newxxx.pl This as to be the

Re: modules not found

2006-10-11 Thread Jeff Pang
>Can somebody give me a hint if there's some general problem with perl >when not resided in /usr > Hello, Do you know where your modules are installed?Given the path for installed modules is "/your/path",you can add the path to Perl's @INC by putthing this statement at the begin of your script

Re: modules not found

2006-10-11 Thread Dennis Heuer
On Wed, 11 Oct 2006 21:39:22 +0800 (GMT+08:00) Jeff Pang <[EMAIL PROTECTED]> wrote: > > >Can somebody give me a hint if there's some general problem with perl > >when not resided in /usr > > > > Hello, > > Do you know where your modules are installed?Given the path for installed > modules is "

Creating RSS feeds with Perl?

2006-10-11 Thread Karjala
How do you create your websites' RSS feeds? I run a script called createrss.pl as a cron job every hour which checks if there are any new stories and if so creates a new feed.rss file I think this method takes up a lot of RAM and CPU power since it launches Perl every hour, but I can't think

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
On 10/11/06, Beginner <[EMAIL PROTECTED]> wrote: On 11 Oct 2006 at 17:14, Mazhar wrote:> From the help above i created a new perl code and i was successfull in > running the code by typing the command /scripts/newxxx.pl but the same is> not executed by cron i have the cron entry as below>>  10 * *

Modules for printing the content of an array

2006-10-11 Thread Sami FANTAR
Hello everybody I would like to know if there is any module which can display in a enjoyable way the content of an array with about 200 values. Could Data::Dumper be a solution for my problem? Any help or example will be very appreciated. Thanks in advance. -- To unsubscribe, e-mail: [EMAIL

Re: Modules for printing the content of an array

2006-10-11 Thread Rob Coops
Hi Sami, Yes Data::Dumper is your friend when it comes to dumping data (how strange is that :-) Simply do this in your perl script: *use Data::Dumper;* *print Dumper @huge_array;* And be amazed ;-) On 10/11/06, Sami FANTAR <[EMAIL PROTECTED]> wrote: Hello everybody I would like to know

Re: Modules for printing the content of an array

2006-10-11 Thread Sami FANTAR
Rob Coops a écrit : Hi Sami, Yes Data::Dumper is your friend when it comes to dumping data (how strange is that :-) Simply do this in your perl script: *use Data::Dumper;* *print Dumper @huge_array;* And be amazed ;-) On 10/11/06, Sami FANTAR <[EMAIL PROTECTED]> wrote: Hello everybody

RE: Perl Script as a Cron Job

2006-10-11 Thread Jason Wozniak
Here is what I use for a perl script I use to restart the oracle listener if it goes down, to set the oracle environment. 00,10,20,30,40,50 * * * * (. $HOME/.bash_profile; $HOME/hdpjfw_scripts/dbping.pl) >$HOME/spool/db_ping.out 2>&1 From: Mazhar [mailto:[E

RE: Modules for printing the content of an array

2006-10-11 Thread Charles K. Clarkson
Rob Coops wrote: : Simply do this in your perl script: : *use Data::Dumper;* : *print Dumper @huge_array;* For the archives: Those asterisks (*) are for emphasis. They are not actually in the code. Arrays and hashes can also be dumped using a reference. I find a reference more aesthetica

Re: Perl Script as a Cron Job

2006-10-11 Thread Mazhar
On 10/11/06, Jason Wozniak <[EMAIL PROTECTED]> wrote: Here is what I use for a perl script I use to restart the oracle listener if it goes down, to set the oracle environment. 00,10,20,30,40,50 * * * * (. $HOME/.bash_profile; $HOME/hdpjfw_scripts/dbping.pl) >$HOME/spool/db_ping.out 2>&1 -

Re: Perl Script as a Cron Job

2006-10-11 Thread Stuart Adams
Mazhar, The cron log is most likely written to /var/log/cron -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Creating RSS feeds with Perl?

2006-10-11 Thread Tom Phoenix
On 10/11/06, Karjala <[EMAIL PROTECTED]> wrote: I run a script called createrss.pl as a cron job every hour which checks if there are any new stories and if so creates a new feed.rss file I think this method takes up a lot of RAM and CPU power since it launches Perl every hour, but I can't thin

Help w/map function

2006-10-11 Thread Moon, John
perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(&subt($_), @a)), "\n"; sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print "a=$a\n"; return $a;}' perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(s/^(.*)\..*/$1/, @a)), "\n"; ' perl -e '@a=("frc.apmt","frc_ff.apmt");prin

Re: Help w/map function

2006-10-11 Thread Jay Savage
On 10/11/06, Moon, John <[EMAIL PROTECTED]> wrote: perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(&subt($_), @a)), "\n"; sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print "a=$a\n"; return $a;}' perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(s/^(.*)\..*/$1/, @a))

Re: Modules for printing the content of an array

2006-10-11 Thread Mumia W.
On 10/11/2006 10:42 AM, Sami FANTAR wrote: [...] I have read the Data::Dumper related doc. Including the part where it tells you how to substitute the correct variable names for $VAR1,$VAR2,... ? But, after having written your example, the output seems quite weird. I got $VAR1,$VAR2, and so

RE: Help w/map function

2006-10-11 Thread Moon, John
On 10/11/06, Moon, John <[EMAIL PROTECTED]> wrote: > perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(&subt($_), > @a)), "\n"; > sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print "a=$a\n"; > return $a;}' > perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, > map(s/^(.*)\..*

modules breaking?

2006-10-11 Thread Jesse Engel
i'm getting an error in an installed module, not in my script. invalid top directory at /System/Library/Perl/5.8.1/File/Find.pm line 568. script is as follows: use File::Find; use Net::FTP; my $server = "blah"; my $login = "[EMAIL PROTECTED]"; my $pass = "blahblah"; my $ftp = Net::FTP->new($se

Re: Help w/map function

2006-10-11 Thread Paul Johnson
On Wed, Oct 11, 2006 at 07:37:36PM -0400, Moon, John wrote: > On 10/11/06, Moon, John <[EMAIL PROTECTED]> wrote: > > perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(&subt($_), > > @a)), "\n"; > > sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print "a=$a\n"; > > return $a;}' > > p

Re: modules breaking?

2006-10-11 Thread Tom Phoenix
On 10/11/06, Jesse Engel <[EMAIL PROTECTED]> wrote: i'm getting an error in an installed module, not in my script. invalid top directory at /System/Library/Perl/5.8.1/File/Find.pm line 568. Yes; but do you see what it's trying to tell you? Some top directory that you're passing to find() isn'

Re: Help w/map function

2006-10-11 Thread Rob Dixon
Moon, John wrote: > > perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, map(&subt($_), > @a)), "\n"; > sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print "a=$a\n"; > return $a;}' > perl -e '@a=("frc.apmt","frc_ff.apmt");print join(q{,}, > map(s/^(.*)\..*/$1/, @a)), "\n"; ' > perl -e '@a=("

Re: Perl Script as a Cron Job

2006-10-11 Thread Paul
On Wed, October 11, 2006 7:03 am, Mazhar wrote: > Dear All, > > My Code is to ping a range of IP reading from a text file and if they are > not reachable then just write the IP's to a file. Regarding permissions i > am running the same script using root previliges and i am able to run the > scrip