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 wOOdy-Soft 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: wardy66
  • Content: Threads
  • Order by date
  1. wardy66

    XML Parsers - speed / performance and ease-of-use

    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>...
  2. wardy66

    Anyone know what changed in Perl 5.8 regarding command execution?

    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...
  3. wardy66

    Having an option to write to a file or STDOUT

    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...
  4. wardy66

    Should i &quot;use CGI&quot; for a simple HTML file output?

    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...
  5. wardy66

    How do read STDOUT and STDERR together

    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...
  6. wardy66

    A Way to Print all Variables in a Namespace

    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
  7. wardy66

    Quick way to parse 50,000+ line XML file

    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...
  8. wardy66

    Returning 2 values repetitively (as a list?)

    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 &quot;a=$a\tb=$b\n&quot; } 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...
  9. wardy66

    How to find out if an executable is in my path

    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 &quot;symdg not found in path&quot; return 1 fi I also want this stuff to work on NT/2000 :-( so the...
  10. wardy66

    Using data passed by reference to a subroutine

    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...
  11. wardy66

    How to handle a module not able to be located

    Hello all I wish to code some Perl scripts which can gracefully handle modules not being present. If I just do &quot;use xyz::abc&quot; 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...

Part and Inventory Search

Back
Top