Hi
cleen. A few things, though I may not be able to
provide you with the final answer you need:
my $id = @_;
sets
$id to the number of elements in
@_
So you should do one of these things to do what you want:
my ($id) = @_;
my $id = $_[0];
my $id = shift;
The other thing is why did you use a typeglob to define that sub
instead of simply doing
sub do_something {
...
}
It would've done the same thing with less
added syntax...
Then you state:
It works great the FIRST time you press the menu item "view configuration", but after that all my
references seem to be overwritten or just have disappeared so If I select another menu item I dont get the elsif
it just doesnt do anything.
do this:
$subref = \&do_something;
And then print $subref before and after you think it
has disappeared.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.