Home > Cannot Use > Cannot Use An Undefined Value As A Hash Reference

Cannot Use An Undefined Value As A Hash Reference

share|improve this answer edited Aug 25 '14 at 6:28 Miller 31.1k42446 answered Aug 25 '14 at 2:14 Slade 1,1321515 excellent reverse engineering - this is part of a subroutine. Let’s talk:1-877-715-7676 Solutions Consulting Hosting Development Products Results Enterprise SMEs Startups Not For Profits About Profile People Expertise Clients Culture Other Blog Careers Developers Support Contact Gossamer Threads Inc. The identifiers you use should tell > you what the code is about. pve-monitor owner dpiquet commented Oct 1, 2014 Hi, I would need more info to help you.

else { $debugger->error("Option: $_ is not known. In some cases the graph rendering still works, because diskstats selects the first (and still complete) data set from the state file. Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed Powered by Trac 1.0.1 By Edgewall Software. I will need to install a test setup with that configuration so i can reproduce the bug and fix it.

The plugin runs on a hardware node (OpenVZ). Thanks in advance! Assuming it's database specific and ignoring."); } } $SQL .= "\n"; } } $SQL .= ");\n\n"; return $SQL; } else { $debugger->fatal_error("Action $action is unknown to get_mysql_SQL."); } } Dan Anderson I therefore prefer the approach I have used in the following code.

Compare our different Plugin packages *new* Free CSS Templates Previous ThreadNext ThreadPrint ThreadView Threaded Gossamer Threads is a Vancouver-based company with over 20 years experience in web technology. mbeenonic commented Apr 24, 2015 Hi same issue here on CentOS 5.11 (for all parameters, not only storages): perl /usr/lib64/nagios/plugins/pve-monitor.pl --conf /etc/nagios/pve-monitor.conf --storages Can't use an undefined value as a HASH This avoids the issue (for lines <4k of course). I'm totally lost, too.

There's a lot of things in the code which you can improve to make it more fail-safe, but for now: What line are you referring to? I am getting my last> element first.> Are you trying to re-order the sheets ? Scalar value @_[1] better written as $_[1] at ./pure_extend_database line 12. http://www.justskins.com/forums/help-with-error-message-72247.html I am, of course, using strict and warnings.

Why don't you tell us where it came from and what you are trying to achieve? How can I declare independence from the United States and start my own micro nation? Reload to refresh your session. So should > this: > > $SQL .= "CREATE TABLE $table_name\n"; > $SQL .= "(\n"; > while (my %hash = %{ shift (columns) }) { > $SQL .= " $hash{name} ";

kssupport commented Oct 2, 2014 HI, I execute the script with this command line : ./pve-monitor.pl --nodes --singlenode --conf /root/pve-monitor-master/pve-monitor.conf here is the kind of configuration file i use : node http://www.nntp.perl.org/group/perl.beginners/2006/07/msg85289.html There are > many challenges in programming that are more worthy of your efforts than > tracking braces. Lets look at some of the factors that make this difficult to debug: This: my options = { $hash{options} }; while ($_ = shift (options)) { if ($_ =~ m/not null/i) more hot questions question feed lang-perl about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

The @_ array is only useful inside of subroutines, where it contains the arguments that the subroutine is called with. Compare our different Plugin packages *new* Free CSS Templates Aug 14, 2010, 1:39 PM delicia Enthusiast (516 posts) Aug 14, 2010, 1:39 PM Post #3 of 4 Views: 4368 Shortcut Re: I agree with you completely Joseph, but I'd be grateful for just proper indentation and whitespace. Currently the code dies at argument parsing.

Copyright 2006 - 2014, JustSkins.com 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Here is a patch which simplifies the section and works around that problem: Index: plugins/lib/Munin/Plugin.pm =================================================================== --- plugins/lib/Munin/Plugin.pm (revision 4276) +++ plugins/lib/Munin/Plugin.pm (working copy) @@ -297,11 +297,10 @@ sub restore_state { Join them; it only takes a minute: Sign up perl can't use undefined value as HASH reference up vote 0 down vote favorite I am refactoring this script and I really But when I run the code I get the error "Can't Use an undefined value as a HASH reference" related to the code: $worksheet->Cells($current_row, $key)->{Value}=$hash{$key}; So in the loop it prints

Why not stick to the default delimiter and read the file line by line? This trap is waiting for me in some of my code. When it runs it generates this alert on Ubuntu Hardy 8.04.1: ./custom_plugins/notify_via_xmpp

Joseph Newton Guest November 13th,03:52 PM #7 Re: Help with Error Message: Can't use an undefined value as a hash reference R.

I was wondering if any guru could spot some > > There are many references , what line number does it say > is evil and which line below is that? Thanks in advance! Dan sub get_mysql_SQL { my $self = shift (_); my $line = shift (_); my $debugger = $self->{debugger}; if ($self->{info_mode}) { $debugger->warning("We've entered get_mysql_SQL"); } if (not $line) { $debugger->fatal_error("There was I was wondering if any guru could spot some newbie idiocy in my code.

when i'm ready to turn this database over to someone, i'm afraid they will constantly give admin permissions to new users, overwrite their own info, etc. node historyNode Type: perlquestion [id://937465]Approved by wwhelp Chatterbox? and all is quiet... It would be even nicer to know what this temporary thing > represents. Please see my Amazon Wish List GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)

asked 2 years ago viewed 3966 times active 2 years ago Upcoming Events 2016 Community Moderator Election ends Nov 22 Related 13How do I convert an array to a hash in I am, of course, using strict and warnings. > > Thanks in advance! > > Dan > > sub get_mysql_SQL { > my $self = shift (_); > my $line = When columns is empty, it returns undef, and you can't do %{ +undef }. As an aside, $row++ is more Perlish and less typing than your way, but your way works fine.

The keys are strings and therefore will be sorted in ASCIIbetical order, not numeric order. Programming should be about something. Why do languages require parenthesis around expressions when used with "if" and "while"? You set the key to the first value (the row), you need to set the key to the column value.

I changed one method signature and broke 25,000 other classes.

Back to Top