[28381] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9745 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 18:06:04 2006

Date: Wed, 20 Sep 2006 15:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 20 Sep 2006     Volume: 10 Number: 9745

Today's topics:
    Re: array of hashes with a little more... <mikebjunk@gmail.com>
    Re: array of hashes with a little more... <jgibson@mail.arc.nasa.gov>
    Re: array of hashes with a little more... <jgibson@mail.arc.nasa.gov>
    Re: array of hashes with a little more... <tzz@lifelogs.com>
    Re: array of hashes with a little more... <mikebjunk@gmail.com>
        Best practices? Organizing CGI code and modules? <robb@acm.org>
    Re: Best practices? Organizing CGI code and modules? <uri@stemsystems.com>
    Re: Best practices? Organizing CGI code and modules? <tzz@lifelogs.com>
    Re: Best practices? Organizing CGI code and modules? <john@castleamber.com>
    Re: Help with plotting <mumia.w.18.spam+nospam.usenet@earthlink.net>
    Re: Help with plotting <someone@example.com>
    Re: inserting lines <tzz@lifelogs.com>
    Re: inserting lines <someone@example.com>
    Re: inserting lines <tzz@lifelogs.com>
    Re: Net::Telnet, script exits after connection failure <mike.ferrari@motorola.com>
    Re: Perl compiler <syscjm@gwu.edu>
    Re: Server/client over a network <scottalorda_NOSPAM@libello.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 20 Sep 2006 11:07:26 -0700
From: "mikeybe" <mikebjunk@gmail.com>
Subject: Re: array of hashes with a little more...
Message-Id: <1158775646.484904.102470@b28g2000cwb.googlegroups.com>


> Since the total number of dewey integers is rather small, I would just
> build myself a hash up-front which (for the example you cited) would
> have a pair like:
>    $range{654} = '600-700';
> That way, every time I saw a dewey number, I could easily look up what
> range it belongs to in that hash by looking at the integer key. I need
> to insure consistent handling of leading zeros (either always strip
> them or always format them - I took the strip approach - but only for
> the internal range look-up; leading zeros are preserved in the output).

Good idea up front, however, it causes problems with scalability. For
example, what if I wanted to change my deweystring to make more rss
files and I change it to this:

000-999 010-020 020-030 000-100 100-200 200-300 300-400 400-500 etc.

I would still want this to work. I want the program to work so that
when I change that line to make it as specific as I want, all will
still be well with the world:)

Mike



------------------------------

Date: Wed, 20 Sep 2006 12:01:07 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: array of hashes with a little more...
Message-Id: <200920061201075818%jgibson@mail.arc.nasa.gov>

In article <1158775646.484904.102470@b28g2000cwb.googlegroups.com>,
mikeybe <mikebjunk@gmail.com> wrote:

> > Since the total number of dewey integers is rather small, I would just
> > build myself a hash up-front which (for the example you cited) would
> > have a pair like:
> >    $range{654} = '600-700';
> > That way, every time I saw a dewey number, I could easily look up what
> > range it belongs to in that hash by looking at the integer key. I need
> > to insure consistent handling of leading zeros (either always strip
> > them or always format them - I took the strip approach - but only for
> > the internal range look-up; leading zeros are preserved in the output).
> 
> Good idea up front, however, it causes problems with scalability. For
> example, what if I wanted to change my deweystring to make more rss
> files and I change it to this:
> 
> 000-999 010-020 020-030 000-100 100-200 200-300 300-400 400-500 etc.
> 
> I would still want this to work. I want the program to work so that
> when I change that line to make it as specific as I want, all will
> still be well with the world:)

Your requirements are a moving target. You now have overlapping ranges.

You have a set consisting of a pair of numbers for each element. The
most natural and efficient data structure would be an array of arrays:

my @catalog = (
   [ '000', '999' ],
   [ '010', '020' ],
   [ '020', '030' ],
   [ '000', '100' ],
   ... #etc.
);

You can construct this AoA from the string above by first splitting on
spaces to get the elements, then splitting on the minus sign to get the
limits. You could also parse the string with a regular expression.


------------------------------

Date: Wed, 20 Sep 2006 12:02:58 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: array of hashes with a little more...
Message-Id: <200920061202582507%jgibson@mail.arc.nasa.gov>

In article <ees233.10g.1@news.isolution.nl>, Dr.Ruud
<rvtol+news@isolution.nl> wrote:

> Jim Gibson schreef:
> > usenet:
> 
> >>    my @deweys=qw{000-099 100-199 200-299 300-399 400-499 500-599};
> >
> > There is redundant information in this array. I would just store the
> > starting values and use the appropriate comparison operators and
> > succesive elements in the array to define a range:
> >
> >    my @deweys = qw{ 000 100 200 300 400 500 };
> 
>     my @deweys = 0..5 ;
> ;)

But those are not equivalent :(


------------------------------

Date: Wed, 20 Sep 2006 16:51:33 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: array of hashes with a little more...
Message-Id: <g69irjigt2i.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 20 Sep 2006, jgibson@mail.arc.nasa.gov wrote:

> In article <1158775646.484904.102470@b28g2000cwb.googlegroups.com>,
> mikeybe <mikebjunk@gmail.com> wrote:

>> Good idea up front, however, it causes problems with scalability. For
>> example, what if I wanted to change my deweystring to make more rss
>> files and I change it to this:
>>
>> 000-999 010-020 020-030 000-100 100-200 200-300 300-400 400-500 etc.
>
> Your requirements are a moving target. You now have overlapping ranges.

I wonder if mikeybe doesn't really want the range to be part of the
RSS feed URL:

/getrss.cgi?start=020&end=030&start=100&end=200

Then dynamically generate the resulting documents, providing some
prebuilt RSS feed queries for users who don't want to build their
own.  IIRC the multiple start/end parameters should be OK.

I may be misunderstanding the intent here, but it certainly seems much
more flexible and useful to have ranges as parameters to the RSS query
than fixed ranges.

Ted


------------------------------

Date: 20 Sep 2006 14:09:23 -0700
From: "mikeybe" <mikebjunk@gmail.com>
Subject: Re: array of hashes with a little more...
Message-Id: <1158786563.503158.319500@m7g2000cwm.googlegroups.com>


> I wonder if mikeybe doesn't really want the range to be part of the
> RSS feed URL:
>
> /getrss.cgi?start=020&end=030&start=100&end=200
>
> Then dynamically generate the resulting documents, providing some
> prebuilt RSS feed queries for users who don't want to build their
> own.  IIRC the multiple start/end parameters should be OK.
>
> I may be misunderstanding the intent here, but it certainly seems much
> more flexible and useful to have ranges as parameters to the RSS query
> than fixed ranges.
>
> Ted

Ted,

I thought about this...and it may be where I end up turning to later
on, but to make a long story short, I'm not doing this now:) The skinny
is that the whole project will be run from a unix box perl script which
will extract the data, create rss feeds from it daily/weekly whatever,
and then FTP the files to the web server. I will make links manually on
the relevant web pages.

Future plans to have them show up in a web page with thumbnails from
amazon etc. At some point it may turn into an email distro list. Who
know...but for now, I need to make this array of hashes of arrays of
arrays of whatever...back to work:) I will, no doubt, have more
questions.

Mike



------------------------------

Date: 20 Sep 2006 11:07:30 -0700
From: "robb@acm.org" <robb@acm.org>
Subject: Best practices? Organizing CGI code and modules?
Message-Id: <1158775650.170479.125070@i42g2000cwa.googlegroups.com>

Hi,

I've taken over management of a website that has absolute chaos in the
organization of the CGI directory (/cgi-bin).  There are ~600 files and
directories here, no user-built modules, and perl files
indiscriminately named .pl, .cgi, etc.

Instituting revision control has been a big help. :-)

But specifically to perl, is there a consensus about where to put which
files, and how they should be named?  I personally like to develop with
packages and modules, and this is a new thing in this environment.  I
so far have these kinds of files that I'm developing:

Test Scripts
Application-Specific Modules
Application-Independent Modules
Application CGI scripts, referenced directly from a web client

Currently, here's what I'm doing, but I don't believe this is optimal:

/cgi-bin
  App. CGI scripts, named *.cgi.
  App-independent modules named *.pm

/cgi-bin/CamelCaseAppName
  App-specific modules, named *.pm
  App-specific test scripts, named *.pm

I'm definitely interested in removing things from cgi-bin that don't
need to be there.  And, I want to increase maintainability.  I also
want to enable automated running of all my tests.

Thanks for any input,
Robb



------------------------------

Date: Wed, 20 Sep 2006 14:29:33 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Best practices? Organizing CGI code and modules?
Message-Id: <x7ac4ujss2.fsf@mail.sysarch.com>

>>>>> "ro" == robb@acm org <robb@acm.org> writes:

  ro> Test Scripts

those are executables so should be in some bin/ dir. they don't need to
be in any cgi areas (unless they are cgi driven). in fact i wouldn't put
any development source in the actual cgi dirs. copy tested scripts into
cgi dirs using an install process.

  ro> Application CGI scripts, referenced directly from a web client

in many cases those can be reduced to minimal or even reused scripts
that call out to modules that do all the work. this is a very good way
to do this because the modules will have a clean perl API which can be
called from standalone test scripts. the cgi scripts become trival
wrappers which grab the cgi params (using CGI.pm or mod_perl), mung the
data into the form the modules want (hash trees, etc.) and call out
to the proper modules. the results are processed into html output
(possibly using a templater) and that can be also done in external
modules. then the cgi is even simpler and it can almost be made into a
common script that can do many operations based on its name (check $0 as
a primary dispatch arg) or a command type param.

with these modules you can develop them anywhere you want. use lib can
help you find and load them from the proper installed dirs (or you can
install them in perl's default lib dirs). you can put the test script
development near the modules that they test which is good too.

  ro> I'm definitely interested in removing things from cgi-bin that don't
  ro> need to be there.  And, I want to increase maintainability.  I also
  ro> want to enable automated running of all my tests.

what needs to be in cgi-bin is a minimal set of cgi scripts which just
call out to modules that do the real work. this makes your cgi very
clean and easy to manage. consider cgi as just an interface to your
modules and design your code accordingly. interfaces should be isolated
from back end work so you can more easily have multiple interfaces
(think cgi and test scripts as using two different interfaces).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Wed, 20 Sep 2006 15:12:04 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Best practices? Organizing CGI code and modules?
Message-Id: <g69irjiic8r.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 20 Sep 2006, robb@acm.org wrote:

> Currently, here's what I'm doing, but I don't believe this is optimal:
>
> /cgi-bin
> App. CGI scripts, named *.cgi.
> App-independent modules named *.pm
>
> /cgi-bin/CamelCaseAppName
> App-specific modules, named *.pm
> App-specific test scripts, named *.pm

I like to "use lib '/usr/local/PROJECT'" for things in cgi-bin, then
put all modules, templates, etc. under /usr/local/PROJECT.
'/usr/local' is a matter of preference, but it really helps to base
the code somewhere outside of the webserver's grubby indexing hands.

Ted


------------------------------

Date: 20 Sep 2006 20:39:28 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Best practices? Organizing CGI code and modules?
Message-Id: <Xns98449F47B174Ccastleamber@130.133.1.4>

"robb@acm.org" <robb@acm.org> wrote:

> Hi,
> 
> I've taken over management of a website that has absolute chaos in the
> organization of the CGI directory (/cgi-bin).  There are ~600 files and
> directories here, no user-built modules, and perl files
> indiscriminately named .pl, .cgi, etc.
> 
> Instituting revision control has been a big help. :-)
> 
> But specifically to perl, is there a consensus about where to put which
> files,

First, regarding the cgi-bin directory, this should be *outside* your 
document root (see: http://johnbokma.com/windows/apache-virtual-hosts-
xp.html)

Next all files that are not cgi scripts *shouldn't* be in this directory.
One configuration mistake, and they are available on the Internet.

> and how they should be named?  I personally like to develop with
> packages and modules, and this is a new thing in this environment.  I
> so far have these kinds of files that I'm developing:
> 
> Test Scripts

Shouldn't be online.

> Application-Specific Modules
> Application-Independent Modules
> Application CGI scripts, referenced directly from a web client

only ones that should be inside cgi-bin online.

> Currently, here's what I'm doing, but I don't believe this is optimal:
> 
> /cgi-bin
>   App. CGI scripts, named *.cgi.
>   App-independent modules named *.pm

Would put the latter in a directory that is outside document root *and* 
outside cgi-bin. Readable by your scripts.

> /cgi-bin/CamelCaseAppName
>   App-specific modules, named *.pm

See above

>   App-specific test scripts, named *.pm

pm stands for Perl module.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Wed, 20 Sep 2006 18:12:56 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Help with plotting
Message-Id: <IwfQg.11$o71.7@newsread3.news.pas.earthlink.net>

On 09/20/2006 11:54 AM, Deepu wrote:
> Hi All,
> 
> I am trying to generate a bar chart after creating a table out of the
> information in a file.
> 
> I have file which contains so many other details and have a line in the
> file which start with:
> 
> #RESULT: 30 => YES: 10 NO: 10 UNKNOWN: 10
> 
> I have several files with each file have a line with RESULT.
> 
> The code to store the number of YES, NO and UNKNOWN:
> 
> #!/usr/bin/perl
> 
> @dirList= qw(FILE1 FILE2 FILE3 FILE4 FILE5);
> 
> foreach $dir (@dirList) {
>    open (PH, "$dir") || die "Can not open:$dir";
> 
>    while (<PH>) {
>       if (/#RESULT: (\d+) => YES: (\d+) NO: (\d+) UNKNOWN: (\d+)/) {
>          push (@yesArray, $2);
>          push (@noArray, $3);
>          push (@unknownArray, $4);
>       }
>    }
> 
> close (PH);
> }
> 
> Now i am trying to display it in a table format:
> 
>               YES        NO       UNKNOWN
> FILE1       10           8               14
> FILE2        6            7               20
> FILE3        18          10             10
> FILE4        20          12             10
> FILE5        10          10             10
> 
> After printing this out how to create abar chart out of it in perl with
> X axis showing FILE number and has 3 bars for each file.
> 
> Thanks for the help.
> 

I'm in a really good mood right now:

     use strict;
     use warnings;
     use PDL;
     use PDL::Graphics::PLplot;
     my @yesArray = qw(10 6 18 20 10);
     my @noArray = qw(8 7 10 12 10);
     my @unknownArray = qw(14 20 10 10 10);

     my $fmt = "%-10s %5s %5s   %5s\n";
     printf ($fmt, '', qw(YES NO UNKNOWN));
     printf $fmt, 'FILE'.($_+1), $yesArray[$_],
         $noArray[$_], $unknownArray[$_] for (0..$#yesArray);

     my $pl = PDL::Graphics::PLplot->new(DEV => 'pbm',
         FILE => 'make_yn_table.pbm');
     $pl->setparm(PLOTTYPE => 'LINEPOINTS', LINEWIDTH => 4);
     my $x = sequence(scalar @yesArray)+1;
     $pl->xyplot($x, pdl [ @yesArray ] );
     $pl->xyplot($x, pdl [ @noArray ], COLOR => 'RED');
     $pl->xyplot($x, pdl [ @unknownArray ], COLOR => 'BLUE');
     print $x;
     $pl->close;


For some reason, I never get color in the output PBM file. The docs say 
that the module supports PPMs. So why no color?

Also, the line-width that I set is ignored. Why?




------------------------------

Date: Wed, 20 Sep 2006 18:32:02 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Help with plotting
Message-Id: <COfQg.26973$bf5.10185@edtnps90>

Deepu wrote:
> 
> I am trying to generate a bar chart after creating a table out of the
> information in a file.
> 
> I have file which contains so many other details and have a line in the
> file which start with:
> 
> #RESULT: 30 => YES: 10 NO: 10 UNKNOWN: 10
> 
> I have several files with each file have a line with RESULT.
> 
> The code to store the number of YES, NO and UNKNOWN:
> 
> #!/usr/bin/perl
> 
> @dirList= qw(FILE1 FILE2 FILE3 FILE4 FILE5);
> 
> foreach $dir (@dirList) {
>    open (PH, "$dir") || die "Can not open:$dir";
> 
>    while (<PH>) {
>       if (/#RESULT: (\d+) => YES: (\d+) NO: (\d+) UNKNOWN: (\d+)/) {
>          push (@yesArray, $2);
>          push (@noArray, $3);
>          push (@unknownArray, $4);
>       }
>    }
> 
> close (PH);
> }
> 
> Now i am trying to display it in a table format:
> 
>               YES        NO       UNKNOWN
> FILE1       10           8               14
> FILE2        6            7               20
> FILE3        18          10             10
> FILE4        20          12             10
> FILE5        10          10             10


format STDOUT_TOP =
                 YES        NO   UNKNOWN
 .

format STDOUT =
@<<<<<<<<< @>>>>>>>> @>>>>>>>> @>>>>>>>>
$ARGV,     $1,       $2,       $3
 .

@ARGV = qw( FILE1 FILE2 FILE3 FILE4 FILE5 );

while ( <> ) {
    /#RESULT:\s+\d+\s+=>\s+YES:\s+(\d+)\s+NO:\s+(\d+)\s+UNKNOWN:\s+(\d+)/
    && write
    && close ARGV
    }




John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Wed, 20 Sep 2006 15:21:53 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: inserting lines
Message-Id: <g69eju6ibse.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 20 Sep 2006, noreply@hotmail.com wrote:

> I want to know how to add a line , say "foobar" , after a line which says,
> for example "string1", in a inout file.

This will print the new data:

perl -pe'$_ = "${_}foobar\n" if /string1/;' FILE

This will rewrite FILE with the new data:

perl -pie'$_ = "${_}foobar\n" if /string1/;' FILE

Ted


------------------------------

Date: Wed, 20 Sep 2006 20:30:13 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: inserting lines
Message-Id: <pxhQg.19722$KA6.15446@clgrps12>

Ted Zlatanov wrote:
> On 20 Sep 2006, noreply@hotmail.com wrote:
> 
>>I want to know how to add a line , say "foobar" , after a line which says,
>>for example "string1", in a inout file.
> 
> This will print the new data:
> 
> perl -pe'$_ = "${_}foobar\n" if /string1/;' FILE
> 
> This will rewrite FILE with the new data:
> 
> perl -pie'$_ = "${_}foobar\n" if /string1/;' FILE

That won't work as the -i switch requires an argument which is appended to the
back-up file name:

$ perl -pie'$_ = "${_}foobar\n" if /string1/;' FILE
Unrecognized switch: -= "${_}foobar\n" if /string1/;  (-h will show valid
options).


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Wed, 20 Sep 2006 16:45:41 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: inserting lines
Message-Id: <g69mz8ugtca.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 20 Sep 2006, someone@example.com wrote:

Ted Zlatanov wrote: > On 20 Sep 2006, noreply@hotmail.com wrote: >
>>> I want to know how to add a line , say "foobar" , after a line which says,
>>> for example "string1", in a inout file.
>>
>> This will print the new data:
>>
>> perl -pe'$_ = "${_}foobar\n" if /string1/;' FILE
>>
>> This will rewrite FILE with the new data:
>>
>> perl -pie'$_ = "${_}foobar\n" if /string1/;' FILE
>
> That won't work as the -i switch requires an argument which is appended to the
> back-up file name:
>
> $ perl -pie'$_ = "${_}foobar\n" if /string1/;' FILE
> Unrecognized switch: -= "${_}foobar\n" if /string1/; (-h will show valid
> options).

Yes.  -pi -e will work.  I was mesmerized by the food reference.

Ted


------------------------------

Date: Wed, 20 Sep 2006 14:26:01 -0500
From: Mike Ferrari <mike.ferrari@motorola.com>
Subject: Re: Net::Telnet, script exits after connection failure
Message-Id: <ees4sf$8pp$1@newshost.mot.com>

--Jani-- wrote:

> Hi!
> 
> Here's my code and configfile syntax is 192.168.0.1,username,password:
> 
> foreach (@confile) {
>         if (/^\#(.*)/) {
>         }
>         elsif (/^\d(.*)/) {
>                 ($swip, $swuser, $swpass) = split(/,/);
>                 chomp ($swip, $swuser, $swpass);
> 	        use Net::Telnet;
> 		$cmdString = "switchshow";
> 	        $brocade = new Net::Telnet (Host => "$swip", Timeout => 10);
>                 $brocade->dump_log($tracefile);
> 		$brocade->login(Name => $swuser, Password => $swpass);
> 		$brocade->cmd($cmdString);
> 		$brocade->close;
>         }
> }
>
What is your question? Why does it exit?

Try using the "Log" features, Dump_Log, Input_Log, and Output_Log to 
actually see whats going on..

Also take time to really read the perldoc.. it explains everything in 
great detail.

Also.. adjust your timeout a little bit.. maybe its timing out too 
early.. bump it up to 30 seconds or something.

I am assuming you have a list of devices you are connecting to.. and it 
moves to the next device on the list?

Hope this helps
Mike




------------------------------

Date: Wed, 20 Sep 2006 14:29:15 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: Perl compiler
Message-Id: <12h323uhp1o2100@corp.supernews.com>

Bill H wrote:
> 
> Actually I do mean Dos, well command prompt in XP. I do all my Perl
> coding outside of windows and want to have a few of my programs
> compiled so I do not have to invoke perl each time. I have perl2exe but
> was wondering if there were other programs available.
> 

None of these options will accomplish your objective.  You'll still be
invoking perl.  It's just that perl will now be loaded from the .exe
you made instead of from perl.exe.  The purpose of these options is
to allow the file to be run when perl or required modules will
not be available in the run environment.  If you have the perl
environment installed they do nothing but waste disk space and I/O.


-- 
              Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


------------------------------

Date: Wed, 20 Sep 2006 21:40:03 +0200
From: =?ISO-8859-1?Q?S=E9bastien_Cottalorda?= <scottalorda_NOSPAM@libello.com>
Subject: Re: Server/client over a network
Message-Id: <45119913$0$31429$626a54ce@news.free.fr>

deadpickle a écrit :
> Sébastien Cottalorda wrote:
> 
>>deadpickle a écrit :
>>
>>>what I want to do is have a server on one machine and a client on the
>>>other. I want the client to connect to the server through a tcp network
>>>(over the internet). I have tried this and I constantly get the no
>>>socket error.
>>
>>Hi,
>>
>>On which side : client or server ?
> 
> 
> I believe I get it on the server side if I dont assign the value
> 'localhost' to LocalHost in IO::SOCKET::INET. And I get it on the
> client side whenever I connect to an ip address.

I don't know why you need to enter this parameter on the server side.
When you check client/server mechanisme on the same machine, you never 
got that - isn't it ?

>>If it's on the client side, you cannot manage to reach the server socket
>>through the router.
>>Try this:
>>#> telnet router 7890
>>that will try open a telnet session on the router port 7890
>>If your router forward this port, your request will go to the server on
>>which you want to pick the file.
> 
> tried it in terminal and got:
> Connecting to router...Could not open a connection to the host, on port
> 7890: Connect failed
> So I guess it did not forward anything.

You're right !

> 
>>Just enter FIL|namefile
>>Normaly you'll see something
> 
> Not sure what this is. Is this a line in the script?

If you manage to connect, with telnet program, on the server side, you 
should, normally receive nothing else than connected....
Still connected, type then, FIL|filename with your telnet client => then 
you'll receive something, which means that you're connected to the 
server program.

> 
>>NOTE: your client socket need to be open with the *router* and not with
>>the server (port forwarding case).
>>If you mean routing instead of port forwarding, then the client needs to
>>point to the *server* adress.
> 
> 
>  I mean port forwarding since it is easy to do. how can I open a port
> with the "router"?
> 
I don't know, it depends on your router itself.
Normally your router has 2 interfaces.
On the client side interface, make the 7890 port forward frames to 
server IP on port 7890.
That's it.

Hope this helps.

Sebastien


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9745
***************************************


home help back first fref pref prev next nref lref last post