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 SkipVought 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. missbarbell

    Argument Checker

    I think you mean options with multiple values [1], rather than positional parameters. In particular look at the examples for --coordinates and --rgbcolor. [1] http://search.cpan.org/dist/Getopt-Long/lib/Getopt/Long.pm#Options_with_multiple_values Barbie Leader of Birmingham Perl Mongers...
  2. missbarbell

    How to call a method with arguments via eval ?

    Hopefully the following will clarify what you want: #!/usr/bin/perl -w use strict; my $string = '(<arg1> || <arg2> && (<arg3>))'; $string =~ s/<(.*?)>/check_arg($1)/g; # global string replace print "$string\n"; # prints '(check_arg(arg1) || check_arg(arg2) && (check_arg(arg3)))' $string =...
  3. missbarbell

    How to call a method with arguments via eval ?

    Take a look at the perldoc page for eval [1]. There is a difference between an expression and a block form of eval. You are using the expression form, but really want the block form. [1] http://perldoc.perl.org/functions/eval.html my $firstname='Robert'; eval { sub {get_lastname($firstname);}...
  4. missbarbell

    How to call a method with arguments via eval ?

    You're misunderstanding what eval does. eval returns a result, however what you are after is a code-ref: my $coderef = sub { print }; &$coderef; # this executes the code eval { &$coderef }; # this executes the code safely See perlref [1] for further details. [1]...
  5. missbarbell

    creating dir with spaces via `system call`

    Any reason why you're not using the Perl core module, File::Path [1] and its mkpath() function? It gives you a lot more control over the directory creation. #!/usr/bin/perl -w use strict; use File::Path; my $dir='C:\Documents and Settings'; mkpath($dir); [1]...
  6. missbarbell

    How to get perl date time down to milliseconds ?

    Have a look at Time::HiRes [1], that can go down to nanoseconds. [1] http://search.cpan.org/dist/Time-HiRes/HiRes.pm Barbie Leader of Birmingham Perl Mongers http://birmingham.pm.org
  7. missbarbell

    Sending Email from CGI Perl Script to MS Outlook

    Please note that 'XHeaders' are not supported by MS Outlook. As to your problem, is this other script running from a CGI script? If so then the user that you are trying to access MS Outlook with may not be the same user as that for the command line script. MS Outlook is very temperamental when...
  8. missbarbell

    Argument Checker

    I personally use Getopt::Long [1], which offers a lot more flexibility. [1] http://search.cpan.org/dist/Getopt-Long/lib/Getopt/Long.pm Barbie Leader of Birmingham Perl Mongers http://birmingham.pm.org
  9. missbarbell

    Charset

    I think this is one of those times you are falling foul of the Unicode problem. If you are using anything before Perl 5.8, you'll need to use the utf8 module (1) (1) http://search.cpan.org/~nwclark/perl-5.8.6/lib/utf8.pm If you're able to upgrade to 5.8.4 or higher, then the Unicode support is...
  10. missbarbell

    How to open an existing excel file using Win32::Ole

    dmazzini, you point out some very good reasons for and against, for which you get a *. However, the Spreadsheet modules were never written to complement the full Excel experience. If you wanted to be able to read fomulas, then you either use Excel, or rewrite the VBA engine (which isn't really...
  11. missbarbell

    How to open an existing excel file using Win32::Ole

    The original poster was also the one that posted today too ;-) Just because someone mentions they are having trouble with a particular module, doesn't mean they can't be told another way. Especially if it gives them another avenue to think about in the future. The code he posted today works...
  12. missbarbell

    How to open an existing excel file using Win32::Ole

    I am really surprised no-one has pointed you at the following great modules: 1) Spreadsheet::ParseExcel 2) Spreadsheet::TieExcel 3) Spreadsheet::WriteExcel These are much easier to use than relying on the Win32::OLE module. The latter is actually used by Vodafone to create Excel binaries on...
  13. missbarbell

    use strict and warnings problems

    mike, you are quite right. That's what comes of thinking aloud and not testing. Bad Barbie, no biscuit! However, you're solution of check for adjacent commas is probably the simplest of the lot :-) Regarding warnings and strictures. If you talk to most experienced Perl programmers, particularly...
  14. missbarbell

    libxml2 anyone?

    What version of Perl are you running? It sounds like the version you have isn't compatible with the PPD files that your copy of PPM has found. It might be worth adding a few extra repositories. For this try the following scripts I usually use. The first (ppm-install1.pl) installs the...
  15. missbarbell

    use strict and warnings problems

    That won't work, if you assign a value, then override it with undef, it'll still be undef. You'll want something like: foreach $dev (@device) { my @fields = split (/,/, $dev); my $log_name = $fields[0] || next; my $type = $fields[1] || next; my $uis_fstatus...
  16. missbarbell

    ActivePerl browser interface

    Aarem, have a look at faq219-3559, which will explain how to set up IIS to access your scripts. You'll need to use the CGI module to get best use out of the CGI interface. Or as others have said you could always use Apache, which although a bit dauting to begin with, offers a lot more...
  17. missbarbell

    libxml2 anyone?

    Be warned you need to ensure you get the correct libraries and Perl distributions that are compatible. I had a terrible time getting them work when they upgraded their compiler about a year ago. XML::LibXML has already been upgraded to use the latest xmllib2 libraries. You can get a Windows...
  18. missbarbell

    use strict and warnings problems

    You can set up default values, then read in the file and override them. If you can give an example of how you're reading the values into the array or hash, then we can give you some ideas. Barbie Leader of Birmingham Perl Mongers http://birmingham.pm.org
  19. missbarbell

    Passing variable values to shell from perl

    Ah, I see a light .... it took a while, but I finally spotted it: This: $shell_in = <<'IN'; Should be: $shell_in = <<"IN"; The single quotes around the IN prevent interpolation on any variable like strings inside. Barbie Leader of Birmingham Perl Mongers http://birmingham.pm.org
  20. missbarbell

    &quot;THEY&quot; want a GUI - any suggestions?

    You may want to think about providing Web Services for the perl output. In this case you may be able to get an off-the-shelf package that can interface with the output and present it using a templating system which you can customise. I recommend reading Programming Web Services with Perl, if...

Part and Inventory Search

Back
Top