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: *

  • Users: Zhris
  • Order by date
  1. Zhris

    Complicated data structure having problem to filter fields need urgent help - Thanks

    Crosspost: http://perlguru.com/gforum.cgi?post=76781;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread.
  2. Zhris

    searchable pdf / word docs

    Hi, I would consider utilizing Solr. http://en.wikipedia.org/wiki/Apache_Solr http://wiki.apache.org/solr/ExtractingRequestHandler http://tika.apache.org/ Chris
  3. Zhris

    Find if Hash Value exists in Hash of Arrays

    #!/usr/bin/perl use strict; use warnings FATAL => qw/ all /; use List::MoreUtils qw/ any /; use Data::Dumper; # construct hash my %hash; push @{$hash{key1}}, $_ for ( 1 .. 4 ); push @{$hash{key2}}, $_ for ( 5 .. 9 ); # process hash my $var1 = 1; while ( my ( $key, $list ) = ( each %hash ) ) {...
  4. Zhris

    How to run perl code from anywhere

    Hi, As 1DMF states, one way or another the script will need to decifer the full path to the lib directory. I personally create a custom environment variable named LIB (this can be described in setup instructions). Therefore I can then do the following in my scripts: use lib $ENV{LIB} // die...
  5. Zhris

    How to run perl code from anywhere

    Try using the fullpath to lib: use lib "/tmp/perl/lib"; use utils; Chris
  6. Zhris

    Paypal IPN Script Stopped Working After 2 Years

    Very interesting to hear that you guys have experienced similar issues to myself on a shared server. Modules have gone missing in the past and I have been told it must be a bug in my script. These were very stressful times. With regards to MIME::Lite, it is suggested in the documentation that...
  7. Zhris

    reading an xml file with GGI::Simple, with nested name/value pairs...

    Hi, With this in mind, I might suggest XML::Simple ( http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm ), simply because it will parse any XML structure into a Perl data structure from a single method call. However, it will likely require some fiddling around with the options...
  8. Zhris

    how to pull name value pairs from an array variable...

    @feherke, Thanks alot for the information regarding keys. Chris
  9. Zhris

    how to pull name value pairs from an array variable...

    Hi, @spewn: You are describing "references". The Perl docs explain references well ( http://perldoc.perl.org/perlref.html ). With regards to counting, i'm interested in your approach which resulted in a value of 1 being returned. A reference in scalar context is simply a string representing...
  10. Zhris

    Use of uninitialized value in substitution (s///) error

    Update to suit your requirements: #! /usr/bin/perl use strict; use warnings; use IO::File; use Text::CSV; use XML::Writer; my $groups_node = 'RESULT'; my $group_node = 'item'; my ($csv_input_path, $xml_output_path) = @ARGV; ########## # create objects. my $xml_output_fh = IO::File->new(...
  11. Zhris

    Use of uninitialized value in substitution (s///) error

    Last thing, I hadn't read your prints properly, and noticed you are indeed making use of @fields, therefore ignore my comments regarding. My example generates XML in the same format you desire (although no sorting). Chris
  12. Zhris

    Use of uninitialized value in substitution (s///) error

    I had nothing better to do therefore thought I would write an example :-D. Depending on the situation, my usual preference is to use Template Toolkit to generate XML / handle i.e. escaping myself, but XML Writer does the job here. #! /usr/bin/perl use strict; use warnings; use IO::File; use...
  13. Zhris

    Use of uninitialized value in substitution (s///) error

    Hey, Your code needs some critical adjustments. The key issue you identified is caused by the fact that you are passing an undefined value to the trim() function. The codes current logic suggests that it would be impossible for a defined value ever to be passed to the trim() function. While...
  14. Zhris

    perl-minimum & maximum value

    * A better way around this would be to also assign pos1 if $group->{$label}->{pos1} is undefined / remove the initial assignment altogether:
  15. Zhris

    perl-minimum & maximum value

    Hi, Your issue isn't entirely clear: - Where are the values of 10000 and 100000 coming from. Even then, there is nothing in your code to cause issues around these specific values. - Specifically, what is the "error in printing minimum value". However, I believe the following could potentially...
  16. Zhris

    Getting Text off of a Website

    I would probably make use of HTML::TableExtract to break the html up before considering using other methods i.e. regexes to extract the specific elements. An alternative or combo would be to use HTML::TreeBuilder / HTML::Element which have html lookdown and address methods. From the supplied...
  17. Zhris

    Var 11 auto converted to 13

    Hi vacunita, Thanks alot, that did the trick. Chris
  18. Zhris

    Var 11 auto converted to 13

    Last update. Looks like its to do with my method of using the 'or' operator to ensure the value defaults to "12". My question is then, how do I set a default value in one line. Thanks, Chris
  19. Zhris

    Var 11 auto converted to 13

    Quick update. I'm getting varying results typing different numbers in as the value. Absolutely no idea why.
  20. Zhris

    Var 11 auto converted to 13

    Hello, Every time I use a query param with the value 11 or 2011, its automatically converted to 13 or 2013. In fact anything below 12 or 2012 is converted. Example: // /test.php?Year=11 <?php $year = $_GET['Year'] | '12'; echo "$year"; ?> I'm assuming its recognizing that the value is a...

Part and Inventory Search

Back
Top