Compilation Problem with Perl ( Bad option)

Discussion in 'Perl Misc' started by manikandan.tv@gmail.com, Sep 9, 2005.

  1. Guest

    Hello,
    I am using Perl 5.8.0

    When I try to compile the below script , I am getting the following
    error message .
    Pls help me.

    Bad option `/lsi/home/tvmani/openfold.xbm' at
    /lsi/soft/CFR/lib/perl5/site_perl/5.8.0/i686-linux/Tk/Image.pm line 21.


    **********************************************************************
    #Program

    #!/lsi/soft/CFR/bin/perl5.8.0

    BEGIN
    {
    unshift (@INC,"$ENV{HOME}/PERL_PG");
    }
    print "\n INC Is : @INC\n";
    use Tk;
    require Tk::Bitmap;
    require Tk::HList;
    $top = MainWindow->new();
    $hlist = $top->Scrolled('HList',
    drawbranch => 1, # yes, draw branches
    separator => '/', # filename separator
    indent => 15, # pixels
    command => \&show_or_hide_dir);
    $hlist->pack(fill => 'both',expand => 'y');
    # Read bitmap files and create "image" objects.
    $open_folder_bitmap = '';
    #export $open_folder_bitmap;
    $open_folder_bitmap = $top->Bitmap(file =>
    '/lsi/home/tvmani/openfold.xbm');
    $closed_folder_bitmap = $top->Bitmap(file => './folder.xbm');

    # Start with the root directory
    show_or_hide_dir("/");
    MainLoop();

    #-----------------------------------------------------------------------
    sub show_or_hide_dir { # Called when an entry is double-clicked
    my $path = $_[0];
    return if (! -d $path); # Not a directory.
    if ($hlist->info('exists', $path)) {
    # Toggle the directory state.
    # We know that a directory is open if the next entry is a
    # a substring of the current path
    $next_entry = $hlist->info('next', $path);
    if (!$next_entry || (index ($next_entry, "$path/") == -1)) {
    # Nope. open it
    $hlist->entryconfigure($path, image =>
    $open_folder_bitmap);
    add_dir_contents($path);
    } else {
    # Yes. Close it by changing the icon, and deleting its
    children
    $hlist->entryconfigure($path,
    image => $closed_folder_bitmap);
    $hlist->delete('offsprings', $path);
    }
    } else {
    die "'$path' is not a directory\n" if (! -d $path);
    $hlist->add($path, itemtype => 'imagetext',
    image => $icons{"open"},
    text => $path );
    add_dir_contents($path);
    }
    }

    sub add_dir_contents {
    my $path = $_[0];
    my $oldcursor = $top->cget('cursor'); # Remember current cursor,
    and
    $top->configure(cursor => 'watch'); # change cursor to watch
    $top->update();
    my @files = glob "$path/*";
    foreach $file (@files) {
    $file =~ s|//|/|g;
    ($text = $file) =~ s|^.*/||g;
    if (-d $file) {
    $hlist->add($file, itemtype => 'imagetext',
    image => $icons{"closed"}, text => $text);
    } else {
    $hlist->add($file, itemtype => 'text',
    text => $text);
    }
    }
    $top->configure(cursor => $oldcursor);
    }
    **********************************************************************

    Regards
    -Mani
    , Sep 9, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    699
    GianGuz
    Dec 21, 2004
  2. Cas
    Replies:
    5
    Views:
    769
    Kevin Jones
    Aug 28, 2006
  3. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    589
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  4. rantingrick
    Replies:
    44
    Views:
    1,146
    Peter Pearson
    Jul 13, 2010
  5. John

    Regex for <option> ... </option>

    John, Jan 23, 2009, in forum: Perl Misc
    Replies:
    10
    Views:
    228
    Eric Pozharski
    Jan 29, 2009
Loading...

Share This Page