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 Andrzejek 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. tonykent

    sort by hash key before printing

    Up until recently the data files always contained departures in time order, starting with the earliest in the day, so my manipulation always resulted in data which happened to be in time order. Just recently a few of them have contained data in which the departures are listed in any old order...
  2. tonykent

    sort by hash key before printing

    Hi again Feherke, Mmmm. I suspect my use of your code got more elaborate than I remembered. Here's a couple of actual bits of data I am printing out (the full file has about 20 such entries): $VAR1 = [ { 'JourneyCode' => 'JC1402'...
  3. tonykent

    sort by hash key before printing

    Last year feherke kindly helped me resolve a problem with printing a complex data structure. I have found the resultant script enormously helpful since then. An influx of work since the corona lockdown has left me with a need to slightly modify the print routine. I have received a number of data...
  4. tonykent

    Assistance with printing complex data structure

    That works fine, so I am now all systems go. Thanks again, I really appreciate the help.
  5. tonykent

    Assistance with printing complex data structure

    Good morning feherke, to overcome the ordering/bless issues I have changed the construction of my data structure to use an array, so I now have this: $VAR1 = { 'DepartureTime' => '05:53:00', 'PrivateCode' => '4483928', 'VehicleJourneyTimingLinkRefOrder' => [...
  6. tonykent

    Assistance with printing complex data structure

    Hi feherke, your script runs fine. My code doesn't [mad] : tie %hash, 'Tie::IxHash'; tie %VehicleJourneyTimingLinkRef, 'Tie::IxHash'; foreach my $VehicleJourneys ($dom->findnodes('//VehicleJourneys/VehicleJourney')) { #create hash $PrivateCode=$VehicleJourneys->findvalue('./PrivateCode')...
  7. tonykent

    Assistance with printing complex data structure

    That's giving me: Can't call method "Keys" on unblessed reference at myscript.pl line 118.
  8. tonykent

    Assistance with printing complex data structure

    I should have added that the order of the records in %hash is correct at that point because I used Tie::IxHash to maintain the order. I tried the same for %VehicleJourneyTimingLinkRef but that did not work for some reason.
  9. tonykent

    Assistance with printing complex data structure

    Hi feherke, I have discovered that I need to print out the VehicleJourneyTimingLinkRef's in a specific order. For the 2 records I showed above, they have to be printed out in the order shown in VehicleJourneyTimingLinkRefOrder below: $VAR1 = { 'PrivateCode' => '4483928'...
  10. tonykent

    Assistance with printing complex data structure

    Hi again feherke. That works nicely. Thank you once again!
  11. tonykent

    Assistance with printing complex data structure

    Given this data structure, can anyone help me print it out in the format shown below? $VAR1 = { 'DepartureTime' => '05:53:00', 'PrivateCode' => '4483928', 'VehicleJourneyTimingLinkRef' => { '7' => 'PT1M16S'...
  12. tonykent

    Split long string into hash pairs

    Thanks again feherke, that works superbly. I will look to see if I can get the data out in a better format.
  13. tonykent

    Split long string into hash pairs

    It transpires that a very few of the keys have 2 associated time values. Among the thousands of lines I had not noticed this.
  14. tonykent

    Split long string into hash pairs

    Hi Ferherke, good to see that you are still around! Thanks for pointing that out. I've got thousands of these lines, to the point that I've just about gone word blind and I had not spotted the missing keys (despite the warning). I will take a look at the original xml and see what is going on...
  15. tonykent

    Split long string into hash pairs

    After a long time away from perl I have found myself in a new job where I need to use it again (to manipulate lots of xml files). Hello again! My problem: After some data extraction with XML::LibXML I am getting long strings of text returned, like this: 4541 PT1M27S 4542 PT1M51S 4543 PT2M16S...
  16. tonykent

    Use of uninitialized value in string

    Many thanks PNB, I will incorporate your code this morning.
  17. tonykent

    Use of uninitialized value in string

    It's been a while but I'm hoping one of you helpful guys can help me out again. I'm trying to debug a 3000 line script written by a.n.other. When run it is throwing up dozens of warnings like this one: Use of uninitialized value in string ne at ./ccrscript line 1528 The section of the script...
  18. tonykent

    30,000 pigs

    Shortly after sitting through 'The Jungle Book' video with my 3 year old nephew I heard him singing "those bear necessities, forget about your worries and your stripes".
  19. tonykent

    makefile question

    Can anyone tell me why this gmake makefile works: LIST1 := `ls` # inside a rule: first line starts with a TAB, all the rest are spaces all: @for x in `ls`; do echo $$x ; done outputs: check.txt inc.mk makefile subdir but when I try to replace the 'ls' command with the...
  20. tonykent

    I wasn't sure where this really str

    The error mesage states: An error occurred: connection to host xxx.xxx.xxx.xxx::5901 was closed.

Part and Inventory Search

Back
Top