My explanation was maybe not accurate. (english is not my mother tongue sorry)
Of course, I always use the pragma strict and warnings
I must admit that I did not know -c but fortunatly my syntax is correct :)
However your are right, I misunderstood something. let me just explain why, because I would not like that you keep in mind a wrong opinion.
With
$structure->[$j] I got an error message
Global symbol "$struture" requires explicit package name
I know what I mean. I have to declare a variable with "my".
I did not understand why because I thougt that
$structure->[$j] was declared with
my @structure exactly like when you declare
@array, you don't need to declare
$arrray for using
$arrray[$i].
With
@structure->[$j], I got a message explaning that it is deprecated but at the ends it was working.
ok so my code is
my @statement;
...
my @structure;
foreach (@statement)
{
...
push @structure , [];
for (my $i=0;$i<= $#ex; $i++) {
push @{ $structure->[$j]}, $ex[$i];
}
}
but for the moment I have still this error.
I will be more rigourous before asking another question
thanks
edit: it works with
$structure[$j].
There is sometimes some things which look like strange but I know that strange behaviour of perl come from the misunderstanding of the programmer :)
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.