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 strongm 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: *

  1. k1ng0fn3rd

    opengl compile error

    strettonman: it can't be that way because it's inside an "ifndef" statement (if not defined). That means it hasn't already been defined yet. 49 # ifndef _WCHAR_T_DEFINED 50 typedef unsigned short wchar_t; 51 # define _WCHAR_T_DEFINED -------------------------- The best answer to your...
  2. k1ng0fn3rd

    opengl compile error

    I'm an absolute beginner in C and opengl and was trying out a test program. When I included glut.h #include <GL/glut.h> I got this error: Redeclaration of C++ builtin short line 50 glut.h Is my glut.h defective or am I doing something wrong -------------------------- The best answer to your...
  3. k1ng0fn3rd

    using tr///

    alright, that makes sense. is there anyway to do this with tr///, or would you have to do something like this: @abc = 'a','b','c'; %alpha = ( 'a' => 1, 'b' => 2, #etc... ); foreach $letter (@abc) { $num =~ s/$letter/$alpha{$letter}/; push(@abc,$num)...
  4. k1ng0fn3rd

    parse/modify files

    in fact scratch that -------------------------- The best answer to your question will definitely be RTFM.
  5. k1ng0fn3rd

    using tr///

    How come this code: $text = "abcdefghijklmnopqrstuvwxyz"; $text =~ tr/a-z/1-{26}/; print "$text\n"; produces this output: 123456789:;<=>?@ABCDEFGHIJ ? -------------------------- The best answer to your question will definitely be RTFM.
  6. k1ng0fn3rd

    rebuilding a module with CPAN

    AHA! i found your problem! it can be summed up in one word: Mac That's your problem. -------------------------- The best answer to your question will definitely be RTFM.
  7. k1ng0fn3rd

    Build a Primary Menu to interface with

    i don't think perl is the thing for you... try other languages such as javascript, etc. -------------------------- The best answer to your question will definitely be RTFM.
  8. k1ng0fn3rd

    Help with scanning a huge text file

    or, though i don't dare try it myself, you could try archiving the file every time it is accessed, then simply find the differences and work with those. -------------------------- The best answer to your question will definitely be RTFM.
  9. k1ng0fn3rd

    replacing a scalar in a test file

    or something like: open(READ,"test_file"); $file_contents = <READ>; close READ; $file_contents =~ s/$word//; open(WRITE,">test_file"); print WRITE "$file_contents; close WRITE; I think that should work...
  10. k1ng0fn3rd

    parse/modify files

    Try something like: <code> open (READ, "texta.xml") while(<READ>) { if($block1 == true) #block one is definite { open(WRITE, ">texta.xml"); } if($block1 == 2) #two lines of block 1 match { if(m!<bla>no</bla>!)...
  11. k1ng0fn3rd

    newbie question, date diff

    It would be much easier if you could change the format of the date to make the month a number, preferrably something like this: Wed 7 16 19:05:43 2006. It would help even more if the day of the year could be provided, for example: Wed 226 19:05:43 2006, in which case days could simply be...
  12. k1ng0fn3rd

    retrieving only the first character from STDIN

    Notice that it uses getc, which, as stated in the perl documentation: http://perldoc.perl.org/functions/getc.html
  13. k1ng0fn3rd

    retrieving only the first character from STDIN

    Maybe this isn't the best question to ask. I guess I was just curious... It just seemed like the users of certain programs should be able to only type one character and let the program do the rest... I don't know...
  14. k1ng0fn3rd

    control+m

    I think the first question is why are you using windows? All Unix and Linux distributions that I have seen have the bash shell. The bash shell makes perl so much easier, and it's a good idea in general to be using Linux/Unix.
  15. k1ng0fn3rd

    retrieving only the first character from STDIN

    The result from that code isn't quite what I was aiming for. I was looking for a way to retrieve the first character of input, which is exactly what that does. But I was also looking for a way for that to be all the user could type. The program would then move on once one character was typed.
  16. k1ng0fn3rd

    What is wrong with my code: tryign to read a text file

    maybe your real problem, although this probably sounds stupid, is all the shorthand you're using. try expanding it all and you might find your problem.
  17. k1ng0fn3rd

    retrieving only the first character from STDIN

    I'm trying to find a function in perl that takes only the first character typed in STDIN, returns it, then just moves on, like the C++ getch(). Is there any way to do this?

Part and Inventory Search

Back
Top