Re: Problem reading data from an HTML file

2005-09-14 Thread Suvajit Sengupta
Nath, Alok (STSD) wrote: Can anyone point out why it is not outputting anything ? It is suppose to read an HTML file and display the table contents. One thing I observed is - It is not entering the for loop and I s not printing anything ( in print "Table found at ", join(',', $ts->coords),

Re: Comparing file contents (code included)

2005-09-14 Thread Jenny Chen
Please unsubscrib me from the list. Thanks. Jenny Chen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Problem reading data from an HTML file

2005-09-14 Thread Nath, Alok (STSD)
Can anyone point out why it is not outputting anything ? It is suppose to read an HTML file and display the table contents. One thing I observed is - It is not entering the for loop and I s not printing anything ( in print "Table found at ", join(',', $ts->coords), ":\n";) #!/usr/bin/perl u

Re: extract web pages from a web site

2005-09-14 Thread Scott R. Godin
José Pedro Silva Pinto wrote: Hi there, I am doing a program in perl to extract some web pages (And copy it to a local file), from a given web address. Which perl module can I use to help me to do this task It depends on what you're looking to do... LWP::Simple to grab stuff with, WWW::Mech

Re: strange result with reg exp

2005-09-14 Thread Jeff 'japhy' Pinyan
On Sep 14, Christopher Spears said: In the script I am writing, I use the following regular expression: $pass =~ tr/a-z/A-Z/s; If I give the expression a string like "Occ", then the expression will convert it to "OC" instead of "OCC"! What is going on? It sounds like you're using an operator

Re: Why wont this work? Package require question

2005-09-14 Thread Jeff 'japhy' Pinyan
On Sep 14, Luinrandir said: but what if I want to pass a var? then $glob->($foo,$bar); ? But I still have no clue as to why this works... esp. $glob->(); just looked in my book.. am I dereferencing a reference? Basically, yes. $glob ends up being a glob, a reference to everything with

Re: about utf8

2005-09-14 Thread Jay Savage
On 9/14/05, Jeff Pan <[EMAIL PROTECTED]> wrote: > HI, > > I want to translate some utf8 characters to appropriate characters.I use > utf8 module,but it seems to work uncorrectly. > > This is the code: > > > use utf8; > #if (utf

RE: Can I alter the system wide @INC array?

2005-09-14 Thread Chris Devers
On Wed, 14 Sep 2005, Siegfried Heintze wrote: > Anyone got any ideas? Reconsider your choice of database software? :-) You're accurately describing what would happen if you tried to stuff more than 255 characters into a VARCHAR field in most databases. If you need more space than that, most

Re: @ARGV

2005-09-14 Thread John W. Krahn
Christopher Spears wrote: >>From what I understand, @ARGV contains invocation > arguments. Then how come I cannot access the first > element with $ARGV[0]? You can't? > What would be the proper way > to do this? $ perl -le'print $ARGV[0]' one two three four one John -- use Perl; program fu

RE: @ARGV

2005-09-14 Thread Bob Showalter
Christopher Spears wrote: > From what I understand, @ARGV contains invocation > arguments. Then how come I cannot access the first > element with $ARGV[0]? What would be the proper way > to do this? Well, you can access the first element as $ARGV[0], so something else is going on. Show us your c

@ARGV

2005-09-14 Thread Christopher Spears
>From what I understand, @ARGV contains invocation arguments. Then how come I cannot access the first element with $ARGV[0]? What would be the proper way to do this? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: strange result with reg exp

2005-09-14 Thread John W. Krahn
Christopher Spears wrote: > In the script I am writing, I use the following > regular expression: > > $pass =~ tr/a-z/A-Z/s; > > If I give the expression a string like "Occ", then the > expression will convert it to "OC" instead of "OCC"! > What is going on? tr/// does NOT use regular expressio

RE: strange result with reg exp

2005-09-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Christopher Spears wrote: > In the script I am writing, I use the following > regular expression: > > $pass =~ tr/a-z/A-Z/s; > > If I give the expression a string like "Occ", then the > expression will convert it to "OC" instead of "OCC"! > What is going on? the /s says to squash ( Progr

How to store more than 255 characters in a single field in MSAccess

2005-09-14 Thread Siegfried Heintze
Sorry, that last message was sent out with the wrong subject! I'm using the perl DBI to populate a MSAccess database. I've spent all morning discovering that I cannot store a URL longer than 255 characters. I'm using the bind_param function and I get an error when it is longer. I've tried changi

RE: Can I alter the system wide @INC array?

2005-09-14 Thread Siegfried Heintze
I'm using the perl DBI to populate a MSAccess database. I've spent all morning discovering that I cannot store a URL longer than 255 characters. I'm using the bind_param function and I get an error when it is longer. I've tried changing it (the field type) to type memo, hyperlink and text. None of

strange result with reg exp

2005-09-14 Thread Christopher Spears
In the script I am writing, I use the following regular expression: $pass =~ tr/a-z/A-Z/s; If I give the expression a string like "Occ", then the expression will convert it to "OC" instead of "OCC"! What is going on? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Distance learning

2005-09-14 Thread Chris Devers
On Wed, 14 Sep 2005, Brent Clark wrote: > But I would like to have some type of accreditation to put on my CV. We don't tend to do Perl accreditation in the USA, either. There may be companies that offer such scraps of paper, but none that are taken seriously. If you want something tangible f

Re: Objects in an object?

2005-09-14 Thread Chris
On Wednesday 14 September 2005 04:25 am, Thomas Bätzler wrote: > Chris <[EMAIL PROTECTED]> asked: > > I'm not exactly sure what its called but for example, when > > using mod_perl, I see the following: > > > > $r->prev->uri > > > > How do you create something like this? > > $r is an object of some

RE: Why wont this work? Package require question

2005-09-14 Thread Bob Showalter
Jeff 'japhy' Pinyan wrote: > Now you want to call the Inn::HTML() function, right? You can't > easily do it if strict is turned on. Here's one way, though: > >my $glob = $main::{$Player{Location} . "::"}{HTML}; >$glob->(); Or just turn off strict for a sec: { no strict 'refs'; &{"$P

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
> but what if I want to pass a var? then > $glob->($foo,$bar); > ? Yes sir.. we have a winner But I still have no clue as to why this works... esp. $glob->(); just looked in my book.. am I dereferencing a reference? but hey! thanks anyway! Lou $Player{Location}="Inn"; $Player{Actio

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
I also got this to work: $Player{Location}="Inn"; $Player{Action}="Sell"; require "$Player{Location}.pl"; # this code calls on the package # my $glob = $main::{$Player{Location} . "::"}{$Player{Action}}; # $glob->(); #

RE: chdir

2005-09-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Christopher Spears wrote: > So what should I do? > > -Chris What are you trying to do? I fyou are trying to setup an enironment, but don't want to remain within perl, then need some type of shell script. If you stay and work within Perl, then you are located where you want to be. Wags

chdir

2005-09-14 Thread Christopher Spears
So what should I do? -Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
> > Now you want to call the Inn::HTML() function, right? You can't easily do > > it if strict is turned on. Here's one way, though: > > > >my $glob = $main::{$Player{Location} . "::"}{HTML}; > >$glob->(); Ok.. that works.. why? what is ->() -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
> Now you want to call the Inn::HTML() function, right? You can't easily do > it if strict is turned on. Here's one way, though: > >my $glob = $main::{$Player{Location} . "::"}{HTML}; >$glob->(); ah yes.. must bottom post ok in the first line you set the var $glob to equal the packa

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
OK I got this to work require "$Player{Location}.pl"; but not "$Player{Location}"::HTML(); #error or "$Player{Location}::HTML()"; # ignored completely! or '$Player{Location}::HTML()';# ignored completely! or '$Player{Location}'::HTML(); #error or $Player{Location}::HTML(); #error now what? hey.. a

Re: chdir

2005-09-14 Thread John W. Krahn
Christopher Spears wrote: > Here is a snippet of code I am working on: > > while (1) { >print "cd $path: Y or N?\n"; >chomp($answer = ); > >if ($answer =~ /^[nN]$/) { > print "Enter a path: "; > my $path = ; > chomp($path); > chdir $path or die "Can't cd to

chdir

2005-09-14 Thread Christopher Spears
Here is a snippet of code I am working on: while (1) { print "cd $path: Y or N?\n"; chomp($answer = ); if ($answer =~ /^[nN]$/) { print "Enter a path: "; my $path = ; chomp($path); chdir $path or die "Can't cd to $path"; last; }elsif ($answer =~ /^[yY]

Re: Why wont this work? Package require question

2005-09-14 Thread Wiggins d'Anconia
No need to top post, please don't. Luinrandir wrote: > Ok.. and i'm actually going to top post for this... > > when done is should read > $Player{Location}="Inn"; > > require '$Player{Location}.pl'; > whixh is the same as > require 'Inn.pl'; > Same problems exist. Single quotes do NOT interpo

Re: Problem with uninitialized char.

2005-09-14 Thread John W. Krahn
Condor wrote: > Hello, Hello, > i have problem with uninitialised char and i don't know how to resolve a > problem. > I will paste part of code: > #!/usr/bin/perl > > use strict; > use warnings; > use diagnostics; > > my $temp_buf = 0; > my @buffer = (); > my $all = 255; > my $cardid = "AS12F00

Re: Why wont this work? Package require question

2005-09-14 Thread Jeff 'japhy' Pinyan
On Sep 14, Luinrandir said: $Player{Location}="Inn" require '$Player{Location}.pl'; #no error here, I think. '$Player{Location}'::HTML(); #error occurs here The single quotes are wrong. $Player{Location} = "Inn"; require "$Player{Location}.pl"; # loading, for example, Inn.pl Now you wan

Re: Why wont this work? Package require question

2005-09-14 Thread Luinrandir
Ok.. and i'm actually going to top post for this... when done is should read $Player{Location}="Inn"; require '$Player{Location}.pl'; whixh is the same as require 'Inn.pl'; and then '$Player{Location}'::HTML(); which is the same as Inn::HTML(); Do i have the vars correct so that if I want to

Re: Why wont this work? Package require question

2005-09-14 Thread Wiggins d'Anconia
Luinrandir wrote: > $Player{Location}="Inn" You are missing a semi-colon, and there is no reason to use double quotes above. > require '$Player{Location}.pl'; #no error here, I think. Single quotes don't interpolate. > '$Player{Location}'::HTML(); #error occurs here > > I'd hate to have to mak

Why wont this work? Package require question

2005-09-14 Thread Luinrandir
$Player{Location}="Inn" require '$Player{Location}.pl'; #no error here, I think. '$Player{Location}'::HTML(); #error occurs here I'd hate to have to make a big if then else just to do this... Thanks Luinrandir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Problem with uninitialized char.

2005-09-14 Thread Condor
Hello, i have problem with uninitialised char and i don't know how to resolve a problem. I will paste part of code: #!/usr/bin/perl use strict; use warnings; use diagnostics; my $temp_buf = 0; my @buffer = (); my $all = 255; my $cardid = "AS12F002312"; for (my $i = 1; $i < 60001; $i++) {

Distance learning

2005-09-14 Thread Brent Clark
Hi Here in South Africa we seem to be in short supply of institutes that cater for distance perl learning. Would anyone on this list know of any institutes. I know I can just pick up a book and learn perl (Pretty much done that). But I would like to have some type of accreditation to put on m

RE: Objects in an object?

2005-09-14 Thread Thomas Bätzler
Chris <[EMAIL PROTECTED]> asked: > I'm not exactly sure what its called but for example, when > using mod_perl, I see the following: > > $r->prev->uri > > How do you create something like this? $r is an object of some class. prev is a method of that class. It returns an object on which the metho

Re: Objects in an object?

2005-09-14 Thread Xavier Noria
On Sep 14, 2005, at 9:24, Chris wrote: Greetings, I'm not exactly sure what its called but for example, when using mod_perl, I see the following: $r->prev->uri my $c = $r->connection; etc.. How do you create something like this? Easy, for instance you create an attribute "prev": $

about utf8

2005-09-14 Thread Jeff Pan
HI, I want to translate some utf8 characters to appropriate characters.I use utf8 module,but it seems to work uncorrectly. This is the code: use utf8; #if (utf8::valid($subject)) if (Encode::is_utf8($subject)) {

Objects in an object?

2005-09-14 Thread Chris
Greetings, I'm not exactly sure what its called but for example, when using mod_perl, I see the following: $r->prev->uri my $c = $r->connection; etc.. How do you create something like this? I was searching for a way to do the following psuedo code: my $fruits = new Fruit; $fruits->apples =