in reply to How to get a package by telnet

There are two ways to answer your question. I'm going to start with the obvious way (which takes you at your word and assumes you know what package means).

Undefined subroutine &record::get called at

This means you didn't define that subroutine, or maybe you defined it before your package declaration. If you defined sub get first before your package declaration, then it will be main::get rather than record::get. After the package declaration you're in the record package, so get() is the same as record::get(), which is _not_ the same as main::get(). If you need to use get() inside of your package, you should probably declare and define it inside of your package (i.e., after the package declaration). It might be best to put the package declaration at the very beginning of your module, at the top of the file.

# You start out in package main sub get { print "This is &main::get();\n"; } package record; # This puts you in package record sub get { print "This is &record::get();\n"; }

The other possibility is that you have misunderstood what package does. If you think "package foo" gives you access to some other foo package that someone else has written so that you can use it, then you have package confused with either use (probably) or require (possibly, if the package is not installed in the usual way). If what you're trying to do is use someone else's package, then you should use it, roughly as follows:

use record; my $rec = record::get(); my $recfoo = $rec->foo();

I'm not familiar with the record package, so the above may not be exactly right. See the documentation for the package in question.

I'm not at all sure that I've answered your question, because I don't understand what telnet has to do with anything, so if these answers don't seem right, maybe you need to clarify the question.


{my$c;$ x=sub{++$c}}map{$ \.=$_->()}map{my$a=$_->[1]; sub{$a++ }}sort{_($a->[0 ])<=>_( $b->[0])}map{my@x=(& $x( ),$ _) ;\ @x} split //, "rPcr t lhuJnhea eretk.as o";print;sub _{ord(shift)*($=-++$^H)%(42-ord("\r"))};