how to get source of of web page which is hosted on the server (which I dont have access).

2007-10-29 Thread Siva Prasad
HI Gurus, I am opening a web page using win32::IEAutomation and clicking each link on the page and reading data.(This page has 177 links). The above processes occupy more memory, After some time the page is unable to load and the script gives me READY STATE error. I have used Wait

Re: dereferencing

2007-10-29 Thread Aaron Priven
On Oct 29, 2007, at 5:21 PM, Tom Phoenix wrote: I don't think that what the original poster wants is even possible, but I can't see any reason to need it, either. It's probably not necessary per se, as you can always do anything using reference syntax, but it's awkward and requires lots of e

Re: dereferencing

2007-10-29 Thread Aaron Priven
Playing around with this, indeed, proves it can be done: #!/usr/bin/perl use strict; use warnings; use Data::Alias; my $hashref = { a => 5, b => 8}; alias my %hash = %{$hashref}; print $hash{a} , "\n"; prints 5. (And \%hash == $hashref evaluates true.) I knew that Data::Alias existed -- it's me

Re: Hash Variables

2007-10-29 Thread Kaushal Shriyan
Hi I am referring to perldoc perlintro my %fruit_color = ("apple", "red", "banana", "yellow"); You can use whitespace and the "=>" operator to lay them out more nicely: my %fruit_color = ( apple => "red", banana => "yellow", );

Re: dereferencing

2007-10-29 Thread Jeremy Kister
On 10/29/2007 8:21 PM, Tom Phoenix wrote: my %newhash = %{$hashref}; You have made a copy of the hash. I do not believe that that is what the original poster wished, which I think would be a new hash that the old reference points to. I don't think that what the original poster wants is even pos

Re: dereferencing

2007-10-29 Thread John W . Krahn
On Monday 29 October 2007 15:23, Aaron Priven wrote: > I can do this: > > 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. Correct. You can alias a package variable but not a lexical vari

Re: dereferencing

2007-10-29 Thread Paul Johnson
On Mon, Oct 29, 2007 at 05:21:52PM -0700, Tom Phoenix wrote: > On 10/29/07, Jeremy Kister <[EMAIL PROTECTED]> wrote: > > 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 %ha

Re: dereferencing

2007-10-29 Thread Tom Phoenix
On 10/29/07, Aaron Priven <[EMAIL PROTECTED]> wrote: > I can do this: > > 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. You mean, given a reference to a hash, create a named lexical ha

Re: dereferencing

2007-10-29 Thread Tom Phoenix
On 10/29/07, Jeremy Kister <[EMAIL PROTECTED]> wrote: > 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};

Re: help on ip addr

2007-10-29 Thread Matthew Whipple
lists user wrote: > Hello, > > I want to do the things below: > > a) get all binded IPs on a redhat linux os.there are maybe more than > one IP,like eth0,eth1,eth0:1 etc. > > b) for each IP,I need to know if it's a private network address (like > 192.168.0.1) or a public network address. > > for th

Re: Hash Variables

2007-10-29 Thread Matthew Whipple
sivasakthi wrote: > On Mon, 2007-10-29 at 17:06 +0530, Kaushal Shriyan wrote: > > > >> >> >> #!/usr/bin/perl -w >> >> %states = ( "California","Sacramento", "Wisconsin","Madison", "New York", >> "Albany"); >> >> print "Capital of Californi

Re: dereferencing

2007-10-29 Thread Jeremy Kister
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 unsubscribe, e

dereferencing

2007-10-29 Thread Aaron Priven
I can do this: 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. It's possible with a package variable: #/usr/bin/perl our %hash; my $hashref = { a => 5 , b => 8 }; *hash = $hashref; print

Re: Hash of array

2007-10-29 Thread John W . Krahn
On Monday 29 October 2007 09:15, Kevin Viel wrote: > I have a dataset of values for variables for subjects. Some subject > have multiple records, requiring an average: > > ID Var1 Var2 > 1 1.0 2.0 > 1 2.0 1.5 > > - > 1 1.5 1.75 > > If I collect the variables into an array, I

SoapLite Error

2007-10-29 Thread Mike Blezien
Hello, we're trying to put together a SOAP::Lite application but keep getting this error message: === soaptest.cgi: Element 'XMLRequest' can't be allowed in valid XML message. Died. at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm

Re: array within array

2007-10-29 Thread Ron Bergin
On Oct 29, 6:42 am, [EMAIL PROTECTED] (Mike Tran) wrote: > Hey all, > > I'm new with Perl and need help with this simple script. I'm still > playing around with the script below to get a feel for Perl. My script > below is incomplete and I'm doing an array within an array which is > incorrect. Plea

Re: Hash of array

2007-10-29 Thread Rob Dixon
Kevin Viel wrote: I have a dataset of values for variables for subjects. Some subject have multiple records, requiring an average: ID Var1 Var2 1 1.0 2.0 1 2.0 1.5 - 1 1.5 1.75 If I collect the variables into an array, I can average the contents after I have processed th

Hash of array

2007-10-29 Thread Kevin Viel
I have a dataset of values for variables for subjects. Some subject have multiple records, requiring an average: ID Var1 Var2 1 1.0 2.0 1 2.0 1.5 - 1 1.5 1.75 If I collect the variables into an array, I can average the contents after I have processed the entire file. It w

Re: Quotes and apostrophes assistance

2007-10-29 Thread Dr.Ruud
"Beginner" schreef: > my ($rows) = $dbh->selectrow_array("SELECT foo FROM bar where > path=?",undef,q($name)) or die snip Your q($name) creates the literal string $name. my ($rows) = $dbh->selectrow_array( "SELECT foo FROM bar where path=?", undef, $name

RE: array within array

2007-10-29 Thread Mike Tran
John, That is exactly what I wanted. Thanks for pointing out all those errors for me and your help with the script. Appreciate the prompt respond. Cheers, Mike -Original Message- From: John W.Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, October 29, 2007 1:10 PM To: Perl beginne

Re: array within array

2007-10-29 Thread John W . Krahn
On Monday 29 October 2007 06:42, Mike Tran wrote: > Hey all, Hello, > I'm new with Perl and need help with this simple script. I'm still > playing around with the script below to get a feel for Perl. My > script below is incomplete and I'm doing an array within an array > which is incorrect. Plea

Re: Quotes and apostrophes assistance

2007-10-29 Thread Beginner
On 29 Oct 2007 at 10:55, Paul Lalli wrote: > On Oct 29, 12:31 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > > "Beginner" schreef: > > > > > I am trying to insert a lots file paths into an SQLite table and am > > > having trouble with filenames with apostrophes in. > > > > Use placeholders, > > Good ad

Re: Quotes and apostrophes assistance

2007-10-29 Thread Paul Lalli
On Oct 29, 12:31 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > "Beginner" schreef: > > > I am trying to insert a lots file paths into an SQLite table and am > > having trouble with filenames with apostrophes in. > > Use placeholders, Good advice. > so prepare/execute. irrelevant advice, nothing to do

Re: How to check the file is modified or not?

2007-10-29 Thread Tom Phoenix
On 10/29/07, sivasakthi <[EMAIL PROTECTED]> wrote: > How to check the file is modified or not? If the file exists at all, it's been modified at least once. But you seem to want to know something more. If you want to know whether the file has been modified since a certain time, you probably want

Re: fork

2007-10-29 Thread Tom Phoenix
On 10/29/07, Ryan Dillinger <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perluse warnings;use strict; > > print "PID=$$\n"; > my $child = fork();die "Can't fork: $!" unless defined $child; > if ($child > 0) { # parent process print "Parent process: PID=$$, > child=$child\n";} else { # child process

Re: Quotes and apostrophes assistance

2007-10-29 Thread Dr.Ruud
"Rob Coops" schreef: > See: http://search.cpan.org/~timb/DBI-1.601/DBI.pm#quote for more > information Read http://search.cpan.org/~timb/DBI-1.601/DBI.pm#Placeholders_and_Bind_Values first. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: Quotes and apostrophes assistance

2007-10-29 Thread Dr.Ruud
"Beginner" schreef: > I am trying to insert a lots file paths into an SQLite table and am > having trouble with filenames with apostrophes in. Use placeholders, so prepare/execute. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: array within array

2007-10-29 Thread Dr.Ruud
Andrew Curry schreef: > be very careful with exists, it auto creates the structure > use Data::Dumper; > my %hash; > if (exists $hash{a}{b}) {} > print Dumper(\%hash) > then the next time you use exists it is there. > defined is much safer as it doesnt do this. No, the difference

Re: array within array

2007-10-29 Thread John W . Krahn
On Monday 29 October 2007 07:29, Beginner wrote: > > while () { > chomp; > my @fields = split(/|/,$_); ^^^ > $exclude_bases{$F[0]} = 0; # $f[0] contains base_no > } > close(EXCLUDE); > > open(BASE,"base.txt")|| die("Could not open file!"); > while () {

Re: Quotes and apostrophes assistance

2007-10-29 Thread Rob Coops
Since I never worked with an SQLite DB I am not sure how well this will work but you might want to have a look at the following command in the DBI: $dbh->quote($value); This should make the whole thing SQL approved with escaped special characters and everything... Now as I said I have no idea how

Re: Quotes and apostrophes assistance

2007-10-29 Thread anders
On 29 Okt, 16:14, [EMAIL PROTECTED] (Beginner) wrote: > Hi, > > I am trying to insert a lots file paths into an SQLite table and am > having trouble with filenames with apostrophes in. > > Below is the snippet I have been using. I have experimented with > sprintf, qq and a combination of both but

RE: array within array

2007-10-29 Thread Andrew Curry
be very careful with exists, it auto creates the structure i.e. use Data::Dumper; my %hash; if (exists $hash{a}{b}) { } print Dumper(\%hash) then the next time you use exists it is there. defined is much safer as it doesnt do this. -Original Message- From: Beginner [mailto:[EMAIL PR

Re: array within array

2007-10-29 Thread Beginner
On 29 Oct 2007 at 8:42, Mike Tran wrote: > Hey all, > > > > I'm new with Perl and need help with this simple script. I'm still > playing around with the script below to get a feel for Perl. My script > below is incomplete and I'm doing an array within an array which is > incorrect. Please help

Quotes and apostrophes assistance

2007-10-29 Thread Beginner
Hi, I am trying to insert a lots file paths into an SQLite table and am having trouble with filenames with apostrophes in. Below is the snippet I have been using. I have experimented with sprintf, qq and a combination of both but can't get a quoting system that will get DBI to accept paths li

array within array

2007-10-29 Thread Mike Tran
Hey all, I'm new with Perl and need help with this simple script. I'm still playing around with the script below to get a feel for Perl. My script below is incomplete and I'm doing an array within an array which is incorrect. Please help. Here's what I want to do; I have to flat files (pi

Re: Array Manipulation newbie

2007-10-29 Thread Greg
Thank you, Tom, that is exactly what I was looking for!! Thanks again! -Greg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: fork

2007-10-29 Thread Jeff Pang
On 10/29/07, Ryan Dillinger <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/perluse warnings;use strict; > > print "PID=$$\n"; > my $child = fork();die "Can't fork: $!" unless defined $child; > if ($child > 0) { # parent process print "Parent process: PID=$$, > child=$child\n";} else { # child proces

fork

2007-10-29 Thread Ryan Dillinger
Hello, I have this script here: #!/usr/bin/perluse warnings;use strict; print "PID=$$\n"; my $child = fork();die "Can't fork: $!" unless defined $child; if ($child > 0) { # parent process print "Parent process: PID=$$, child=$child\n";} else { # child process my $ppid = getppid(); print

Re: Hash Variables

2007-10-29 Thread sivasakthi
On Mon, 2007-10-29 at 17:06 +0530, Kaushal Shriyan wrote: > > > #!/usr/bin/perl -w > > %states = ( "California","Sacramento", "Wisconsin","Madison", "New York", > "Albany"); > > print "Capital of California is " . $states{"California"} .

Re: How to check the file is modified or not?

2007-10-29 Thread Yogesh Sawant
On Oct 29, 4:09 pm, [EMAIL PROTECTED] (Sivasakthi) wrote: > Hi All, > > How to check the file is modified or not? > > Thanks, > Siva 1. get the file's modify time using stat function 2. then compare that time with whatever time-date you have lookout stat in `perldoc perlfunc` or here's the link:

Re: Parsing Bounced Emails

2007-10-29 Thread Nigel Peck
Dr.Ruud wrote: Consider MailTools: http://search.cpan.org/~markov/MailTools/ Thanks Dr.Rudd, looks useful to me. Cheers, Nigel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Hash Variables

2007-10-29 Thread Kaushal Shriyan
Hi, I have a sample code #!/usr/bin/perl -w %states = ( "California","Sacramento", "Wisconsin","Madison", "New York", "Albany"); print "Capital of California is " . $states{"California"} . "\n\n"; ###

How to check the file is modified or not?

2007-10-29 Thread sivasakthi
Hi All, How to check the file is modified or not? Thanks, Siva

Re: Modifing Text Files

2007-10-29 Thread Chas. Owens
On 10/28/07, Telemachus Odysseos <[EMAIL PROTECTED]> wrote: > On 10/25/07, Chas. Owens <[EMAIL PROTECTED]> wrote: > > From the sound of it what you want is in-place-editing: > > > > #!/usr/bin/perl -i > > > > use strict; > > use warnings; > > > > while (<>) { > > s/this/that/ > > } > > > > The