App-Asciio
view release on metacpan or search on metacpan
lib/App/Asciio/Io.pm view on Meta::CPAN
write_file($file_name, Dumper [$stencil]) ;
}
}
}
#-----------------------------------------------------------------------------
sub serialize_self
{
my ($self, $indent) = @_ ;
local $self->{widget} = undef ;
local $self->{PIXMAP} = undef ;
local $self->{ALLOCATED_COLORS} = undef ;
local $self->{ACTIONS} = [] ;
local $self->{HOOKS} = [] ;
local $self->{CURRENT_ACTIONS} = [] ;
local $self->{ACTIONS_BY_NAME} = [] ;
local $self->{DO_STACK} = undef ;
local $self->{IMPORT_EXPORT_HANDLERS} = undef ;
local $self->{MODIFIED} => 0 ;
local $self->{TITLE} = '' ;
local $self->{CREATE_BACKUP} = undef ;
local $self->{MIDDLE_BUTTON_SELECTION_FILTER} = undef ;
local $Data::Dumper::Purity = 1 ;
local $Data::Dumper::Indent = $indent || 0 ;
local $Data::Dumper::Sortkeys = 1 ;
Dumper($self) ;
}
#-----------------------------------------------------------------------------
sub save_with_type
{
my ($self, $elements_to_save, $type, $file_name) = @_ ;
my $title ;
if
(
exists $self->{IMPORT_EXPORT_HANDLERS}{$type}{EXPORT}
&& defined $self->{IMPORT_EXPORT_HANDLERS}{$type}{EXPORT}
)
{
$title = $self->{IMPORT_EXPORT_HANDLERS}{$type}{EXPORT}->
(
$self,
$elements_to_save,
$file_name,
$self->{IMPORT_EXPORT_HANDLERS}{HANDLER_DATA},
) ;
}
else
{
if($self->{CREATE_BACKUP} && -e $file_name)
{
use File::Copy;
copy($file_name,"$file_name.bak") or die "save_with_type: Copy failed while making backup copy: $!";
}
write_file($file_name,compress($self->serialize_self() .'$VAR1 ;')) ;
$title = $file_name ;
}
return $title ;
}
#-----------------------------------------------------------------------------
1 ;
( run in 3.591 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )