Assigning a variable to hash keys and values

2004-06-29 Thread Daniel Falkenberg
Hello All, I currently have a hash of a hash... > %HoH = ( > Key1=> { > Apple => "Green", > Banna => "Yellow", > }, > Key2=> { > Carrot=> "Orange", > Tomoatoe => "Red", > }

Printing hash outside of foreach loop

2004-06-25 Thread Daniel Falkenberg
Hi Wiggins, Thank you for your reply. I will go and use the Finance::Quote::ASX module. For now though this problem is really bugging me and for my own sake I would like to get it to work. I have declared all my variables and am using warnings and strict. Unfortunarly I am still only able to print

Printing outside of foreach...

2004-06-25 Thread Daniel Falkenberg
Hello again, The folling code takes some data from the Australian Stock Exchage website. The problem I am having is that I need to be able to access the hash of the hash outside of the foreach statement. So in other words I would like to be able to access areas within the hash %stock_hash any wh

Printing hash of hashes

2004-06-24 Thread Daniel Falkenberg
Hello All, I need to print my hash of hashes. For example... %HoH = ( flintstones => { lead => "fred", pal => "barney", }, jetsons => { lead => "george", wife => "jane",

f

2002-12-03 Thread Daniel Falkenberg

Perl simple array

2002-04-17 Thread Daniel Falkenberg
Hey All, Just wondering why the following code won't print anything at all. @data = "test1,test2,test3,test4"; @data = split(/,/); print $data[1]; Will not print anything... Any ideas? Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Parsing variables and HTML

2002-04-16 Thread Daniel Falkenberg
Hello All, I am having a little bit of trouble with HTML and perl. I want to be able to parse variable from some HTML code where a user hits a submit button and the data they entered from that from should be parsed to the next sub. At the moment I am using the following code... $action = param(

Checking and email address

2002-04-15 Thread Daniel Falkenberg
Hello All, How would I go about checking to see if a variable contains an @ symbol? $email = "[EMAIL PROTECTED]"; if ($email ne "@" || $email eq "") { print "Please make sure your type your email address in correctly"; } else { print "All is OK"; } Thx, Dan -- To unsubscribe, e-mail: [E

Validating form data

2002-04-15 Thread Daniel Falkenberg
Hey All, I am just about to go ahead and start validating form data. I was thinking about tackling it in the following way... $data1 = param("data1"); $data2 = param("data2"); $data3 = param("data3"); $data4 = param("data4"); if ($data1 ne "Whatever") { print "Not equal"; elsif ($data2 ne "T

Strip $ from variable

2002-04-15 Thread Daniel Falkenberg
Hello All, I was just wondering how I would go about stripping the $ sign from the following string? $string = "$20.90"; $string =~ s/$//; <-- I figured this would work fine? Any ideas? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
lse said, just use > $hash{$_} eq "" > > Also, if you name your iterator $hash_key, then don't use $_, use > $hash_key...so the final code would be > > foreach my $hash_key (keys %hash) { > if( $hash{$hash_key} eq "" ) { > print "\

Re: Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
} eq "" and die "Empty hash!" foreach( keys %hash ); > - Original Message ----- > From: "Eric Beaudoin" <[EMAIL PROTECTED]> > To: "Daniel Falkenberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, April 10, 2002 2:22 AM > S

Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
Hey all, I have created a hash that looks similar to the following... %hash ( 'test1' => $test1, 'test2' => $test2, 'test3' => $test3, ); Now is it possible to have a little piece of code check the values of that hash and see if their are any blank fields? Something

Splitting number into an array

2002-04-09 Thread Daniel Falkenberg
Hey all, $card_no = "1234567901234567" # 16 digit number How would I go about splitting that number into an array? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Validating form date

2002-04-09 Thread Daniel Falkenberg
Hello all, I am just playing around with forms at the moment. What I want to do is have user enter data into form fiels then I want to validate that entered date. So far I can do things as basic as validating if fields contain characters and so forth. But what I want to do is something like th

RE: Regex!

2002-04-09 Thread Daniel Falkenberg
e you did in the > assignment. > > $money = s/\$//; > > -Original Message- > From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 5:10 PM > To: [EMAIL PROTECTED] > Subject: Regex! > > > Hello All, > > Just wondering how

Regex!

2002-04-09 Thread Daniel Falkenberg
Hello All, Just wondering how I can remove unwanted characters from a simple variable. $money = "\$21.85"; Now I simply want to strip the $ sign from that variable. Easy? Well I thought it would be :) $money = s/$//; # Well thats what I thought! Regards, Dan -- To unsubscribe, e-mail:

Answer to my own question --> Re: Parsing formdata from one CGIscript to the next.

2002-04-08 Thread Daniel Falkenberg
Hey all, For any one that cares... :) I simply told the hyperlink/submit button to point to the new CGI script and parse on the data I wanted it to like so... /cgi-bin/newcgi.cgi?data=$data Very very easy! Cheers, Dan On Tue, 2002-04-09 at 10:52, Daniel Falkenberg wrote: > Hello

Parsing formdata from one CGI script to the next.

2002-04-08 Thread Daniel Falkenberg
Hello All, Is it possible to parse form data from one CGI script to another one. What I want to do is have a user login to a page. From their I the user to select on a link then that link will take them to another CGI script. In this new CGI script I need that to contain some information of th

Accessing an Access database from a Unix box

2002-04-07 Thread Daniel Falkenberg
--- Begin Message --- --- Begin Message --- Hello All, I am currently NOW trying to access an Access database filename.mdb from a shared drive on my Unix box. Now all I want to do is extract data from an SQL query from this database? Can this be done? I don't think I will need to use Wi

Accessing an Access database from a Unix box

2002-04-07 Thread Daniel Falkenberg
--- Begin Message --- Hello All, I am currently NOW trying to access an Access database filename.mdb from a shared drive on my Unix box. Now all I want to do is extract data from an SQL query from this database? Can this be done? I don't think I will need to use Win32::ODBC but instead som

Accessing an Access database from a Unix box

2002-04-07 Thread Daniel Falkenberg
Hello All, I am currently NOW trying to access an Access database filename.mdb from a shared drive on my Unix box. Now all I want to do is extract data from an SQL query from this database? Can this be done? I don't think I will need to use Win32::ODBC but instead something else like DBD::odbc

Re: Can any one see anything wrong with this simple code?

2002-04-05 Thread Daniel Falkenberg
you using? > > Also, are you SURE that the program below is what you are tyring to run. > - Original Message - > From: "Daniel Falkenberg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, April 06, 2002 1:27 AM > Subject:

Can any one see anything wrong with this simple code?

2002-04-05 Thread Daniel Falkenberg
#!/usr/bin/perl -w use CGI qw(:all); print header(); print< Hello World! HTML This on any other day seem very simple to me but for some reason I am recieving the following error? Can't find string terminator "HTML" anywhere before EOF I have tried with or without HTML; but still not lu

Stripping digits from a variable...

2002-04-03 Thread Daniel Falkenberg
Hey all, I have a variable that prints... 2002 I want to strip the first two digits from that. Could someone give me a hand with that. At the moment I have ... $year = "2002"; $year =~ s//20/; Is there a more precise way of doing that? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTE

RE: Cant open file...

2002-04-03 Thread Daniel Falkenberg
Of coarse I had no problem with the linux box... :) -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, 4 April 2002 12:14 PM To: Daniel Falkenberg; Timothy Johnson Cc: [EMAIL PROTECTED] Subject: RE: Cant open file... Ah. There's your problem.

RE: Cant open file...

2002-04-03 Thread Daniel Falkenberg
s long as it works :) Regards, Dan -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, 4 April 2002 11:30 AM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: RE: Cant open file... You really haven't given us much to go on, but I guess you might double-

Cant open file...

2002-04-03 Thread Daniel Falkenberg
Hi all, Just wondering why this error message is appearing on my windows box. I can read the file okay on a Linux box but when I ported my program to the Windows box I am not receiving the following error message. I have set the permissions on the file the full access to everyone (For testing p

Converting Unix time...

2002-04-02 Thread Daniel Falkenberg
G'day all, What would be the best way of converting Unix time into a ddmmyy format? I am a little stuck with this so any ideas would be greatly appriciated. Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Checking against an assosiative array...

2002-04-01 Thread Daniel Falkenberg
G'day All, Just wondering how I would check the following variable against the hash below? sub read_data { open USER_DATA, "$USER_DATA" or warn "cannot open '$USER_DATA' for reading: $!\n"; flock(USER_DATA, 2) || warn "Can't lock $USER_DATA exclusively: $!"; while( $USER_DATA= ) {

RE: Can I set this as a hash?

2002-03-25 Thread Daniel Falkenberg
: Daniel Falkenberg; Timothy Johnson Cc: [EMAIL PROTECTED] Subject: RE: Can I set this as a hash? Oh, okay. I thought you just weren't sure how to access the data. print "Enter your username: "; chomp($input = ); if($users{$input}){ print "Welcome, $input.\n";

RE: Can I set this as a hash?

2002-03-25 Thread Daniel Falkenberg
> Where you access the data for each person via the unique username. > If you still want to use PERL then maybe you should keep the data in a > seperate file and parse though it instead of keeping the data in a > multidemensional hash. > > -Original Message- > From: Daniel

RE: Can I set this as a hash?

2002-03-25 Thread Daniel Falkenberg
: 'Matthew Harrison'; Daniel Falkenberg Cc: [EMAIL PROTECTED] Subject: RE: Can I set this as a hash? Or perhaps a list of lists... Maybe you should describe your HOH better. What do you want the end result to look like? -Original Message- From: Matthew Harrison [mailto:[EMAIL

Can I set this as a hash?

2002-03-25 Thread Daniel Falkenberg
Hello All, Just wondering how I would go about setting up the following hash and if it would be wise to do it this way? I have the following data... $username $company $fullname $owing I want to place all of this in a hash of a hash... %name_of hash = "Username1" => "Company

RE: Parsing CGI data to another page...

2002-03-14 Thread Daniel Falkenberg
COMPLETED! Hey all, Just wondering how I would go about having this URL www.mydomain.com/cgi-bin/test.cgi?data=test Would be parsed to... www.mydomain.com/cgi-bin/test2.cgi >From test2.cgi I would like to be able to read that data = test from test.cgi. <--- Start Test1.cgi ---> Simple

Parsing CGI data to another page...

2002-03-14 Thread Daniel Falkenberg
Hey all, Just wondering how I would go about having this URL www.mydomain.com/cgi-bin/test.cgi?data=test Would be parsed to... www.mydomain.com/cgi-bin/test2.cgi >From test2.cgi I would like to be able to read that data = test from test.cgi. <--- Start Test1.cgi ---> Simple HTML page wi

RE: Writing this chuck of code a little smaller...

2002-03-14 Thread Daniel Falkenberg
\s*(.*?)\s*$/; $filehash{$title}{$1} = $2; } close FILE; return %filehash; } Does this look stupid to you or is this actually possible? Regards, Da -Original Message- From: Tanton Gibbs [mailto:[EMAIL PROTECTED]] Sent: Friday, 15 March 2002 12:48 PM To: Daniel Falkenberg; [

Writing this chuck of code a little smaller...

2002-03-14 Thread Daniel Falkenberg
D'day all, I have the following chunk of code that I was wondering If I can write a little smaller. I was thinking a while loop. Could some one give me a little advice on this one :)... results_read(); if ($poll =~ /newspaper/) { print "Thank you for picking news paper!"; $none

RE: Perl Graphs

2002-03-14 Thread Daniel Falkenberg
Tim and Jim, ( :) ) *RHYMS* Thank you very much for your quick reply. I will be sure to give it a go :). Kind Regards, Dan -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Friday, 15 March 2002 10:54 AM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: RE

Perl Graphs

2002-03-14 Thread Daniel Falkenberg
G'day all, Just wondering how I would go about graphing with Perl. I have used GD::Graph before, but I am now looking for something a little more colourful (if you wish :) ) than that if possible. Any ideas, Kind regards, Dan == VINTEK CONSULTING PTY LTD (ACN 088

RE: Stripping everything after words found

2002-03-10 Thread Daniel Falkenberg
, 11 March 2002 3:47 PM To: Daniel Falkenberg Cc: [EMAIL PROTECTED] Subject: Re: Stripping everything after words found oh - you didn't want to include 'Call Distance'? then: ($test) = $string =~ /(.*)Call Distance/; would only capture text up to 'Call Distance'. Needn&

Stripping everything after words found

2002-03-10 Thread Daniel Falkenberg
Hey All, If I have a string that looks like the following... $string = "Crud I want Call Distance more crud skdafj 343sad55434 "; How would I go about getting rid of everything after the Call distance and including the Call Distance? Would it be somthing like the following...? ($test) = $stri

what if or next if...?

2002-03-10 Thread Daniel Falkenberg
G'day all, Just wondering if some one can help me with the folloing problem...? Basically I have a variable that will change at regular intervals. The varible may look like this... $var = "Crud Crud Call Distance: UNfasdfasdfasdfasdfasdn alternative". "(fasdfsda) SuperZone region: Gawler Call

RE: Finding words between words...

2002-03-10 Thread Daniel Falkenberg
Hello all, I have some text here that I have placed in a string. I want to be able to extract words between text of my choice. For example in the string... $string = "Hello world In: crud all Your."; ($mytext) = $string =~ /In:(.*)Your/; The above works fine but how can I tell my regex to st

RE: Finding words between words...

2002-03-07 Thread Daniel Falkenberg
ailto:[EMAIL PROTECTED]] Sent: Friday, 8 March 2002 11:44 AM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: RE: Finding words between words... I think this will do what you're asking, but I can't test it. $line =~ s/In:(.*)Your/In:($newstring)Your/; # substitute In: followed b

Finding words between words...

2002-03-07 Thread Daniel Falkenberg
Hey all, Does any one know how I would go about finding everything between the words of... In: Your? So if I have a sentance with the following... Hello all this In: America (New York) Your So is there some perl code that will extract America (New York). Keep in mind tha t everything betwee

Executing a page within a page

2002-03-07 Thread Daniel Falkenberg
Hey All, I have a piece of code here that uses HTML::TreeBuilder and the LWP::Simple () modules. Having said that, the script is supposed to go ahead and execute another page that contains cookies. Now I want a user to be able to press a button that will go and run another cgi script. I don't

HTTPS --> HTTP::Request

2002-03-05 Thread Daniel Falkenberg
Hello All, Just wondering what would be my best way of 'getting' HTML code with Perl from a HTTPS URL. Is there a CPAN module out there that will download a HTTPS site and extract all the HTML from it? Kind regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

HTML::Tree with https --> Make that HTML::Request with https

2002-03-04 Thread Daniel Falkenberg
Hey all, Is it possible to do the following... I want to get the URL at $inputsite with the following... $inputSite = "mydomain.com/cgi-bin/new-userdatalookup?username=$username&access=Dialu p&month=01&year=2001&loggedin=1"; $tree = HTML::TreeBuilder->new; $address = "https://"; . $inputSite; $

HTML::Tree with https

2002-03-04 Thread Daniel Falkenberg
Hey all, Is it possible to do the following... I want to get the URL at $inputsite with the following... $inputSite = "mydomain.com/cgi-bin/new-userdatalookup?username=$username&access=Dialu p&month=01&year=2001&loggedin=1"; $tree = HTML::TreeBuilder->new; $address = "https://"; . $inputSite; $

RE: Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
Gawler SA 5118 == -Original Message- From: Gabby Dizon [mailto:[EMAIL PROTECTED]] Sent: Monday, 4 March 2002 1:53 PM To: Daniel Falkenberg Cc: [EMAIL PROTECTED] Subject: Re: Perl to work like Java Hi Daniel, perhaps you mean javascript? to answer your que

RE: Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
] Subject: Re: Perl to work like Java Yes it is possible. The forms will be sent to the script which then process the inputs. - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 03, 2002 5:44 PM Subject: Perl t

Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
Hey all, I need a Perl script to be able to have a user fill out an online form. Now this is easy enough but what I want is the user to check a couple of checkboxes and then have the script go and do something like a calculation. Can this be done using perl or do I have to use Java? Also I would

Chaning case

2002-02-28 Thread Daniel Falkenberg
G'day All, Quick question I want to be able to change all folders in a directory to lower case? Does any one know how I could do this using Perl? Would I go something like this? system('lc *'); well something like that... :) Regards, Dan == -- To unsubscribe,

Regex...

2002-02-27 Thread Daniel Falkenberg
Hey all, I am just working on a small text file and was wondering if a regular expression would help me here. Basically the text file looks like this... User data query User data query Time utilization for this billing period Pre-paid hours: 744 Hours used so far: 29.55 Excess hours billed

Stripping HTML

2002-02-26 Thread Daniel Falkenberg
Hello All, Could some one help me with stripping out the following from the following HTML? Find this one  one 1  Find this two  two 2  Find this three  three 3  Basically using HTML::TableExtract I really want to extract one 1 two 2 three 3 So far I have the following cod

RE: Writing file to Windows

2002-02-25 Thread Daniel Falkenberg
2002 11:10 AM To: Daniel Falkenberg Subject: Re: Writing file to Windows Then I'm sure it is a permissions problem. Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: "Agusti

RE: Writing file to Windows

2002-02-25 Thread Daniel Falkenberg
ustin Rivera [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 26 February 2002 9:54 AM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: Re: Writing file to Windows I'm getting a ton of errors just trying to get your code to work. But since you are addressing the simple grabbing of a web page, does this

Writing file to Windows

2002-02-25 Thread Daniel Falkenberg
Hey All, Is there any reason why I can't seem to get... LWP::Simple::is_success(LWP::Simple::getstore($address, $html_file) to write to a file. I have used the exact same code on a Linux box but when I go to run it on a Windows box it doesn't seem to download it and save it to a dir? Is this

Getting code to work on a windows box

2002-02-24 Thread Daniel Falkenberg
Hi All, The code below works fine on a Unix box but for some reason it doesn't work on a Windows box. My code compiles ok on the Windows box but when I go to run it the code never actually downloads the WWW page. Is there something I have to do to be able to use this on a Windows box? ___START

Still can't extract data using HTML::TokeParser

2002-02-24 Thread Daniel Falkenberg
($content) || die "Can't open: $!"; while ($stream->get_tag("h1")) { $data = get_trimmed_text("/h1");} Thx, Dan -Original Message- From: Chris Ball [mailto:[EMAIL PROTECTED]] Sent: Friday, 22 February 2002 9:49 PM To: Daniel Falkenberg Cc: [E

HTML::TokeParser

2002-02-24 Thread Daniel Falkenberg
Hello All, Is it possible for HTML::TokeParser to be able to work like HTML::TreeBuilder. I don't want to have to download the webpage I just want to be able to view its' HTML content and then extract the data from there. If this isn't possible what would be my best bet for downloading the enti

RE: What would take care of this?...

2002-02-24 Thread Daniel Falkenberg
ontent = $address; $p = HTML::TokeParser->new(shift||$content); if ($p->get_tag("title")) { my $title = $p->get_trimmed_text; print "Title: $title\n"; } Can any one see anything wrong with this? Thx, Dan -Original Message- From: Chris Ball [mai

RE: Netscape or Perl error?

2002-02-21 Thread Daniel Falkenberg
t least my script is *finally* cross platform :). Thx, Dan -Original Message- From: Dave Benware [mailto:[EMAIL PROTECTED]] Sent: Friday, 22 February 2002 4:22 PM To: Beginners perl Subject: Re: Netscape or Perl error? Daniel Falkenberg wrote: > > Hi All, > > I am ju

What would take care of this?...

2002-02-21 Thread Daniel Falkenberg
Hey All, Just wondering how I would go about extracting all the data from heading 1 (h1) in the following HTML code. I figured I could have used HTML::TableExtract but then I realized ( :) ) there are not tables in the following HTML. Would I now have to go ahead and use HTML::parser or somethi

Netscape or Perl error?

2002-02-21 Thread Daniel Falkenberg
Hi All, I am just testing my Perl CGI script on Netscape browser at the moment and I am getting a weird error occur. I can execute my script fine but when I go to use a link in the script such as... http://mydomain.com/cgi-bin/script?words=test&action=check_data In the URL bar of Netscape I ge

Allow only letters and numbers?

2002-02-21 Thread Daniel Falkenberg
Hello List, The code below of coarse will count all characters in the string $string $string = "4556jhkl"; $count = $string =~ tr/a-zA-Z0-9//; How would I go about only allowing numbers and letters of the alpahbet? if ( $string =~ /\dw/)) { print "Only letters and numbers allowed: NO SPECIA

Activer Perl Modules

2002-02-20 Thread Daniel Falkenberg
Just wondering if any one has seen this error before when installing a Active Perl Module. I have RTFM. I have run... c:\ppm then... PPM>install HTML-TableExtract.ppd but then I recieve the following error... Error installing package 'HTML-TableExtract.ppd': Error reading ../MSWin32-x86-mu

Finding numbers ONLY in a variable

2002-02-20 Thread Daniel Falkenberg
hi again all, Sorry to keep approaching you with my regex problems, but I really havn't had time to read up on them yet. If I have a variable... $var = "dfasdf"; Is it possible to get a regex to say ... "hang on I only want numerals in my variable. I am now going to print an error :)" if ( $

Opposite of $respose->is_success

2002-02-20 Thread Daniel Falkenberg
Hey all, Just wondering if any one know what the oposite of $response->is_success in the code below? I have tried $response->is_fail and $response->is_failure. I have also RTFM but I can't find anywhere what the opposite is. What I essentially want to do is if the site or page ($inputsite) can

Get rid of digits...

2002-02-20 Thread Daniel Falkenberg
Hey all, Just wondering what my best way would be to go about stripping all digits from my string. So far I have the follwoing... $string = "08 852365 21 Hello world!"; $string =~ s/[.*\d\s]//g; What does this do exactly? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

RE: Splitting variable...

2002-02-20 Thread Daniel Falkenberg
ursday, 21 February 2002 10:40 AM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: Re: Splitting variable... What you are doing is correct. -paresh. At 10:20 AM 2/21/2002 +1030, Daniel Falkenberg wrote: >Hey all, > >I am working with a variable at the moment where I want it to be spl

Splitting variable...

2002-02-20 Thread Daniel Falkenberg
Hey all, I am working with a variable at the moment where I want it to be split at every 'space' such as ... $string = "the quick brown fox"; How would I go about doing this? Would I do something like the following... @line = split/\s+/, $string; $line[0] = the $line[1] = quick $line[2] = br

Stripping words from a string

2002-02-19 Thread Daniel Falkenberg
Hey all, Just wondering how I would go about stripping words from a string. If I have a string that has the following... $string = "Hello world how are you?"; How would I go about stripping the words 'how' and 'Hello' ignoring case each time? Would it go something like the following... $stri

Matching a variable against nothing

2002-02-19 Thread Daniel Falkenberg
Hey all, Just wondering how I check if a variable contains nothing or not. I thought it was something like the following... if ( $string eq '' ) { print "String contains nothing"; } else { print "The string contains the following: $string"; } Is this correct? Dan -- To unsubscribe, e-mai

HTML::TableExtract

2002-02-19 Thread Daniel Falkenberg
Hi all, At the moment I am working with HTML::TableExtract. I must say that I am having alot of fun with it and most of it is working really well. What I am looking for is some ideas on how I can go about the following... Basically I have my own CGI/Perl page that a user enters some credentials

10 Digits, no more no less

2002-02-18 Thread Daniel Falkenberg
Hey all, Just wondering if Perl is able to could how many digits there is in a variable. Basically I want a user to be only able to enter 10 digits no more no less. Is there a way perl can count this variable and with a little if/else statment I can display the result. Kind regards, Dan -- T

Possible outcomes

2002-02-18 Thread Daniel Falkenberg
Hey all, I have some code (below) that will strip data from a HTML page and go ahead and display information that I need. The proble I am facing is that the data has 4 possible out comes derived from user input. Basically I would like to start on 2 possible out comes. If the user is to have

HTML::

2002-02-13 Thread Daniel Falkenberg
t -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

HTML::TreeBNuilder

2002-02-07 Thread Daniel Falkenberg
G'day all, Just wondering what my best way to extract the second part of my table... NOT YET AVAILABLE  If I use the following code I can extract the phone number but I can't extract the coverage outcome... @headers = qw/number coverage/; $te = new HTML::TableExtract( headers => [@headers] );

HTML::TreeBuilder

2002-02-06 Thread Daniel Falkenberg
Hey all, I am currently working with the perl CPAN module HTML::TreeBuilder. Is someone able to explain to me if this is the module I want to use to extract data from a HTML page. Now this HTML page is contained outside of my perl-cgi script. From what I can gather the module will download

Another simple question

2002-02-04 Thread Daniel Falkenberg
Hey All, I have a string here that may/maynot containg the words NOT YET AVALIABLE. How can I using perl and regex look for a match for the above words. Would it be something like the following... if (test =~ qw(NOT YET AVALIALBE)) { print "Sorry not yet avaliable!"; else { print "Anothe

Module to fill out form and read data from it

2002-02-04 Thread Daniel Falkenberg
G'day all, Does any one know of any CPAN modules that will fill out a form and read data from it? Basically I need a singe CGI perl script that connects to anther CGI script and fills out the form then gets the results I need. Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Extracting HTML details from another web site.

2002-02-04 Thread Daniel Falkenberg
Hey all, Just wondering if the following can be done... Basically I have a page that I type in some details and submit these details to another page. Now the page that is returned I don't want displayed at all instead I just want to extract some details from that page and then display them in

Scrolling text box placing carrige returns in text file.

2002-01-20 Thread Daniel Falkenberg
Hey All, I have just created a perl/cgi program that contains a scrolling text box. This text box will grab a small text file from a DIR and placed this text file in the HTML scrolling text file. A user is now able to chage and modify the contents in here but when the user goes and submits the

Default variable for STDIN.

2001-12-20 Thread Daniel Falkenberg
Hello All, Just a quick question. Just wondering how I would go about allowing a user to enter with STDIN either a Y or a N, but have the default variable of N if the user just hits enter. So far I have... print "Hit Y to continue: [N]"; $input = ; hmm.. something like that. Kind Regards, D

CPAN and Perl

2001-12-20 Thread Daniel Falkenberg
G'day All, I was just wondering if any one here has any experience with download Perl CPAN modules from a Perl script. I have looked at CPAN.pm but am a little confused by this. I have tried the following... #!/usr/bin/perl -w use strict; #Check if a module exists... if it doesn't then ask t

Variables not being deleted from memory.. I think.

2001-12-19 Thread Daniel Falkenberg
Hi list, I have a unique problem here where I have a daemon perl script running. The code below sits in a while loop in my Perl daemon. If the $status ever equals a 6 then the chunk of code below is executed. Now the problem is is that the code never updates. Ie if I happed to add a * in front

Quick regex. Q.

2001-12-18 Thread Daniel Falkenberg
Hey All, I just have a really quick regex question. I have the following code... next if $username =~ /^ruby/; will that strip and go to the next if statment if $username = ruby? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Print second set of keys in hash of hash...

2001-12-18 Thread Daniel Falkenberg
Hello All, I am still having trouble printing out a second lot of hash keys in a hash of a hash. Here is what I have so far. Any ideas or suggestions will be greatly appriciated... %users = ( 'user1' => { 'Fullname1' => 'YES' },

Prining hash of hash values

2001-12-18 Thread Daniel Falkenberg
List, I have a hash of a hash here with that looks similar to the following... %allusers = ( 'USER' => { 'user1' => 'YES', 'user2' => 'NO', 'user3' => 'YES' } ); With

New idea..

2001-12-17 Thread Daniel Falkenberg
Hello All, Just wondering if some one can help me with some stuff that I want to do... Basically I have a hash like so... %popusers_test = ( 'tesst8' => 'YES', 'vintekpop' => 'NO' ); Now I need to print that to a file like so... [USERS] tesst8 = YES vinte

test

2001-12-17 Thread Daniel Falkenberg
test -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Hash question...

2001-12-17 Thread Daniel Falkenberg
Hello All, I just have a quick question about printing hash of hash values. The hash looks like the following... %popusers = ( 'user1' => { 'fullname1' => 'YES' }, 'user2' => {

Hash is almost there...

2001-12-17 Thread Daniel Falkenberg
Hello List, I have almost completed my hash of a hash problem but for some reason my data is sitting all over the place... as shown in the following hash of a hash... %popusers = ( 'fullname1' => { 'fullnam1' => 'NO' },

Can any one see an error in here I can't?

2001-12-17 Thread Daniel Falkenberg
Hello All, I have this problem that I can't seem to see what is going on. The following code gives me the following output... #!/usr/bin/perl -w use Data::Dumper; my $file = '/etc/passwd'; my $procrc = '.procmailrc'; sub view_users{ open( PASSWD, $file) or die "$file: $!\n"; flock(PA

RE: Format of array in HTML text box gone weird...

2001-12-16 Thread Daniel Falkenberg
-Original Message- From: Kristina Nairn [mailto:[EMAIL PROTECTED]] Sent: Monday, 17 December 2001 3:14 PM To: Daniel Falkenberg; Peter Scott Cc: [EMAIL PROTECTED] Subject: Re: Format of array in HTML text box gone weird... Try the following code: undef $"; print "@lines"; $"

Hash of a hash question... Answer to my own question...

2001-12-16 Thread Daniel Falkenberg
'user3' => { 'Fullname3' => 'YES', } '*user4' => { 'Fullname4' => 'YES' } ); Some of the %popusers keys have a star that I want de

Hash of a hash question...

2001-12-16 Thread Daniel Falkenberg
Hello all! Can some one help me with the following hash of a hash? I need to create a hash of a hash in the following format... %popusers = ( 'user1' => { 'Fullname1' => 'YES', } 'user2' => {

RE: Format of array in HTML text box gone weird...

2001-12-16 Thread Daniel Falkenberg
Peter, That is exactly what it does but is there any way to get rid of that? Regards, Dan -Original Message- From: Peter Scott [mailto:[EMAIL PROTECTED]] Sent: Monday, 17 December 2001 2:28 PM To: Daniel Falkenberg; [EMAIL PROTECTED] Subject: Re: Format of array in HTML text box gone

  1   2   >