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

  • Users: naq2
  • Order by date
  1. naq2

    newbie - multiline substitution

    rhash, when you're talking about me removing a lot of inapropriate text, you must be talking about the first .* (the one before somestring). I thought the same as you, but preferawk put it in coz he had it in his first regex that was working... so... If it is not this that you're talking...
  2. naq2

    newbie - multiline substitution

    OUPS! NO SPACE BEFORE THE ';' IN THE REGEX! SORRY!
  3. naq2

    newbie - multiline substitution

    ok, here is an answer to both your questions: to be able to recognise on more than one line, you have to use the /s modifier... it looks stupid, but it's like this! $contents =~ s/.*somestring.* ;//sg; For your second question, you have to use a NON-GREEDY operator so it will only match what...
  4. naq2

    HASH INITIALISATION

    doh! I didn't though about this one! :)
  5. naq2

    Help don't know perl

    I'm sorry, but we don't have enough information with what you send us... But I would say that: $in{to} correspond to the fourth input tag. It has 'april' as a value. if($alias{$in{to}}) tests if there is a value corresponding to $in{to} ('april') in the $alias varible (the %alias hash to be...
  6. naq2

    HASH INITIALISATION

    euh... yes! great idea! :) but I'm in a very theoretical mood... I've just writen a 2000 lines program on paper... I'll start typing soon! lol! Thanks anyway.
  7. naq2

    HASH INITIALISATION

    ok... thanks a lot for this explanation. Just one more question: Do I really need this line: $myHash{anyArray} = []; Thanks again.
  8. naq2

    HASH INITIALISATION

    OK... In the same idea... if I want to add a new array in a hash... can I use the same thing? my %myHash ; push(@myHash{anyArray}, "NEW ELEMENT") ; And if it doesn't work (coz it seams not to work... I get a compilation error), how should I do something like this? Thanks for your help.
  9. naq2

    HASH INITIALISATION

    Ok... This was only an example of my question... so the answer is YES... it should initialise the value correctly. Thanks.
  10. naq2

    HASH INITIALISATION

    A very simple question for you guys, expert of hashes: Can I do that? (I mean... will it work?) my %myHash ; $myHast{toto}{tata} = "DID YOU SEE THIS?!" ; print $myHast{toto}{tata} ; #will this print 'DID YOU SEE THIS?' or do I have to initialise the hash in some other way? Thanks for your help.
  11. naq2

    Adding duplicate rows to existing records

    Try this: my @inArray, @outArray ; open(IN, '<yourfile.txt') ; @inArray = <IN> ; close(IN) ; foreach my $tmpLine (@inArray) { my ($id, $name, $att, $yesno) = ($tmpLine =~ m!(.+),(.+),(.+),(Y|N)!i) ; push(@outArray, $tmpLine) ; if ($yesno eq "Y") { push(@outArray...
  12. naq2

    Pad filed zeros and concatenate two fileds as one

    simply lol! :)
  13. naq2

    SIZE OF IMAGES

    I think I saw something about knowing the size of an image some time before on this forum but... I saw somewhere - maybe here... I can't remember - a way of knowing the size of an image without downloading the whole image (by downloading only the header of these). Concretly... I give an URL of...
  14. naq2

    print .txt file

    For you info... if you need to pring all the elements of an array... you don't need to do a foreach... # THIS WORKS! open(IN, "<myfile.txt") ; # '<' meaning "open for reading!" my @tmpArray = <IN> ; print @tmpArray ; close(IN) ; Just to complete everything that has been said!
  15. naq2

    Alpha-Numeric

    Try: if ($myString =~ m/^\w+$/i) { #IF THE STRING IS ALPHA-NUMERIC } else { #IF THE STRING IS NOT ALPHA-NUMERIC } (this consider the character '_' being alphanumeric). If you don't want this character: if ($myString =~ m/^[a-zA-Z0-9]+$/i) { #IF THE STRING IS ALPHA-NUMERIC } else {...
  16. naq2

    Opening a file in READ/WRITE format

    Ok, thanks... This is what I would have probably thought if I had the idea clear... that is not the case today. Thanks again.
  17. naq2

    Opening a file in READ/WRITE format

    I'm don't really know how to open for readding and writing at the same time... Usually, I used to open it in "append" mode and it was fine for me. What I exactly want to do is: Replace the $i line without altering the lines before and lines after. If you have any simple way of doing so...
  18. naq2

    Reference to an anonymous hash

    The answer is: $rHash = {"key1" => 'val1', "key2" => 'val2, "key3", 'val3'} ; Simply! Thanks for my help! :)
  19. naq2

    Reference to an anonymous hash

    How to write a reference to an anonymous hash? For an array, it would be: $rArray = \(1, 2, 3, 4) ; Thanks for you help.
  20. naq2

    posting data with an HTTP redirection

    I simply can't use such a solution, because the output is not going to a web browser. :S

Part and Inventory Search

Back
Top