Search results

  1. T

    How to get perl to fill in an online form?

    Hi, I'm making this program in Perl to fill out a form on a webpage but I'm getting an error. The bit I got trouble with is $form = HTML::Form->parse($html, $URL); $form->value(query => "Perl"); I get an error come up saying Can't call method "value" on an undefined value at...
  2. T

    Can you help with my Perl data bese?

    I'm trying to make a data base that my Perl program can access. I'm thinking about having it in a .txt file and it looking like this... #START FILE# name = Mr Smith Address = 1 The Rd Some Town #END FILE# #START FILE# name = Mr Jones Address = 1 The Street Another Town #END FILE# What I...
  3. T

    How do you search a file in Perl?

    I'm trying to get Perl to search a file for a string held in $data and if its not found print it into the file. The code I've got at the moment is: open FILE, 'list.txt'; while ( my $data = <DATA> ) { $data =~ s/(.)(+)/$1.length($1.$2)/ge; print $data; } close FILE; but it prints...
  4. T

    How to call a another program and die in Perl?

    I've got a program that I'm wighting in Perl that I would like to call program2.pl and die if something happens. I've got the line of code: die {exec "program2.pl"}; will that make my first program die? I know it calls program2.pl, but I don't want program1 to keep going. I read some where...
  5. T

    How can I get Perl to edit a database in a .txt file?

    I'm trying to get Perl to make a database that looks like.... Mr Smith 1 Some Road Some Town County Post Code Mr A Nother 5 The Street The Town The County Post Code I have the names in $names and the address in $address, I can also get them printed in to data.txt how I want it to look, is...
  6. T

    How do I get perl to print the input from a HTML form to a .txt file?

    I've got the code below.... <FORM ACTION="/perl-bin/signup.pl" METHOD="POST"> <P> <INPUT TYPE=TEXT NAME="name" SIZE=20 STYLE="width: 4.34cm; height: 4.34cm"> <INPUT TYPE=TEXT NAME="address" SIZE=20 STYLE="width: 4.34cm; height: 5cm"> <br> <br> <INPUT TYPE=SUBMIT VALUE="Tell us Your Address">...
  7. T

    How do I get Perl to die after reading the 1st line in a file?

    I've got a program that reeds the first line from a file then deletes it (code below). open (line, "list.txt") || die ("Could not open file $!"); $data = <line>; close (line); print "The first line of the file reads : $data "; open INFILE, '<list.txt'; open OUTFILE, '>temp.txt'; <INFILE>...
  8. T

    Is there a way to run a Perl program on a web server using Command Prompt?

    Hi, I've got a program that I've made on my home PC that I've uploaded to my web server. Is there a way to run it using command prompt so I can see if it works ok? Thanks for your help
  9. T

    How can I get Perl to make a database table in a .txt file so I can read and edit it?

    I wanna get Perl to make a database in the form of a table and save it to a .txt file. I want the columns to be called "id no.", "name" and "address". I also need it to check that is not making an entry for an id no. that is already it the table, but edit the name/address. Thanks for your help.
  10. T

    Is there a way to run a Perl program on a web server using Command Prompt?

    Hi, I've got a program that I've made on my home PC that I've uploaded to my web server. Is there a way to run it using command prompt so I can see if it works ok? Thanks for your help
  11. T

    Can you help with my Perl data bese?

    I'm trying to make a data base that my Perl program can access. I'm thinking about having it in a .txt file and it looking like this... #START FILE# name = Mr Smith Address = 1 The Rd Some Town #END FILE# #START FILE# name = Mr Jones Address = 1 The Street Another Town #END FILE# What I...
  12. T

    How to get perl to fill in an online form?

    Hi, I'm making this program in Perl to fill out a form on a webpage but I'm getting an error. The bit I got trouble with is $form = HTML::Form->parse($html, $URL); $form->value(query => "Perl"); I get an error come up saying Can't call method "value" on an undefined value at...
  13. T

    How to call a another program and die in Perl?

    I've got a program that I'm wighting in Perl that I would like to call program2.pl and die if something happens. I've got the line of code: die {exec "program2.pl"}; will that make my first program die? I know it calls program2.pl, but I don't want program1 to keep going. I read some where...
  14. T

    How do I get perl to print the input from a HTML form to a .txt file?

    I've got the code below.... <FORM ACTION="/perl-bin/signup.pl" METHOD="POST"> <P> <INPUT TYPE=TEXT NAME="name" SIZE=20 STYLE="width: 4.34cm; height: 4.34cm"> <INPUT TYPE=TEXT NAME="address" SIZE=20 STYLE="width: 4.34cm; height: 5cm"> <br> <br> <INPUT TYPE=SUBMIT VALUE="Tell us Your Address">...
  15. T

    How do I get Perl to die after reading the 1st line in a file?

    I've got a program that reeds the first line from a file then deletes it (code below). open (line, "list.txt") || die ("Could not open file $!"); $data = <line>; close (line); print "The first line of the file reads : $data "; open INFILE, '<list.txt'; open OUTFILE, '>temp.txt'; <INFILE>...
  16. T

    How to search a file using perl?

    I want to search a .txt file for "$data" and if its found call program2.pl and if not print $data. I know how to open and close the file, but can't search the file. I need to match the whole line not just if $data is in the start, middle or end. Thanks for your help.
  17. T

    How do I delete the 1st line on a file using perl?

    Hi, I want to delete the first line of a file using perl. In my code, I have the file open and line saved as $line. But how can I delete $line from the file?
  18. T

    How can I get Perl to edit a database in a .txt file?

    I'm trying to get Perl to make a database that looks like.... Mr Smith 1 Some Road Some Town County Post Code Mr A Nother 5 The Street The Town The County Post Code I have the names in $names and the address in $address, I can also get them printed in to data.txt how I want it to look, is...
  19. T

    How can I get Perl to open/make a .txt file using $input for the file name?

    I want to get perl to make the file using $input as the name so if 'name' was saved as $input the file would be called 'name.txt' I've got it like this at the mo: open FILE, ">'$input'.txt" or die $!; but its not working :( anyone got any ideas?
  20. T

    How can I get Perl to make a database table in a .txt file so I can read and edit it?

    I wanna get Perl to make a database in the form of a table and save it to a .txt file. I want the columns to be called "id no.", "name" and "address". I also need it to check that is not making an entry for an id no. that is already it the table, but edit the name/address. Thanks for your help.
Back
Top