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. pkiller

    Heeeeeeeeeeeeelp guys

    Yes, try move your CD-Rom to IDE-Secondary-master. Regards, Carlos Almeida.
  2. pkiller

    validation

    hmm... can't help you more than this :( The new "if" only enters on GBStandardHTML() if $in{'Field2'} isn't empty. It seems that was what you have pretented, but I don't know enough on the inner structure of your code... cya -- pkiller
  3. pkiller

    Changing or deleting text

    one example: remove all paragraphs, the contains the text &quot;old material&quot; on all html files under &quot;web_pages&quot; $ find web_pages -name \*.html -type f | xargs perl -i -p -e 'BEGIN{undef $/} s/<p>[^<]*old material[^<]*//sg' -- pkiller
  4. pkiller

    Uppercase usernames: why not?

    first of all, it might cause a lot of confusion having a user named &quot;Pkiller&quot; other (different) named &quot;PKiller&quot; and also &quot;pkiller&quot;. another aspect to take into account, is the mail. in most implementations, mail is case insensitive, so a pkiller@foo.bar is...
  5. pkiller

    Pattern matching/regular expression question

    you can use find and perl. find will search the files you want. perl will change their contents. for instance, suppose you want to change all paragraphs &quot;<p>this is a paragraph&quot; to &quot;<p>this is another paragraph&quot; on all your html files under your current directory: $...
  6. pkiller

    validation

    do a little changes on the if's. that is, currently, you have (on the http:// part) this: if ($vars_gen{'Field2Data'} eq &quot;url&quot;) { if (($in{'Field2'} eq &quot;&quot;) || ($in{'Field2'} !~ /http... turn this into: if ($vars_gen{'Field2Data'} eq &quot;url&quot; and...
  7. pkiller

    Quick Question

    Actually, currently it is sorting by the whole line on a lexical way. You must pass a hand-made function to sort, that splits and compares your field. For instance, sort by second field (array pos 1): replace &quot;@ODB=sort(@old_list);&quot; by: @ODB=sort {@aa=split /\|/, $a...
  8. pkiller

    using modules in other directories

    Sure it's possible. You must quote the path (with double quotes, for instance): use lib &quot;/home3/mysite/public_html/modules&quot;; Or: BEGIN { push @INC, &quot;/home3/mysite/public_html/modules&quot; } ... cya -- pkiller
  9. pkiller

    How can I split a string of characters into two values?

    Tracy, you are not correct. Your RE will left on $part1 upto the first dot, not including it. My RE will left on $part1 upto the last dot, not including it. If there is a dot on the searched expression, both REs will always left something on $part1 and $part2. The original problem, was...
  10. pkiller

    variable interpolation to sendmail - help please urgent.

    hi again, if the sendmail is indeed being correctly invoked, then the only visible problem on your script, is this piece of code (at the start): for (@data){ push(@body,$$_{1}.'--'.$$_{0}.'\n'); } the &quot;$$_{1}&quot; seems rather strange to me. what are you trying to do? on the...
  11. pkiller

    Sendmail duplicating emails

    that's not a problem of perl itself (your code is ok), but a problem regarding the data you are feeding to sendmail. you are using the form &quot;sendmail recipient&quot; and also specifying on the head &quot;To: ...&quot;. Try only one of them: 1. using the &quot;-t&quot; flag for...
  12. pkiller

    perl

    try this script: while (<>) { @a=split /:/; @b=split &quot; &quot;,$a[4]; $x{$b[0]}++; push @{$z{$b[0]}},$a[4] } for (keys %x) { $x{$_}>1 or next; print join(&quot;\n&quot;,@{$z{$_}}),&quot;\n&quot;; } if this is on file &quot;run.pl&quot;, then run as ...
  13. pkiller

    Strange Problem

    your missing the &quot;import module&quot; clause, is this case, you should import time: # cat x import time day = time.strftime(&quot;%d&quot;, time.gmtime(time.time())) print day # python x 20 -- pkiller
  14. pkiller

    variable interpolation to sendmail - help please urgent.

    I don't know what the function &quot;sendmail()&quot; does, but I'll bet you are passing uncorrectly the argument %mail. try: sendmail(\%mail); otherwise, you will be passing a flat list with all key-values unrolled. -- pkiller
  15. pkiller

    Sorting on Keys

    find a way of breaking (or accessing) your fields individually. Then sort, search, whatever... unix /etc/passwd contains 7 fields separated by &quot;:&quot; to sort by 3rd field (user id): perl -e '@a=<>; @b = sort { @aa=split /:/,$a; @bb=split /:/,$b; $aa[2] <=> $bb[2] } @a; print...
  16. pkiller

    How can I split a string of characters into two values?

    yes, the dot must be quoted for work on a regular expression. also, the concatenation string operator in perl is &quot;.&quot; and not &quot;+&quot; (the later is true for java or python). So, you need this: $part2 = '.' . $secondword; Also, a more direct way to do it, might be...
  17. pkiller

    Shell Programming

    if using a plain old shell script, to access from the 10th argument up, you must use shift. For instance, to print the first 3 lines of every file passed, with a litte header: while test $# -gt 0; do echo &quot;==== $1 ====&quot; sed 3q &quot;$1&quot; shift done also, the...
  18. pkiller

    make: no targets specified and no makefile found

    you must do $ ./configure && make try first to do a : $ ./configure --help to see if some options are good for you. to check your current library version, try: $ ls -al /lib/libc.* /usr/libc.* and check the names of the files (libc.so.1.2.3 for example) cya -- pkiller
  19. pkiller

    How to re-initialize an array ???

    to cyberson: the memset and the loop are very closely like solutions. The actually difference, is that memset usually is optimized with assembly, and/or loop unrolling techniques, but a simplistic, not ansi-correct, not bad-arg passing proof, implementation would be: void memset(void *x, int...
  20. pkiller

    feof problems

    use the return value from scanf, or else you might be caught on an infinite loop (if the format is not suitable to the scanf fmt string): for (;;) { lstptr = (INPUT*) malloc(sizeof(INPUT)); if (fscanf(textfile,&quot;%s %s %s %s&quot;, lstptr->field0, lstptr->field1...

Part and Inventory Search

Back
Top