[25423] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7668 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 18 11:10:31 2005

Date: Tue, 18 Jan 2005 08:10:25 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 18 Jan 2005     Volume: 10 Number: 7668

Today's topics:
    Re: how to skip to a certain loop with debugging option <hendrik_maryns@despammed.com>
        Kalender programm <chris@sunderhauf.net>
    Re: Kalender programm <chris@sunderhauf.net>
    Re: Kalender programm <mritty@gmail.com>
    Re: Kwik Q <tadmc@augustmail.com>
    Re: Low level data manipulation in Perl <tadmc@augustmail.com>
    Re: MAP Question <nobull@mail.com>
    Re: MAP Question <phaylon@dunkelheit.at>
    Re: MAP Question <georgekinley@hotmail.com>
        newbie question about documentation <mikael.petterson@ericsson.se>
    Re: newbie question about documentation <1usa@llenroc.ude.invalid>
    Re: Perl 5.6.0 Compatible With Windows 2003? <nobull@mail.com>
    Re: Perl CGI script to emulate a shell command line win <tadmc@augustmail.com>
    Re: Perl error <tadmc@augustmail.com>
    Re: Print question <tadmc@augustmail.com>
        similar articles algorithm based on numeric indexing of julie_smith@operamail.com
    Re: similar articles algorithm based on numeric indexin <noreply@gunnar.cc>
        simple encryption/decryption <_nospam_stigerikson@yahoo.se>
    Re: simple encryption/decryption <josef.moellers@fujitsu-siemens.com>
        telnet timed out <mikael.petterson@ericsson.se>
    Re: wildcard the port in bind (Michael Fuhr)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 18 Jan 2005 13:14:11 +0100
From: Hendrik Maryns <hendrik_maryns@despammed.com>
Subject: Re: how to skip to a certain loop with debugging option perl -d
Message-Id: <MtSdnZkYDt4PYHHcRVnyjQ@scarlet.biz>

Bob Walton schreef:

> Hendrik Maryns wrote:
> 
>> Hi,
>>
>> i've been reading perldebut and it already helped me solving that 
>> annoying warning that kept occurring, but not on the most efficient 
>> way: I had to skip through 61 executions of a loop before reaching it!
>>
>> So I was wondering: is there something like the c option that skips 
>> through /N/ iterations of a loop, before stopping at the breakpoint 
>> again (which is inside the loop, obviously).  I didn't find anything 
>> like that described in perldebug, so this time I thought I'd dare 
>> asking  (I started to read the guidelines indeed:-p)
>>
>> Cheers, H.
> 
> 
> Well, the "b" (break) debugger command has an optional third argument 
> which is a condition that must be true for the break to occur.  So, for 
> example:
> 
> for(0..50){
>    print "$_\n";
> }
> 
> can be broken on the iteration when $_ is 10 with:
> 
> b 2 $_==10
> c
> 
> For example:
> 
> D:\junk>type junk513.pl
> for(0..50){
>         print "$_\n";
> }
> 
> D:\junk>perl -d junk513.pl
> 
> Loading DB routines from perl5db.pl version 1.25
> Editor support available.
> 
> Enter h or `h h' for help, or `perldoc perldebug' for more help.
> 
> main::(junk513.pl:1):   for(0..50){
>   DB<1> b 2 $_==10
>   DB<2> c
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> main::(junk513.pl:2):           print "$_\n";
>   DB<2> x $_
> 0  10
>   DB<3> q
> 
> D:\junk>
> 
> Does that help?

Yes, perfect, thanks (it might seem a strange question, but it is 
because the problem wasn't in the code, but in the input data.  Of 
course I slightly changed the code to catch that...)
H.


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

Date: Tue, 18 Jan 2005 16:34:16 +0100
From: =?ISO-8859-1?Q?Christoph_S=FCnderhauf?= <chris@sunderhauf.net>
Subject: Kalender programm
Message-Id: <csj9sk$o2t$1@online.de>

Hello
I#m new to Perl.
I started to write a programm which will tell you the day of the wekk if 
you tell it the first day in the year.
But somehow it doesnt work. My Shell (I use SuSE Linux) always says 
there is an syntax-error, but there isnt any.
could anyone please help me?
thanks,
Christoph


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

Date: Tue, 18 Jan 2005 16:37:39 +0100
From: =?ISO-8859-1?Q?Christoph_S=FCnderhauf?= <chris@sunderhauf.net>
Subject: Re: Kalender programm
Message-Id: <csja2v$o2t$2@online.de>

Christoph Sünderhauf wrote:
> Hello
> I#m new to Perl.
> I started to write a programm which will tell you the day of the wekk if 
> you tell it the first day in the year.
> But somehow it doesnt work. My Shell (I use SuSE Linux) always says 
> there is an syntax-error, but there isnt any.
> could anyone please help me?
> thanks,
> Christoph
sorry,
I forgot the script:




chdir $FindBin::Bin;

#variale des jahres und der monate
our @year = (1..365);
our @jan;
our @feb;
our @mar;
our @apr;
our @may;
our @jun;
our @jul;
our @aug;
our @sep;
our @oct;
our @nov;
our @dec;

#ask the first day
print "What is the first day in the year?\n(1 for Monday, 2 for 
Tuesday)...";

my $first = <stdin>;

my $firstday = &day_num($first);

$year[0] = $firstday;


print "Figuring out all the rest of days...";

&days($firstday);

print "Finished!\n";

print "Making the seperate Months...";

&split_months;

print "Finished!\n";

#~~~~~~~~~~~~~~~~~~~~~~~~~~~
#subs

#make the input to a number:
sub day_num
{
  my ($day) = @_;

  if ($day = "Monday")
  {return 1}
  else
  {
   if ($day = "Tuesday")
   {return 2}
   else
   {
    if ($day = "Wednesday")
    {return 3}
    else
    {
     if ($day = "Thursday")
     {return 4}
     else
     {
      if ($day = "Friday")
      {return 5}
      else
      {
       #if (day = "Saturday")
       #{return 6}
       #else
       #{
        if ($day = "Sunday")
        {return 7}
        else
        {
         return 6}

        #}
       }
      }
     }
    }
   }
  }  #end sub



#show the user somke days
sub show_days
{
  print "Which days do you want to know?\n";
  my $day = <stdin>;
   my $month = <stdin>;

  my $date = &date($day,$month);

  print "$day, $month is a $date\nAgain?";

  my $again = <stdin>;
  if ($again = "y")
  {&show_days;}
}


sub date
{
  my ($day,$month) = @_;

  my $date

  if ($month = "January")
  {
   $date = $jan[$day];
  }

  if ($month = "February")
  {
   $date = $feb[$day];
  }

  if ($month = "March")
  {
   $date = $mar[$day];
  }

  if ($month = "April")
  {
   $date = $apr[$day];
  }

  if ($month = "May")
  {
   $date = $may[$day];
  }

  if ($month = "June")
  {
   $date = $jun[$day];
  }

  if ($month = "July")
  {
   $date = $jul[$day];
  }

  if ($month = "August")
  {
   $date = $aug[$day];
  }

  if ($month = "September")
  {
   $date = $sep[$day];
  }

  if ($month = "October")
  {
   $date = $oct[$day];
  }

  if ($month = "Nevember")
  {
   $date = $nov[$day];
  }

  if ($month = "December")
  {
   $date = $dec[$day];
  }

return $date;

}


sub days
{
  my ($firstday) = @_;




  for my $el (1..364)
  {
   my $modo;
   $modo = ($el % 7);

   if ($modo+$firstday > 7)
   {$modo = $modo-7;}

   $year[$el] = ($modo + $firstday);
  }
}

sub split_months
{
  my $el; my $new;


  my $last = 0 ;
  my $next = 30;

  for $el ($last..$next)
  {
   $jan[$el] = $year[$el];
  }
  $last = (1 + $next);
  $next = ($next + 28);

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $feb[$new] = $year[$el];
  }

  $last = (1+$next);
  $next = ($next + 31);

  for $el ($last..$last)
  {
   $new = ($el - $last);
   $mar[$new] = $year[$el];
  }

  $last=($naxt+1);
  $next = ($next + 30);

   for $el ($last..$next)
  {
   $new=$el-$last;
   $apr[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+31;

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $may[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+30;

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $jun[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+31;

  for $el ($last..$next)
  {
   $new=$el-$last;
   $jul[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+31;

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $aug[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+30;

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $sep[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+31;

  for $el ($last..$next)
  {
   $new=$el-$last;
   $oct[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+30;

  for $el ($last..$next)
  {
   $new = ($el - $last);
   $nov[$new] = $year[$el];
  }

  $last = $next+1;
  $next=$next+31;
  for $el ($last..$next)
  {
   $new=$el-$last;
   $oct[$new] = $year[$el];
  }



}


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

Date: Tue, 18 Jan 2005 15:47:32 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Kalender programm
Message-Id: <ocaHd.3986$hC2.2834@trndny04>

"Christoph Sünderhauf" <chris@sunderhauf.net> wrote in message
news:csja2v$o2t$2@online.de...
> Christoph Sünderhauf wrote:
> > Hello
> > I#m new to Perl.
> > I started to write a programm which will tell you the day of the
wekk if
> > you tell it the first day in the year.
> > But somehow it doesnt work. My Shell (I use SuSE Linux) always says
> > there is an syntax-error, but there isnt any.

1) No it doesn't.  It tells you there's a syntax error on some specific
line, which you've failed to inform us.

2) If perl tells you there's a syntax error, there's a syntax error.  By
definition, in fact.   It is both arrogant and contradictory to presume
you know the syntax of the Perl language better than the perl
interpreter knows the syntax of the Perl language.

You forgot
use strict;
use warnings;

> chdir $FindBin::Bin;
>
> #variale des jahres und der monate
> our @year = (1..365);

why are you declaring package variables?  Declare them lexically, with
'my' instead of 'our'.  And declare them when you need them, not at the
top of the script.

> our @jan;
> our @feb;
> our @mar;
> our @apr;
> our @may;
> our @jun;
> our @jul;
> our @aug;
> our @sep;
> our @oct;
> our @nov;
> our @dec;
>
> #ask the first day
> print "What is the first day in the year?\n(1 for Monday, 2 for
> Tuesday)...";
>
> my $first = <stdin>;

The name of the filehandle is STDIN, not stdin.

You're going to be comparing this variable to other strings, but you
forgot to remove the newline

chomp (my $first = <stdin>);

> my $firstday = &day_num($first);

Why are you using & to call functions?  Do you know what that does?
Unless you very specifically want the functionality it provides (you
don't), leave it out.  Read perldoc perlsub for more info.


>
> $year[0] = $firstday;
>
>
> print "Figuring out all the rest of days...";
>
> &days($firstday);
>
> print "Finished!\n";
>
> print "Making the seperate Months...";
>
> &split_months;
>
> print "Finished!\n";
>
> #~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #subs
>
> #make the input to a number:
> sub day_num
> {
>   my ($day) = @_;
>
>   if ($day = "Monday")

You just assigned $day to the string 'Monday'.  What you (probably)
wanted to do was compare to see if $day already contains 'Monday'

if ($day eq 'Monday')

(same for all following else clauses


>   {return 1}
>   else
>   {
>    if ($day = "Tuesday")

Why are you nesting all these else-if statements?  Just use the keyword
elsif:

if ($day eq 'Monday'){
  return 1;
} elsif ($day eq 'Tuesday){
  return 2;
} elsif ( .... #etc


>    {return 2}
>    else
>    {
>     if ($day = "Wednesday")
>     {return 3}
>     else
>     {
>      if ($day = "Thursday")
>      {return 4}
>      else
>      {
>       if ($day = "Friday")
>       {return 5}
>       else
>       {
>        #if (day = "Saturday")
>        #{return 6}
>        #else
>        #{
>         if ($day = "Sunday")
>         {return 7}
>         else
>         {
>          return 6}
>
>         #}
>        }
>       }
>      }
>     }
>    }
>   }  #end sub
>
>
>
> #show the user somke days
> sub show_days
> {
>   print "Which days do you want to know?\n";
>   my $day = <stdin>;
>    my $month = <stdin>;
>

Forgot to chomp again.


>   my $date = &date($day,$month);
>
>   print "$day, $month is a $date\nAgain?";
>
>   my $again = <stdin>;
>   if ($again = "y")

eq, not = again



<snipped remainder>

Fix all these errors, add use strict and use warnings, and then repost,
*with the FULL error message*


Paul Lalli



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

Date: Tue, 18 Jan 2005 07:09:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Kwik Q
Message-Id: <slrncuq2kq.2qk.tadmc@magna.augustmail.com>

ipellew@pipemedia.co.uk <ipellew@pipemedia.co.uk> wrote:


> Subject: Re: Kwik Q


Please put the subject of your article in the Subject of your article.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 18 Jan 2005 07:06:05 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Low level data manipulation in Perl
Message-Id: <slrncuq2dt.2qk.tadmc@magna.augustmail.com>

Leonard Challis <perl@lennychallis.co.uk> wrote:
> You don'tseem to get me straight...


Who is the "you" that you refer to?

The only attribution you've provided is yourself.

Are you talking to yourself?

Please provide an attribution when you quote someone, so that folks
can tell who said what.


> don't moan.


Consider following your own advice.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 18 Jan 2005 12:11:59 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: MAP Question
Message-Id: <csiu4j$607$1@sun3.bham.ac.uk>



George wrote:

>>>@Rfolder=map {/#(.*?)(?=:)/,$_} @getlistF;

> my mistake in understanding that RE was taking $_ as input ,

You are the second person[1] in a month to have been suffering from the
fancifull belief that the comma operator has the semantics of the =~
operator but with the operands reversed.

It seems improbable that two people could arrive a such an odd
misconception independantly.

Can you please tell us the source of this disinformation so that we can
stamp on it.

[1] 
http://groups-beta.google.com/group/comp.lang.perl.misc/msg/c315aa4228894ecd




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

Date: Tue, 18 Jan 2005 13:16:01 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: MAP Question
Message-Id: <pan.2005.01.18.12.16.01.2230@dunkelheit.at>

Brian McCauley wrote:

> It seems improbable that two people could arrive a such an odd
> misconception independantly.

Not? Without an eye for the perl-look it might seem that C<map> has two
arguments in your example ( map{/RE/,$_} !-> map(/RE/,$_) ).

I would file it under a bit too speedy reading..


p

-- 
http://www.dunkelheit.at/
I want, therefore I can.



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

Date: Tue, 18 Jan 2005 13:05:07 GMT
From: "George" <georgekinley@hotmail.com>
Subject: Re: MAP Question
Message-Id: <xn0dxelal4iyns000@news.europe.nokia.com>

Brian McCauley wrote:

> 
> 
> George wrote:
> 
> > > > @Rfolder=map {/#(.*?)(?=:)/,$_} @getlistF;
> 
> > my mistake in understanding that RE was taking $_ as input ,
> 
> You are the second person[1] in a month to have been suffering from
> the fancifull belief that the comma operator has the semantics of the
> =~ operator but with the operands reversed.
> 
> It seems improbable that two people could arrive a such an odd
> misconception independantly.
> 
> Can you please tell us the source of this disinformation so that we
> can stamp on it.
> 
> [1]
> http://groups-beta.google.com/group/comp.lang.perl.misc/msg/c315aa4228
> 894ecd

I am already embarrassed for asking such a stupid question, now you are
asking me to undress :-),
I read the article but there is difference: 
Here I did not understood the map properly so I thought that $_ has to
be needs to be defined inside the block/EXPR for regex to perform


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

Date: Tue, 18 Jan 2005 15:56:18 +0100
From: Petterson Mikael <mikael.petterson@ericsson.se>
Subject: newbie question about documentation
Message-Id: <csj7qh$a0n$1@newstree.wise.edt.ericsson.se>

Hi,

I can do:

perldoc -f <functioname>

to get man pages.

But how can I get man pages for Net::FTP functions?
I have the above module installed.

BR

//Mikael


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

Date: 18 Jan 2005 15:08:09 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: newbie question about documentation
Message-Id: <Xns95E26720AC3DEasu1cornelledu@132.236.56.8>

Petterson Mikael <mikael.petterson@ericsson.se> wrote in news:csj7qh$a0n$1
@newstree.wise.edt.ericsson.se:

> Hi,
> 
> I can do:
> 
> perldoc -f <functioname>
> 
> to get man pages.
> 
> But how can I get man pages for Net::FTP functions?


perldoc Net::FTP

See also:

perldoc perldoc

perldoc perltoc

Sinan


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

Date: Tue, 18 Jan 2005 13:25:19 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Perl 5.6.0 Compatible With Windows 2003?
Message-Id: <csj2e5$811$1@sun3.bham.ac.uk>

basis_consultant@hotmail.com wrote:

> I was unable to find a Website to confirm whether or not Perl v5.6.0 is
> compatible with Win 2003. Does anybody know?

In general yes, probably.  But then again nobody should be using 5.6.0!
   At the very least you should use 5.6.1.

What you are really asking is if there are any differences between NT4
and NT5.2 that broke anything in Perl 5.6.x (core or standard modules).

The answer is yes and given the size of Perl and the number of changes
from NT4 to NT5 it would be supprising if the answer was no.

> Also, any other ideas on solving Perl's 'unable to open temporary file
> at (eval 9)..' error would be greatly appreciated.

IO::File->new_tmpfile in Perl 5.6 was broken by NT5.0 and I've no reason
to suppose it is not in NT5.2.  This was fixed in Perl 5.8 but AFAIK
nobody ever back-ported the fix to 5.6.  This would not be trivial (I
looked) as a lot has changed in IO::* between 5.6 and 5.8.

It's not as simple as a straight permissions issue, it's something more
subtle than that.  Even granting excessively liberal rights to the
temporary directory does not seem to work arround the problem.

See my posting on the subject (last March) here:

http://groups-beta.google.com/group/comp.lang.perl.moderated/msg/f5bbc6c250407b9d

I advise you to use some other way to create temporary files or upgrade
to 5.8 or hire someone to fix IO::File->new_tmpfile in 5.6.




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

Date: Tue, 18 Jan 2005 09:20:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <slrncuqaae.3b3.tadmc@magna.augustmail.com>

Alain Star <2005+newstest@foobox.com> wrote:
> A. Sinan Unur wrote:
> 
> 
>:::: Script: http://www.cri.ch/perl/docs/cg0001.html
> 
>:: It occurs to me that there a lot of nutty people out there. You seem
>:: to be one of them by suggesting people install a Trojan horse
>:: accessible to anyone in the world on their hosting provider's
>:: machine.
>::
>:: Not nice.
>::
>:: perldoc perlsec
> 
> What a negative approach...


So when you said "Comments welcome!" you were just joking then?

Or did you mean instead "Comments that I want to hear are welcome"?


> The idea is to help, not to harm.


Exactly so.

What you propose has the potential to do vast harm.

Steering people away from doing it is helpful.

See if you can identify who in this thread is helping others and
who is hurting others.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 18 Jan 2005 06:59:01 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl error
Message-Id: <slrncuq20l.2qk.tadmc@magna.augustmail.com>

quartet <travisq@gmail.com> wrote:

> Sorry for the delay, I thought I would receive an email once i got a
> response to my question. 


Why did you think that?

This is Usenet.

Usenet is not email.

email is not Usenet.


> appears that the function, "KeyAttr=>'sku'" was need 


That is NOT a "function".


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 18 Jan 2005 07:13:05 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Print question
Message-Id: <slrncuq2r1.2qk.tadmc@magna.augustmail.com>

edgrsprj <edgrsprj@ix.netcom.com> wrote:

> The computer language being used is not the problem here.


Then don't abuse thousands of people around the world by posting
to a computer language newsgroup.


> If there were
> any groups interested in getting involved I would have heard from them long
> ago.


Proving that you are not a crackpot would go a long way towards
reversing that trend...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 18 Jan 2005 05:42:50 -0800
From: julie_smith@operamail.com
Subject: similar articles algorithm based on numeric indexing of all rows via columns in a table
Message-Id: <1106055770.397649.210730@z14g2000cwz.googlegroups.com>

Hi,
I have an articles table containing columns like
id,name,author,section,creationdate,description,longmatter, etc.
I am using mysql.

some of them are fixed value fields(enumerations)

like->section will have news,sports,politics etc...

while description will be a text field with any amount of arbitrary
text.

now I have 50000 articles under different sections.

I want to implement a "similar articles" feature.
By this I mean when an article is shown,
I want to display all the similar articles based on that article.(10
per page).

Now how do I calculate the similarity of 1 article with all the 50000
articles ?

I dont want articles from the same section only.
Since the search result has to be very fast,
Can I create some algorithm that will look through all the fields in
each row of the
articles table and assign a weight/checksum to it.

And then in the similar articles part I display all the articles wth a
+-5 difference in checksum with the
current displayed articles checksum ?

Thanks in advance,

Julie



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

Date: Tue, 18 Jan 2005 14:44:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: similar articles algorithm based on numeric indexing of all rows via columns in a table
Message-Id: <354im7F4iq2lbU1@individual.net>

julie_smith@operamail.com wrote:
> I want to implement a "similar articles" feature.
> By this I mean when an article is shown,
> I want to display all the similar articles based on that article.(10
> per page).
> 
> Now how do I calculate the similarity of 1 article with all the 50000
> articles ?
> 
> I dont want articles from the same section only.
> Since the search result has to be very fast,
> Can I create some algorithm that will look through all the fields in
> each row of the
> articles table and assign a weight/checksum to it.

Check out the CPAN module Algorithm::Diff.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Tue, 18 Jan 2005 15:27:58 +0100
From: stig <_nospam_stigerikson@yahoo.se>
Subject: simple encryption/decryption
Message-Id: <csj6h7$nc7$1@oden.abc.se>

hi.
which perl-module(s) can be used to implement very simple 
encryption/decryption of arbitrary length strings?
it does not need to very secure but must be able to encrypt and decrypt 
(not only one way).

for various reasons Crypt::Simple will not be a possible choice, are 
there any other modules that you can recommend?

many thanks
stig


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

Date: Tue, 18 Jan 2005 16:38:31 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: simple encryption/decryption
Message-Id: <csjaa1$46v$1@nntp.fujitsu-siemens.com>

stig wrote:
> hi.
> which perl-module(s) can be used to implement very simple=20
> encryption/decryption of arbitrary length strings?
> it does not need to very secure but must be able to encrypt and decrypt=
=20
> (not only one way).

If you do not require it to be "very secure", you do not require it to=20
bescure at all, so either use strong encryption or use no encryption at a=
ll.

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Tue, 18 Jan 2005 15:25:25 +0100
From: Petterson Mikael <mikael.petterson@ericsson.se>
Subject: telnet timed out
Message-Id: <csj60k$940$2@newstree.wise.edt.ericsson.se>

Hi,

I am using Net::Telnet module in perl to connect to a remote client.
I get a timeout for '$telnet->login($username, $password);'.

timed-out waiting for command prompt at ./telnet.pl line 15

Any ideas why?

I have tried with regular telnet and it works!

//Mikael


Script
-------------------------------------------
#!/vobs/cello/cade_struct/bin/perl -w

use Net::Telnet;

my $hostname = 'ws3196.rnd.ki.sw.ericsson.se';
my $username = 'eraonel';
my $password = 'test';


  my $telnet = new Net::Telnet ( Timeout=>30,
                 Errmode=>'die');


   $telnet->open($hostname);
   $telnet->login($username, $password);
   $telnet->waitfor('/login:.*$/');
   print $telnet->cmd('whoami');

This is how my telnet login looks like:
***************************************

Trying 147.214.201.190...
Connected to ws3196.
Escape character is '^]'.


SunOS 5.8

login:

****************************************


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

Date: 18 Jan 2005 08:42:20 -0700
From: mfuhr@fuhr.org (Michael Fuhr)
Subject: Re: wildcard the port in bind
Message-Id: <41ed2e5c$1_1@omega.dimensional.com>

"Alex Hart" <alex_the_hart@yahoo.com> writes:

> Is there any way to bind with a specific IP address, but wildcard the
> port? Something like INADDR_ANY, but for the port?

Bind to port 0 (zero) -- most operating systems will pick an ephemeral
port in that case.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

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 7668
***************************************


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