Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: exe with wx gui - pp/wxpar issues

by marto (Cardinal)
on Apr 07, 2011 at 09:03 UTC ( [id://897985]=note: print w/replies, xml ) Need Help??


in reply to exe with wx gui - pp/wxpar issues

This looks dangerous. Please post the contents of myprog.pl and @test.wxparargs.

Replies are listed 'Best First'.
Re^2: exe with wx gui - pp/wxpar issues
by jhoop (Acolyte) on Apr 07, 2011 at 14:55 UTC

    Contents of @test.wxparargs, which I believe was generated during the compile by wx::perl::packager :

    # wxpar Getopt::Argfile for PAR::Packer pp -M attributes.pm -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/libgcc_s_sjlj-1.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_adv_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_xrc_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_xml_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_media_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_html_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_net_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_gl_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_aui_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_stc_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_core_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_richtext_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_gcc_custom.dll

    Partial contents of myprog (this goes on to parse text from the files in @files, calling out to subs1.pl and generating RTF reports from template files) I can provide more if needed:

    #!C:\strawberry\perl\bin use Wx::Perl::Packager; use strict; use warnings; require 'subs1.pl'; require 'rtf_report1.pl'; require 'rtf_report2.pl'; package MyDialog; use Wx qw[:everything]; use base qw(Wx::Dialog); use Wx::Perl::BrowseButton qw(:everything); my $project_id = ' '; my $report_type = ' '; my $source_path = ' '; my $destination_path = ' '; sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_ +; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; $style = wxDEFAULT_DIALOG_STYLE unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $sty +le, $name ); $self->{sizer_5_staticbox} = Wx::StaticBox->new($self, -1, "Output + Folder (if different from Source):" ); $self->{sizer_1_staticbox} = Wx::StaticBox->new($self, -1, "" ); $self->{sizer_5_copy_staticbox} = Wx::StaticBox->new($self, -1, "S +ource Folder:" ); $self->{label_2} = Wx::StaticText->new($self, -1, "Project ID:", w +xDefaultPosition, wxDefaultSize, ); $self->{text_ctrl_1} = Wx::TextCtrl->new($self, -1, "", wxDefaultP +osition, wxDefaultSize, ); $self->{browse_source} = Wx::Perl::BrowseButton->new( $self, -1, " +", wxDefaultPosition, wxDefaultSize, wxPL_BROWSE_DIR ); $self->{browse_destination} = Wx::Perl::BrowseButton->new( $self, +-1, "", wxDefaultPosition, wxDefaultSize, wxPL_BROWSE_DIR ); $self->{label_3} = Wx::StaticText->new($self, -1, "Report Type:", + wxDefaultPosition, wxDefaultSize, ); $self->{combo_box_1} = Wx::ComboBox->new($self, -1, "", wxDefaultP +osition, wxDefaultSize, ["report A", "report B", "report C", "report +D", "report E", "report F"], wxCB_DROPDOWN|wxCB_DROPDOWN|wxCB_READONL +Y); $self->{checkbox_1} = Wx::CheckBox->new($self, -1, "QC Doc", wxDef +aultPosition, wxDefaultSize, ); $self->{checkbox_2} = Wx::CheckBox->new($self, -1, "Spreadsheet", +wxDefaultPosition, wxDefaultSize, ); $self->{checkbox_3} = Wx::CheckBox->new($self, -1, "Comparison Cha +rt", wxDefaultPosition, wxDefaultSize, ); $self->{button_1} = Wx::Button->new($self, -1, "Go!"); Wx::Event::EVT_BUTTON( $self, $self->{button_1}, $id = sub { my ( $self, $event ) = @_; $project_id = $self->{text_ctrl_1}->GetValue(); $report_type = $self->{combo_box_1}->GetValue(); $source_path = $self->{browse_source}->GetPath(); $destination_path = $self->{browse_destination}->GetPath() +; $self->Close(1); $self->Destroy; return $project_id; } ); $self->__set_properties(); $self->__do_layout(); return $self; } sub __set_properties { my $self = shift; $self->SetTitle("dialog_1"); $self->{label_2}->SetMinSize(Wx::Size->new(-1, -1)); $self->{text_ctrl_1}->SetMinSize(Wx::Size->new(131, 24)); $self->{browse_source}->SetMinSize(Wx::Size->new(225, -1)); $self->{browse_destination}->SetMinSize(Wx::Size->new(225, -1)); $self->{combo_box_1}->SetMinSize(Wx::Size->new(131, 24)); $self->{combo_box_1}->SetSelection(0); } sub __do_layout { my $self = shift; $self->{sizer_1}= Wx::StaticBoxSizer->new($self->{sizer_1_staticbo +x}, wxVERTICAL); $self->{grid_sizer_1} = Wx::GridSizer->new(3, 1, 3, 6); $self->{sizer_3} = Wx::BoxSizer->new(wxHORIZONTAL); $self->{sizer_5}= Wx::StaticBoxSizer->new($self->{sizer_5_staticbo +x}, wxHORIZONTAL); $self->{sizer_5_copy}= Wx::StaticBoxSizer->new($self->{sizer_5_cop +y_staticbox}, wxHORIZONTAL); $self->{sizer_2} = Wx::BoxSizer->new(wxHORIZONTAL); $self->{sizer_2}->Add($self->{label_2}, 0, wxALL, 3); $self->{sizer_2}->Add($self->{text_ctrl_1}, 1, wxALL, 3); $self->{sizer_1}->Add($self->{sizer_2}, 0, wxEXPAND, 0); $self->{sizer_5_copy}->Add( $self->{browse_source}, 0, wxGROW|wxAL +L, 0 ); $self->{sizer_1}->Add($self->{sizer_5_copy}, 1, wxEXPAND, 0); $self->{sizer_5}->Add($self->{browse_destination}, 0, 0, 0); $self->{sizer_1}->Add($self->{sizer_5}, 1, wxEXPAND, 0); $self->{sizer_3}->Add($self->{label_3}, 0, wxALL, 3); $self->{sizer_3}->Add($self->{combo_box_1}, 1, wxALL, 3); $self->{sizer_1}->Add($self->{sizer_3}, 0, wxEXPAND, 0); $self->{grid_sizer_1}->Add($self->{checkbox_1}, 0, 0, 3); $self->{grid_sizer_1}->Add($self->{checkbox_2}, 0, 0, 3); $self->{grid_sizer_1}->Add($self->{checkbox_3}, 0, 0, 3); $self->{sizer_1}->Add($self->{grid_sizer_1}, 1, wxEXPAND, 0); $self->{sizer_1}->Add($self->{button_1}, 0, wxALL|wxALIGN_CENTER_H +ORIZONTAL, 3); $self->SetSizer($self->{sizer_1}); $self->{sizer_1}->Fit($self); $self->Layout(); } package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $dialog_1 = MyDialog->new(); $app->SetTopWindow($dialog_1); $dialog_1->Show(1); $app->MainLoop(); } $source_path = win_path($source_path); $destination_path = win_path($destination_path); if (!$destination_path) { $destination_path = $source_path; } my @files = <$source_path\\*>; my %seen; my $search = 'while (<>) { study;'; $search .= "++\$seen{\$ARGV} if /\\b_$project_id\\b/;\n"; $search .= "}"; @ARGV = @files; undef $/; eval $search; $/ = "\n";
      problem one, covered in PAR::FAQ
      unless(caller)
      Problem two
      $source_path = win_path($source_path); $destination_path = win_path($destination_path); if (!$destination_path) { $destination_path = $source_path; } my @files = <$source_path\\*>; my %seen; my $search = 'while (<>) { study;'; $search .= "++\$seen{\$ARGV} if /\\b_$project_id\\b/;\n"; $search .= "}"; @ARGV = @files; undef $/; eval $search; $/ = "\n";
      Don't use string eval, especially for something like that. That should be a single function call, see qr, quotemeta, local
        Thanks, I will adjust. I did come across the unless(caller) issue last night and commented out the line, but received the same errors from the exe after running wxpar. Is that eval the likely source of my problem? Why the attempt to access all those other directories, when $source_path is clearly defined?

        Update: I changed the way I was digging through the source directory, and it cleared up my problem. However, I still don't understand why the use of eval in that way was causing the trouble.. thanks though.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://897985]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found