RE: More on Gtk2

2005-09-22 Thread Matthew Ryan
Title: More on Gtk2









 

Greg wrote:

Ok, so I moved on to another problem with my Gtk2
script.  This time I'm trying to use Simplemenu.pm to build simpler menus.
By now I've wasted more time than I've saved, but there is a lesson in here
somewhere!

I get an error that says:  Can't use an
undefined value as an ARRAY reference at C:/Perl/site/lib/Gtk2/SimpleMenu.pm
line 99.

The relevant code is below (look between the ##
for the real details).  I assume it has to do with how the variable is
referenced, but am somewhat ignorant of this in Perl.

(For those who care, I'm modifying NagiosWatch to run
on Win32 & use Gtk2) 

As always, thanks for the help. 

I think you just need to change item to children in your menu
tree.

I looked at the SimpleMenu.pm, and it calls for itms->{children}
on line 99 , not items. I don’t have Gtk2 on my machine so this is
untested.

# 99 for( $i = 0; $i < scalar(@{$itms->{children}}); $i
+= 2)

###

$menu_tree
= [ 
    _File  => { 
   
    item_type  =>
'', 
   
    children => [ 
   
   
    _New  
=> { 
   
   
   
    callback => \&m_File_Exit,

   
   
   
    callback_action => $action++,

   
   
    }, 

   
   
    _Exit 
=> { 
   
   
   
    callback => \&m_File_Exit,

   
   
   
    callback_action => $action++,

   
   
    }, 
   
    ], 
    } 
];









___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regex

2005-09-20 Thread Matthew Ryan
David wrote:

>I thought this was working, but my logs just showed a case where it seems
>not to do what I want.
>Why does:
>$OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ;
>Not become true when $body contains:
>Library Card: 0240742

>Just possibly there's some dodgy html or something in the original that
>doen't make it through to my logs, but right now I'm perplexed

Is there a chance that 'Library Card: 0240742' comes at the end of the file?
Or that you used chomp on the variable $body?
The \D at the end of the regular expression would not work if there wasn't a
nondigit at the end of the line.



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs