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...
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'...
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...
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...
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...
I wasn't sure where this really strange problem should best be raised, but as it's related to my Xubuntu laptop I thought I'd start here.
I have an XP laptop (supplied by my employer) that I use to connect to their network via VPN when I'm out of the office. This works fine where ever I connect...
I have just installed RHEL 5 for the first time on a new machine. Having used the 'Automatic Partitioning' option during installation I have been surprised to discover upon completion that other than the swap partition (LogVol00) it has allocated all the remaining disc space (1.6 terabytes) to a...
Happy New Year to one and all. I was working on this problem last year and still haven't managed to resolve it. Can anyone here suggest a possible solution?
I'm currently producing an automated build deployment tool for the developers I support. This will allow them to produce a release...
Can anyone help me make this script recursive? It's defeating my limited scripting ability so far.
I'm trying to get a directory listing out of an informix database (note, this is not an actual file structure so I can't just glob the files or do a 'dir' etc).
The following code does give me...
Can anyone come up with any ideas for adressing this issue? I've been asked to produce some figures from my Change Request database, including how many Change Requests went through peer review but subsequently failed testing, and this one has me stumped. I have pulled out the raw data, thus...
If I have got a list containing lots of duplicated entries that I want to remove I often use
while (<DATA>) {
chomp;
$line=$_;
$seen{$line}++;
}
@unique = keys %seen;
foreach $entry(@unique) {
print "$entry\n";
}
This is quick, short and easy.
However, what if I want to remove the...
Morning all. I have some data analysis to do and don't want to reinvent the wheel so I thought I would ask to see if anyone knows of any existing module(s) that can do all or part of the job.
I have a large list consisting of a task name(type), with its corresponding start date/time and end...
I am having difficulty accessing the lowest elements of this data structure:
$VAR1 = {
'MoveCompletedEndsBack' => '0',
'NewTasksEstimated' => '1',
'Resources' => {
'Resource' => [
{...
In an effort to answer a serious question about the usage of some of the data in one of the databases I administer I have used perl to pull out almost 37,000 lines of information and have manipulated those lines to remove non-essential information. What I am now left with looks like this...
Hello again, I have several lines of data that I am reading into a hash, as per the code below. I would like to print out only those lines where the key is duplicated. The key, in this case, is the data in the first TWO columns on each line (for example '310715 W'):
#!/usr/bin/perl
use strict...
Has anyone had experience of installing XML::Parser with perl 5.10.0? I am having no joy with it at all.
XMP::Parser requires expat to be installed first. I have done this successfully (at least it did not throw up any errors).
I then create the XML::Parser makefile with:
Makefile.PL...
I have a shell script to modify that was produced by a.n.other. If it was perl I could do it with no problems, but my shell scripting knowledge is not up to the task. I think I'll need to use awk, hence this posting.
I have a directory, the top few entries in it being subdirectories called...
Can anyone point me to a module that will enable me to uninstall a Windows NT application using perl? The app in question installs from an msi but refuses to uninstall except through the add/remove software feature in the control panel (i.e. it won't uninstall from the commandline using msiexec...
Can someone assist me with getting the correct syntax to sort this array please? I've tried all sorts and searched past threads but have not found the right answer.
I have a very complex and lengthy script that queries a database and eventually ends up with me having data in this format (this...
This is entirely an academic question. A guy asked me if it was possible to produce a regex to find duplicate words in a sentence. "Easy" I said......and I've now spent about 3 hours getting nowhere!
Can anyone help?
Using this sentence:
this is some text with some duplicate words this is
We...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.