Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8375991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:19:02+00:00 2026-06-09T15:19:02+00:00

It looks like there is a symbol in main called ‘_<-‘ (without the quotes)

  • 0

It looks like there is a symbol in main called '_<-' (without the quotes) in the same fashion as the other things that look like they could be handles: '_</usr/perl/lib/Carp.pm', for example.

Is there some way to use it?

Or would I have to use a source filter if I hope to read the input source?


In reply to mob: I don’t know where Debug would be getting turned on. After I dump out the base table, a dump of %INC shows:

$VAR1 = {
      'warnings/register.pm' => 'C:/strawberry/perl/lib/warnings/register.pm',
      'XSLoader.pm' => 'C:/strawberry/perl/lib/XSLoader.pm',
      'English.pm' => 'C:/strawberry/perl/lib/English.pm',
      'Tie/Hash/NamedCapture.pm' => 'C:/strawberry/perl/lib/Tie/Hash/NamedCapture.pm',
      'unicore/lib/Perl/_PerlIDS.pl' => 'C:/strawberry/perl/lib/unicore/lib/Perl/_PerlIDS.pl',
      'unicore/Heavy.pl' => 'C:/strawberry/perl/lib/unicore/Heavy.pl',
      'warnings.pm' => 'C:/strawberry/perl/lib/warnings.pm',
      'utf8.pm' => 'C:/strawberry/perl/lib/utf8.pm',
      'Config.pm' => 'C:/strawberry/perl/lib/Config.pm',
      'overloading.pm' => 'C:/strawberry/perl/lib/overloading.pm',
      'Symbol.pm' => 'C:/strawberry/perl/lib/Symbol.pm',
      'Carp.pm' => 'C:/strawberry/perl/lib/Carp.pm',
      'bytes.pm' => 'C:/strawberry/perl/lib/bytes.pm',
      'Exporter/Heavy.pm' => 'C:/strawberry/perl/lib/Exporter/Heavy.pm',
      'utf8_heavy.pl' => 'C:/strawberry/perl/lib/utf8_heavy.pl',
      'strict.pm' => 'C:/strawberry/perl/lib/strict.pm',
      'Exporter.pm' => 'C:/strawberry/perl/lib/Exporter.pm',
      'vars.pm' => 'C:/strawberry/perl/lib/vars.pm',
      'constant.pm' => 'C:/strawberry/perl/lib/constant.pm',
      'Errno.pm' => 'C:/strawberry/perl/lib/Errno.pm',
      'overload.pm' => 'C:/strawberry/perl/lib/overload.pm',
      'Data/Dumper.pm' => 'C:/strawberry/perl/lib/Data/Dumper.pm'
    };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:19:03+00:00Added an answer on June 9, 2026 at 3:19 pm

    Or would I have to use a source filter if I hope to read the input source?

    If the source file has an __END__ or __DATA__ tag, then the DATA filehandle is available. …that in and of itself is boring. What’s interesting is that you can seek to position 0, and that will take you to the top of the source file:

    use Carp;
    
    print "Just another Perl hacker,\n";
    
    eval { 
        no warnings qw/unopened/;
        seek DATA, 0, 0 
          or croak "Script lacking __END__ or __DATA__ tag has no DATA filehandle.";
    };
    if( !$@ ) {
        while(<DATA>){
            print;
        }
    }
    else {
        carp $@;
    }
    
    __END__
    

    This script will execute (printing ‘Just another Perl hacker,’), and then will finish up by printing its own source.

    In the code above, if the eval block does trap an exception, the fallback could be to use FindBin and $0, open the source file, and then read it. Putting it all together, here’s how it looks:

    BEGIN {
        use Carp;
    
        sub read_source {
            my $source;
            local $/ = undef;
            eval {
                no warnings qw( unopened );
                my $DATA_position = tell DATA;
                croak "'tell DATA' failed: Probably no __END__ or __DATA__ segment."
                  if $DATA_position < 0;
                seek DATA, 0, 0
                  or croak
                  "'seek DATA' failed: Probably no __END__ or __DATA__ segment.";
                $source = <DATA>;
                seek DATA, $DATA_position, 0 or croak    # Must leave *DATA usable.
                  "seek to reset DATA filehandle failed after read.";
            };
            if ($@) {
                croak $@ if $@ =~ /reset/;    # Unstable state: Shouldn't be possible.
                eval {
                    require FindBin;
                    no warnings 'once';
                    open my $source_fh, $FindBin::Bin . '/' . $0 or croak $!;
                    $source = <$source_fh>;
                };
                croak "Couldn't read source file from *DATA or \$0: $@" if $@;
            }
            return $source;
        }
    };
    
    print read_source(), "\n";
    

    This snippet first tries to read from DATA, which eliminates the need to load FindBin and open a new file handle. If that fails, then it tries the FindBin approach. If both fail, it throws an exception. The final successful state slurps the entire source file into $source_code. The DATA handle will also be restored to the same state it was in before calling this snippet.

    That should robustly handle the question of how to read the source file without resorting to a source filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It looks like there are reports released on occasion that detail downloads for some
Hi there I have an SQL table that looks like this: CREATE TABLE IF
In Visual Studio 2008 there is a folder browser dialog that looks like this
I have a text file that looks like this: value1 value2 value3 There are
Looks like there is no Load event for usercontrol on the CF. I'm used
It looks like there a few working solutions for using custom true type fonts
It looks like there are a variety of virtual machine offerings available. What is
By default, the ordered list looks like this: There are some spacing on the
Is there any themes for emacs which looks like this one? http://www.lnbogen.com/VisualStudioNet2005Colors.aspx
Here's how it looks like right now: my screenshot Is there a way for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.