Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: xmassey
  • Order by date
  1. xmassey

    Find array index

    I changed my version of the code slightly so that the only variable that the script needs is which letter/word you want to find (because before it sort of needed to know how many letters/words the array contained (shown by the until ($no == 4);)... #! usr/bin/perl use strict; ##### print...
  2. xmassey

    Find array index

    I used this... #! usr/bin/perl use strict; print "Content-type: text/html\n\n"; my ($tofind, $no, @var); $tofind = 'c'; $no = '0'; @var = ('a', 'b', 'c', 'd', 'e'); do { if (@var[$no] eq $tofind) { $no = $no + 1; print "$tofind is at position $no"; } $no = $no + 1; } until ($no == 4)...
  3. xmassey

    Find array index

    Have you already written some code, because I can think of a few ways to do this, and I was wondering which approach you took
  4. xmassey

    Clarification on .htaccess

    They aren't even encrypted. I don't get why they need to be??? The correct username and password is stored in a text file which is highly secured using htaccess, no one can view the correct username an dpassword
  5. xmassey

    Use PERL to confirm a word is in a file.

    Yes, I meant print "$array"; Thanks
  6. xmassey

    \a

    Thank you
  7. xmassey

    100% CS Layout

    I don't know if this helps... I once had a left right scroll bit at the bottom... I had a navigation box on the left, and a main section on the right. By giving the main section a 100% width it made the page had to scroll as much as the navigation was width... I solved it by indenting the text...
  8. xmassey

    Use PERL to confirm a word is in a file.

    Ok maybe I have figured out what you were saying... @array = ('one', 'two', 'three'); $aaa = @array; print "@array"; The output is the number of words the array contains (3)... @array = ('one', 'two', 'three'); $aaa = "@array"; print "@array"; The output is the words the array contains (one...
  9. xmassey

    Use PERL to confirm a word is in a file.

    I can only figure, that if I pass an array onto a scaler, then it counts the number of words the array contains, otherwise if I don't pass it to a scaler it prints the words contained within the array
  10. xmassey

    \a

    I read that the \a sounds an alarm (bell). I tried using this script... #! usr/bin/perl use strict; print "Content-type: text/html\n\n"; print "\aHello!\n"; The result is a little square box and the word Hello. Anyone know why I don't get a bell sound>?
  11. xmassey

    Clarification on .htaccess

    Well, no hehe. When the user logs in the first time, when they click login, a hidden field carries the username and password, so once in the admin area, if they click on another button i check if the username and password carried by the hidden field is the same as in the file storing it. This...
  12. xmassey

    Use PERL to confirm a word is in a file.

    Thats really strange. When I first built a user login system using perl, I used a really simple idea, which involved checking to see if the file contained the correct username and password. Below is part of my code... $ausername = param('username'); $apassword = param('password'); $auserpass =...
  13. xmassey

    Use PERL to confirm a word is in a file.

    I was presuming that 1 word was stored in the file. If I'm taking multiple words from a file then I would use split, to split all the words into individual scalers. However you would need to know how many words there are. Is there a way to count the number of words in an array, something like...
  14. xmassey

    Learning Perl

    ahh, its being blocked out by "~~~~" so i can't see the site.
  15. xmassey

    Clarification on .htaccess

    Ill tell you what, I have a Visual Quick Start guide for PHP and it has lots of examples, including a user authetication system. However, my main script language is perl... I do all the coding, and store all important info like passwords in a text file. I then secure just the text file with...
  16. xmassey

    Use PERL to confirm a word is in a file.

    I have just thought about what you said. You said that it will check the length of @logmessages and see if its the same length (is that what you meant?). if @logmessages = hello therefore if the code was if (@logmessages eq "hello"){ print "hello" } Then surely it would see if hello is equal...
  17. xmassey

    Learning Perl

    I will have a look for the bookshelf. You mentioned that the site has helped you alot, I was wondering which site you mean?
  18. xmassey

    String Replacement

    yeah your right, I just saw in my book that it also says put g at the end if you want to replace all strings... Another useful thing is to put i as well, and this ignores the case of the letters so.. $message =~ s/damn/bunnies/gi;
  19. xmassey

    Learning Perl

    I have been learning Perl now since Christmas this year and I feel I have achieved a great deal. One day shopping in Reading I found a book called Perl and CGI for the World Wide Web (Visual Quick Start Guide) and it gave me an excellent start. Since then I have brought 5 O'Reilly books... Perl...
  20. xmassey

    Use PERL to confirm a word is in a file.

    Yeah I apologise, that script however would check if the file contains the word "true" on its own, but it wouldnt work if they file contained multiple words. My new suggestion would be to use... $value = 4; open (LOG, "<log.txt") || Error('open', 'file'); flock (LOG, 2) || Error('lock'...

Part and Inventory Search

Back
Top