package Selfcontrol; use strict; use Exporter; use vars qw( @EXPORT @ISA @VERSION); @VERSION = 0.01; @ISA = qw( Exporter ); @EXPORT = qw( &selfcontrol); use Carp; sub selfcontrol{ my $self = shift; my $ref = ref( $self); SWITCH: { $_ = $ref; last unless $_; last if /REF/; last if /SCALAR/; last if /ARRAY/; last if /HASH/; last if /CODE/; last if /GLOB/; return $self; } confess 'You forget the $self->, you idiot!'. "\n\tInstead you gave me $self that refs to '$ref'"; } #### my $self = $bugfree ? shift : selfcontrol( shift ); #### for ('Operator', 'SQLStatement', 'PerlVariable', 'CompModifier') { $self->findTokenPos( $_, $i, $blocklast ); $numberOthers += scalar( @_ ); } #### # # Modification of a read-only value attempted, chunk 1. File ':Selfcontrol.pm'; Line 15 # Selfcontrol::selfcontrol('embedSQL=HASH(0x2b31864)') called File ':embedSQL.pm'; Line 876 # embedSQL::findTokenPos('embedSQL=HASH(0x2b31864)', 'Operator', 2, 3) called File ':embedSQL.pm'; Line 292 # embedSQL::synonymsSELECT('embedSQL=HASH(0x2b31864)') called File ':embedSQL.pm'; Line 202 # embedSQL::parse('embedSQL=HASH(0x2b31864)') called File 'Documenten:embedSQL:test1.pl'; Line 10 #### for my $str ('Operator', 'SQLStatement', 'PerlVariable', 'CompModifier') { $self->findTokenPos( $str, $i, $blocklast ); $numberOthers += scalar( @_ ); }