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 SkipVought 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: blues77
  • Order by date
  1. blues77

    Writes to frile not being committed

    Yeah you are right. Thanks for the suggestions and you're help!
  2. blues77

    Writes to frile not being committed

    I figured it out. I needed to put a > before the filename when opening it.
  3. blues77

    Writes to frile not being committed

    Yeah it's not writing to the file. I added the text "This is a test" to the labels.txt file and ran the script, which should have overwritten the contents of the file but the text I entered is still there.
  4. blues77

    Writes to frile not being committed

    Hello, I'm trying to write to some text files but it doesn't appear to be writing to the files UNLESS I use the >> operator (append operator) when opening the file. Can anyone tell me what is going on? Below is my code which writes fine when I use the >> operator. If I remove it though...
  5. blues77

    Regular expressions

    Thanks for your help rhash. I tried your regular exression alone and it works fine however when I use your expression in my code I'm still having the same problme. Here is my code. Any ideas on why this isn't working? I'm very perplexed. use strict; open(SOURCE, $ARGV[0]); open(LABELS...
  6. blues77

    Regular expressions

    I wish it did. But it should be assigning the string V01TPRL_RLT_CLT to the $2 variable but what I'm getting when I print out this variable is TPRFL_RLT_CLT. It's missing the V01.
  7. blues77

    Regular expressions

    Hello, I'm having a little trouble creating a regular expression to extract some information from a string. Given the string Column : Indv Clt Id ("COMP"."V01TPRFL_RLT_CLT""INDV_CLT_ID") I want to extract the portions Indv Clt Id V01TPRL_RLT_CLT INDV_CLT_ID At the moment my regular...
  8. blues77

    Lost among hashes of arrays

    Yeah that does help. So using this technique if later I encounter the same key with the same value when it tries to add the key with the code $hash{$2}{$3} = 1; nothing wil be added because the value already exists. Is this correct? This is a nice little trick thanks!
  9. blues77

    Help! Hash of arries can only hold done value per key

    It's working perfect now. Thanks to all of youu for all your help. Here is the final code. Feel free to make any suggestions on how to make things more efficient. Thank you! #use strict; #print "$ARGV[0]"; open(MY_FILE1,$ARGV[0]); open(OUTPUT, ">>output.txt"); while(<MY_FILE1>) {...
  10. blues77

    Help! Hash of arries can only hold done value per key

    That's exactly what I'm trying to do. I tried your suggestion but I'm stillonly getting one value per key/value pair in the hash. Once the ky in the hash has a value stored any subsequent value with the same key designation will not be entered into the hash becuase i think it's being caught by...
  11. blues77

    Help! Hash of arries can only hold done value per key

    Can anyone tell me from looking at the code below why I'm only able to have one value per key in the hash despite using a hash of arrys. Below is my code. Any suggestions are appreciated. It seems from what I can tell that the code doesn't enter the part elsif (exists $hash{$2})...
  12. blues77

    Lost among hashes of arrays

    I noticed another strange behavior. in the code if($line2 =~ /^($line1)\s+CAAS.+\.([^.]+)\.([^.]+)/ ) { $flag = 1; if (exists $hash{$2}[$3] ) { print "key value pair already exists for elemetn $line1\n"; #do nothing } elsif (exists $hash{$2}) {...
  13. blues77

    Lost among hashes of arrays

    Ok here is what I have now but it still doesn't appear to be adding more than one value for a particular key. [cod] if($line2 =~ /^($line1)\s+CAAS.+\.([^.]+)\.([^.]+)/ ) { $flag = 1; if (exists $hash{$2}[$3] ) { #do nothing } elsif (exists $hash{$2}) {...
  14. blues77

    Lost among hashes of arrays

    The exists function you suggested looks like it will only check for the existance of the key in the hash. Will this also check for the existance of a key/value pair even when a key may have multiple values since I will be using a hash of arrays.
  15. blues77

    Lost among hashes of arrays

    Hi thanks for the tips. I understand what you're saying. The reason why I did it that way was becuase I'm reading my values from a text file that might look like this. abc keyA.12 efg keyB.17 abc keyA.12 abc KeyA.22 The string abc in this example appears twice. The...
  16. blues77

    Lost among hashes of arrays

    Ok I'm having absolutely no luck trying to get this hash of array thing to work. As you can see, from the code below, I've tried several different ways to try and input several values for a specific key, if the $keyExists == 1 and $valueExists == 0 conditions are met. I thought it might be...
  17. blues77

    Add a another value to a key in a hash

    Ok I've made some more modifications and the error I was getting is gone but has been replaced by. Bareword "search" not allowed while "strict subs" in use at extract_label.pl line 102. Execution of extract_label.pl aborted due to compilation errors. I changed how the hash should be printing...
  18. blues77

    Add a another value to a key in a hash

    Humm I tired what you sugested and I'm getting the error Can't use string ("SIN_TTN") as an ARRAY ref while "strict refs" in use at extract_label.pl line 49, In this case SIN_TTN is suuposted to be a value that I want to add under once of the existing keys that already contains values. Anyways...
  19. blues77

    Add a another value to a key in a hash

    How is that done?
  20. blues77

    Add a another value to a key in a hash

    Hello, Right now I have a hash with keys that have values but if I want to add another value to the hash key it overwrites the value already stored there. Is there anyway to make it so that I can store more than one value for a particular key? Below is the code that I have currently...

Part and Inventory Search

Back
Top