Sorry to interrupt your tonsure creating dear monks but some advice please. It appears that Perl has adapted itself and has thrown our system's operation, established during a small routine change to our code.

The code creates several data types from definitions in a package, and stores them as a series of joined records - so one record holds the data pointer of another etc. (I have simplified the code to show you below) (It was so much easier to use address manipulations in 'C' but Perl's list manipulation was one of the original reasons why we went with Perl over 'C'). The trouble is that the code that was working before has now seemingly been banned as being anti- the Perl Spanish Inquisition's latest thinking on purity. Obviously a code rewrite/redesign is *not* desired at this stage so is there a better/newer/easier way of simply pushing the element onto the list held by the 'root' structure?

The error being given is:

Experimental push on scalar is now forbidden at C:\crap\adbtest.pl line 40, near "$rohan1;"

Experimental push on scalar is now forbidden at C:\Users\Alan\Documents\crap\adbtest.pl line 46, near "$rohan4;" Many thanks - ADB

Package/data sources package rohanType1; sub new { my $self = {}; # Discard the class name shift; $self->{'field11'} = undef; bless ($self); return $self; } return 1; package rohanType2; sub new { my $self = {}; shift; $self->{'field21'} = 0; bless ($self); return $self; } return 1; package rohanType3; sub new { my $self = {}; shift; # Pointer to rohanType1 $self->{'field31'} = undef; # Pointer to rohanType2 $self->{'field32'} = undef; bless ($self); return $self; } return 1; # Now the data structures used globally to store information used by t +he whole analysis, which holds # data types as defined above package rohanData; sub new { my $self = (); shift; $self->{'rohan1'} = undef; $self->{'rohan2'} = (); bless ($self); return $self; } return 1; ======================= Code my $rohanRoot; my $rohan1; my $rohan2; my $rohan3; my $rohan4; $rohanRoot = rohanData->new(); $rohan1 = rohanType1->new(); $rohan2 = rohanType2->new(); $rohan1->{'field11'} = $rohan2; $rohanRoot->{'rohan1'} = $rohan1; # my debug helper to see if add +resses are correct - not part of code push $rohanRoot->{'rohan2'}, $rohan1; # Interpreter/debugger objec +ts to this ... $rohan3 = rohanType1->new(); $rohan4 = rohanType2->new(); $rohan3->{'field11'} = $rohan4; push $rohanRoot->{'rohan2'}, $rohan3; # ... and this

In reply to Experimental push on scalar now forbidden by gsd4me

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.