Hi all
I'm trying to parse an XML file that looks like:
<?xml version="1.0" standalone="yes" ?>
<abc>
<def>
<ghi>
<jkl>information</jkl>
</ghi>
<important>
<data>
<info1>info 1</info1>
<info2>info 2</info2>
</data>
<data>...
Hi all.
I have written a script that runs another Perl script via:
open CMD, "$command |";
$command will equal, e.g., (with the double quotes)
"perl" "C:\Documents and Settings\wardmm\My Documents\cygwin\home\wardmm\perl\symdg-detail.pl"
Running under Perl 5.8 it works fine. Perl 5.6...
Hi all
I'm trying to think of the best way to write a script that can either output to a file or to STDOUT if no file name is supplied.
For example,
script.pl -o file.txt
would send the output to a file but
script.pl
would just print to the screen.
Inside script.pl I was thinking of...
Hi all
Just a "style" question.
CGI is a standard module and appears to be a bit of an easy way to write HTML.
So, rather than:
print "<h1>Heading</h1>\n";
I can just:
[code]print h1("Heading");[\code]
which seems a little less low-level.
Is this what people normally do? Please note, this...
Hello
I have a (hopefully) small problem reading output from a command that throws off both STDOUT and STDERR. When run on the terminal, these two files are interspersed correctly.
The output takes the form of:
STDOUT blah blah blah
STDOUT processing file2
STDERR processing failed...
Hello all
I want to be able to find out which variables have been defined in a namespace.
For example,
package XYZ;
$x = 10;
$y = 12;
$z = 20;
package ABC;
# Something goes here that can find everything under XYZ::
Thanks in advance
Hello all
I've written a Perl script using XML::Simple to parse an XML file generated from a program running under a UNIX line command.
The file is over 50K lines longs and I need to parse 2 of them.
The problem is the time required. It is taking around 15 minutes just to convert the XML...
Hello. I wish to write a function that returns two values and can be used in a while loop or similar.
For example:
while( ($a, $b) = myfunc() ) {
print "a=$a\tb=$b\n"
}
And this would print, eg,
a=1 b=2
a=6 b=9
a=1 b=10
until the function decided it had returned enough...
Hello all
I am converting some old shell scripts into Perl (yay!) and have come up with a small snag.
The old UNIX scripts do things like
if ! whence symdg > /dev/null; then
echo "symdg not found in path"
return 1
fi
I also want this stuff to work on NT/2000 :-( so the...
Hello - me again....
Take this example code:
my @array = (1, 2, 3);
pass_array( \@array );
sub pass_array ($) {
my $aref = shift;
$$aref[1]++
}
This should work and add one to element [1] in the array @array.
My question is, how can I write my subs more legibly by being able to do...
Hello all
I wish to code some Perl scripts which can gracefully handle modules not being present.
If I just do "use xyz::abc" the script fails compilation. I need to be able to test if a subroutine exists (use defined, I suppose) and if not, just have a guess.
use...
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.