RE: java to perl

2004-02-12 Thread Toby Stuart


 -Original Message-
 From: H. krishna [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 12, 2004 4:35 PM
 To: [EMAIL PROTECTED]
 Subject: java to perl
 
 
 Dear All,
 
 I have java program. I need to convert java to perl
 code. Any guidance is appreciated.
 
 Thanks in advance,
 
 Regards,
 balakrishnan, h.
 
 

What does the java program do?  
Chances are you can convert it to perl...and in much less lines.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl GUI ??

2004-02-12 Thread Toby Stuart

 -Original Message-
 From: Savinder Puri [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 12, 2004 7:12 PM
 Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Subject: Perl GUI ??
 
 
 Hi All,
 I'm writing a series of Perl script (+ shell scripting etc) for creating
Builds. The scripts are to run on Win32, Linux, AIX, Solaris boxes.
 For enhanced usability, I need to provide a GUI (essentially for parameter
input, probably extended to log display).
 What are the preferred GUI components... that plus easily into Perl ??
Also, is there any component that fits into ALL the above platforms ??
 I've looked at TCL/TK and WIN32:GUI... still considering the options.
 Please advise.
 Cheers, Savinder.
 

http://www.wxwindows.org/ is very good
and the perl interface for wxWindows is here
http://wxperl.sourceforge.net/download.html

 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Newbie Quick and Dirty GUI

2003-02-26 Thread Toby Stuart


 -Original Message-
 From: Daniel Bayerdorffer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 27, 2003 4:08 AM
 To: [EMAIL PROTECTED]
 Subject: Newbie Quick and Dirty GUI
 
 
 Hello,
   I'm a brand spankin' newbie, so please forgive any foolish 
 questions. I
 need to do some logfile manipulation where the user selects 
 log entries to
 move to another file. I understand everything I need to do as 
 far as file
 opening, closing, etc. My question, is there an easy way to 
 create a GUI
 interface for the user to select the log entries. Say from a 
 table, where
 they just double click on the entry they want to move? I know 
 I'll need to
 use some modules for this, but do I have to define every part of the
 interface, or can I draw the interface?
 
 Thank you,
 Daniel
 

You have a couple of choices for GUIs with Perl

- Tk (bundled with with ActivePerl ... not sure when this started)

- Win32::GUI (get it from http://dada.perl.it ... there's also a Win32::GUI
designer called the 'GUI Loft' or something google for it.)

- wxWindows (http://wxwindows.org/)


hth

toby
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Messagebox icons

2003-02-02 Thread Toby Stuart


 -Original Message-
 From: John Mason [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 03, 2003 7:19 AM
 To: [EMAIL PROTECTED]
 Subject: Messagebox icons
 
 
 Anyone know how to show different icons in a messageBox with 
 the -icon 
 parameter?
 
 I cant find anything in any of the Perl/Tk books.
 
 If  try -icon = 'error' or
 -icon = 'warning'   still get the information icon.
 
 I am running Perl 5.8 wit Tk under Win98.

The following works for me:

snip
use strict;
use warnings;

use Tk;

my $mw = new MainWindow;

my $repsonse = $mw-messageBox(-icon = 'error', -message = 'Hello World!',
-title = 'Hello World!', -type = 'AbortRetryIgnore');

MainLoop;
/snip
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Create and mail files

2003-01-19 Thread Toby Stuart

 -Original Message-
 From: TimeShadow [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 20, 2003 12:24 PM
 To: Perl List
 Subject: Create and mail files
 
 
 Hello Group,
  
 I have some questions on the types of modules I'll need to use to do the
following:
 

 Take input from a web form 

CGI.pm


 Mix the input with some html and save it as an html file in a new
directory based on the input 

Standard perl function ie. open, print etc


 Mail the html file as an attachment 

Mail::Sender


  
  
 I'm not sure what I'll need to use to complete this task.  Any advice is
greatly appreciated.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Search and replace

2002-11-06 Thread Toby Stuart
perl -ne s/TOTAL/T.TOT/g; print test.txt  test1.txt

it will pipe output into a new file called test1.txt.
granted not exactly what you wanted but *is* one line.

cheers

toby



 -Original Message-
 From: Allegakoen, Justin Devanandan
 [mailto:justin.devanandan.allegakoen;intel.com]
 Sent: Thursday, November 07, 2002 5:00 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Search and replace
 
 
 
 8---
  I am looking to search and replace a pattern within a 
 file(not on command
 line). That is, I have a file name within the Perl script and 
 I need to
 search for a pattern and replace the same.
 
 Eg. search for the pattern TOTAL and replace with T.TOT
 
 Can I do this in a single statement ? That is without doing a 
 open command
 on the file and then looking for the above pattern 
 line-by-line or a whole
 array and then outputting the replaced pattern into a new file name ?
   Is there something like sed in Perl ?
 8---
 
 Bottom line is no. You should read up on perlfaq5:
 How do I change one line in a file/delete a line
  in a file/insert a line in the middle of a file/append to 
 the beginning of a file?
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



FW: Search and replace

2002-11-06 Thread Toby Stuart
whoops, there i go again.  mis-read the question.  time for me to go home
now.

 -Original Message-
 From: Toby Stuart 
 Sent: Thursday, November 07, 2002 5:33 PM
 To: 'Allegakoen, Justin Devanandan'
 Cc: '[EMAIL PROTECTED]'
 Subject: RE: Search and replace
 
 
 perl -ne s/TOTAL/T.TOT/g; print test.txt  test1.txt
 
 it will pipe output into a new file called test1.txt.
 granted not exactly what you wanted but *is* one line.
 
 cheers
 
 toby
 
 
 
  -Original Message-
  From: Allegakoen, Justin Devanandan
  [mailto:justin.devanandan.allegakoen;intel.com]
  Sent: Thursday, November 07, 2002 5:00 PM
  To: [EMAIL PROTECTED]
  Subject: RE: Search and replace
  
  
  
  8---
   I am looking to search and replace a pattern within a 
  file(not on command
  line). That is, I have a file name within the Perl script and 
  I need to
  search for a pattern and replace the same.
  
  Eg. search for the pattern TOTAL and replace with T.TOT
  
  Can I do this in a single statement ? That is without doing a 
  open command
  on the file and then looking for the above pattern 
  line-by-line or a whole
  array and then outputting the replaced pattern into a new 
 file name ?
Is there something like sed in Perl ?
  8---
  
  Bottom line is no. You should read up on perlfaq5:
  How do I change one line in a file/delete a line
   in a file/insert a line in the middle of a file/append to 
  the beginning of a file?
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Crypt::CBC w/Crypt-DES (small correction)

2002-10-23 Thread Toby Stuart
problem solved.
thanks
toby

 -Original Message-
 From: Toby Stuart [mailto:toby.stuart;figtreesys.com.au]
 Sent: Wednesday, October 23, 2002 3:41 PM
 To: '[EMAIL PROTECTED]'
 Subject: FW: Crypt::CBC w/Crypt-DES (small correction)
 
 
 see corrections below
 
  -Original Message-
  From: Toby Stuart [mailto:toby.stuart;figtreesys.com.au]
  Sent: Wednesday, October 23, 2002 3:35 PM
  To: '[EMAIL PROTECTED]'
  Subject: Crypt::CBC w/Crypt-DES
  
  
  Hi All,
  
  I'm trying to encrypt/decrypt a text file using Crypt::CBC with DES.
  
  The encryption works fine but the decryption seems to yield 
  only the first
  few bytes of the original text.  I'm sure i'm missing 
  something simple.
  
  Any help appreciated.
  
  Example follows:
  
  enc.pl
  use strict;
  use Crypt::CBC;
  
  my $key = pack H16, 1122334455667788;
  my $cipher = new Crypt::CBC ($key, 'IDEA');
 
 my $cipher = new Crypt::CBC ($key, 'DES');
 
 
  
  my $in;
  open(IN,'e:\some_largish_text_file') || die $!;
  print $cipher-encrypt($in) while read(IN,$in,1024);
  print $cipher-finish;
  close(IN);
  /enc.pl
  
  
  
  dec.pl
  use strict;
  use Crypt::CBC;
  
  if (!@ARGV) { die Usage: perl $0 encrypted_file  
  decrypted_output_file; }
  
  my $key = pack H16, 1122334455667788;
  my $cipher = new Crypt::CBC ($key, 'IDEA');
 
 my $cipher = new Crypt::CBC ($key, 'DES');
 
  
  my $in;
  open(IN,$ARGV[0]) || die $!;
  print $cipher-decrypt($in) while read(IN,$in,1024);
  print $cipher-finish;
  close(IN);
  /dec.pl
  
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: FW: Crypt::CBC w/Crypt-DES (small correction)

2002-10-23 Thread Toby Stuart
thanks $Bill, i had to add binmode on $ifh and $ofh (see below) to make it
work


 -Original Message-
 From: $Bill Luebkert [mailto:dbe;wgn.net]
 Sent: Wednesday, October 23, 2002 4:56 PM
 To: Toby Stuart
 Cc: '[EMAIL PROTECTED]'
 Subject: Re: FW: Crypt::CBC w/Crypt-DES (small correction)
 
 
 Toby Stuart wrote:
  see corrections below
  
  
 -Original Message-
 From: Toby Stuart [mailto:toby.stuart;figtreesys.com.au]
 Sent: Wednesday, October 23, 2002 3:35 PM
 To: '[EMAIL PROTECTED]'
 Subject: Crypt::CBC w/Crypt-DES
 
 
 Hi All,
 
 I'm trying to encrypt/decrypt a text file using Crypt::CBC with DES.
 
 The encryption works fine but the decryption seems to yield 
 only the first
 few bytes of the original text.  I'm sure i'm missing 
 something simple.
 
 Any help appreciated.
 
 Example follows:
 
 enc.pl
 use strict;
 use Crypt::CBC;
 
 my $key = pack H16, 1122334455667788;
 my $cipher = new Crypt::CBC ($key, 'IDEA');
  
  
  my $cipher = new Crypt::CBC ($key, 'DES');
  
  
  
 my $in;
 open(IN,'e:\some_largish_text_file') || die $!;
 print $cipher-encrypt($in) while read(IN,$in,1024);
 print $cipher-finish;
 close(IN);
 /enc.pl
 
 
 
 dec.pl
 use strict;
 use Crypt::CBC;
 
 if (!@ARGV) { die Usage: perl $0 encrypted_file  
 decrypted_output_file; }
 
 my $key = pack H16, 1122334455667788;
 my $cipher = new Crypt::CBC ($key, 'IDEA');
  
  
  my $cipher = new Crypt::CBC ($key, 'DES');
  
  
 my $in;
 open(IN,$ARGV[0]) || die $!;
 print $cipher-decrypt($in) while read(IN,$in,1024);
 print $cipher-finish;
 close(IN);
 /dec.pl
 
 Try this one:
 
 use strict;
 use Crypt::CBC;
 use IO::File;
 
 my $key = pack H16, 1122334455667788;
 my $cipher = new Crypt::CBC ($key, 'DES');
 
 die Usage: perl $0 file-to-encrypt [encrypted_output_file]\n .
or:perl $0 -decrypt file-to-decrypt 
 [decrypted_output_file]\n .
  Second file arg defaults to STDIN for encrypt; STDOUT 
 for decrypt\n\n
if not @ARGV;
 
 my $decrypt = 0;
 for (my $ii = 0; $ii  @ARGV; ) {
   if ($ARGV[$ii] =~ /^--?de/) {
   $decrypt = 1;
   splice @ARGV, $ii, 1;
   next;
   }
   $ii++;
 }
 
 my $ifh = new IO::File;
 if (@ARGV) {
   $ifh-open($ARGV[0]) or die open $ARGV[0]: $!;
 } else {
   $ifh-open(STDIN) or die open $ARGV[0]: $!;
 }
 
 my $ofh = new IO::File;
 if (@ARGV  1) {
   $ofh-open($ARGV[1]) or die open $ARGV[1]: $!;
 } else {
   $ofh-open(STDOUT) or die open $ARGV[1]: $!;
 }
 
 my $in;
 if ($decrypt) {
   $cipher-start('decrypting');

binmode($ofh);

   print $ofh $cipher-crypt($in) while read $ifh, $in, 1024;
   print $ofh $cipher-finish;
 } else {
   $cipher-start('encrypting');

binmode($ifh);

   print $ofh $cipher-crypt($in) while read $ifh, $in, 1024;
   print $ofh $cipher-finish;
 }
 $ifh-close;
 $ofh-close;
 
 __END__
 
 
 -- 
,-/-  __  _  _ $Bill Luebkert   ICQ=162126130
   (_/   /  )// //   DBE Collectibles   Mailto:dbe;todbe.com
/ ) /--  o // //  http://dbecoll.tripod.com/ (Free 
 site for Perl)
 -/-' /___/__/_/_ Castle of Medieval Myth  Magic 
http://www.todbe.com/

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Crypt::CBC w/Crypt-DES

2002-10-22 Thread Toby Stuart
Hi All,

I'm trying to encrypt/decrypt a text file using Crypt::CBC with DES.

The encryption works fine but the decryption seems to yield only the first
few bytes of the original text.  I'm sure i'm missing something simple.

Any help appreciated.

Example follows:

enc.pl
use strict;
use Crypt::CBC;

my $key = pack H16, 1122334455667788;
my $cipher = new Crypt::CBC ($key, 'IDEA');

my $in;
open(IN,'e:\some_largish_text_file') || die $!;
print $cipher-encrypt($in) while read(IN,$in,1024);
print $cipher-finish;
close(IN);
/enc.pl



dec.pl
use strict;
use Crypt::CBC;

if (!@ARGV) { die Usage: perl $0 encrypted_file  decrypted_output_file; }

my $key = pack H16, 1122334455667788;
my $cipher = new Crypt::CBC ($key, 'IDEA');

my $in;
open(IN,$ARGV[0]) || die $!;
print $cipher-decrypt($in) while read(IN,$in,1024);
print $cipher-finish;
close(IN);
/dec.pl

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



FW: Send email in ActivePerl using SMTP

2002-06-11 Thread Toby Stuart

luxn.com is not running a mail service (well not on port 25 anyway)

change 
$optServer = 'luxn.com';
to
$optServer = 'mail.luxn.com';

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 7:00 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Send email in ActivePerl using SMTP


I tried the following to use SMTP to send email:


   use Net::SMTP;
   $optServer = 'luxn.com';
   $optFrom = [EMAIL PROTECTED];
   $optTo = [EMAIL PROTECTED];
   $smtp = Net::SMTP - new (luxn.com);
   $smtp - mail($optFrom);
   $smtp - to ($optTo);

   $smtp - data();

   Send the Header

   $smtp - datasend (To: [EMAIL PROTECTED]\n);
   $smtp - datasend (From: [EMAIL PROTECTED]\n);
   $smtp - datasend (\n);

   Send the body

   $smtp - datasend(hello, world!\n);
   $smtp - dataend();
   $smtp - quit;


It say:

Can't call method mail on an undefined value at 
mailtest.pl line 8

line 8 is:$smtp - mail($optFrom);

I tried: $smtp - mail('[EMAIL PROTECTED]'); it did not help.

What might be wrong here?


Thanks,
Yi Zhang 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Send email in ActivePerl using SMTP

2002-06-11 Thread Toby Stuart

http://www.faqs.org/rfcs/rfc2487.html

-Original Message-
From: Geoff Collins [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 1:38 PM
To: [EMAIL PROTECTED]
Subject: RE: Send email in ActivePerl using SMTP


While thinking on this topic

Does anyone know how to achieve Authentication when connecting to an
SMTP server?
Thanks,
--geoff


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Toby Stuart
Sent: Wednesday, 12 June 2002 03:30
To: '[EMAIL PROTECTED]'
Subject: FW: Send email in ActivePerl using SMTP


luxn.com is not running a mail service (well not on port 25 anyway)

change 
$optServer = 'luxn.com';
to
$optServer = 'mail.luxn.com';

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 7:00 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Send email in ActivePerl using SMTP


I tried the following to use SMTP to send email:


   use Net::SMTP;
   $optServer = 'luxn.com';
   $optFrom = [EMAIL PROTECTED];
   $optTo = [EMAIL PROTECTED];
   $smtp = Net::SMTP - new (luxn.com);
   $smtp - mail($optFrom);
   $smtp - to ($optTo);

   $smtp - data();

   Send the Header

   $smtp - datasend (To: [EMAIL PROTECTED]\n);
   $smtp - datasend (From: [EMAIL PROTECTED]\n);
   $smtp - datasend (\n);

   Send the body

   $smtp - datasend(hello, world!\n);
   $smtp - dataend();
   $smtp - quit;


It say:

Can't call method mail on an undefined value at 
mailtest.pl line 8

line 8 is:$smtp - mail($optFrom);

I tried: $smtp - mail('[EMAIL PROTECTED]'); it did not help.

What might be wrong here?


Thanks,
Yi Zhang 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Starting other programs

2002-06-10 Thread Toby Stuart

how about a good old batch file.

-Original Message-
From: Sean Ahern [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 08, 2002 1:35 AM
To: [EMAIL PROTECTED]
Subject: Re: Starting other programs


At 10:11 07/06/2002 -0500, you wrote:
I have a question about kicking off another program from a Perl program.  I
have one Perl Program, and I need it to kick off 27 other programs, at
around the same time.  I do not need to talk to the programs again, so the
main program does not have to wait around for the children to finish. I
tried exec, but I could only get it to start one child.

Please Help!

Thanks,

The code I'm using is :

my $processCmdLine =  c:\\winnt\\system32\\cmd.exe \/c .$CmdArgs;

Win32::Process::Create($ProcessObj,
c:\\winnt\\system32\\cmd.exe,
$processCmdLine,
CREATE_NEW_PROCESS_GROUP,
NORMAL_PRIORITY_CLASS,
 .)

 SxA


---
Sean Ahern,
Computing Support Officer,
School of Television and Imaging,
Duncan of Jordanstone College,
13 Perth Rd, Dundee, DD1 4HT.
Tel : 0044(0)1382-345372
-

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Regular Expression

2002-05-05 Thread Toby Stuart

Hi Steve,

This may not be the most eficient way, but it seems to work.

Someone will undoubtedly offer another (probably better) way to do it.

hth

Toby

snip
my @numbers = qw(01 02 03 03 05 08 09 12 14 13 11 18 17 12 15 16 15 16 12 13
14 16 17 22 23 24 25 25 23 22 21 20);
my %counts;

occur_in_array(\@numbers);

sub occur_in_array
{
my $aRef = shift;

foreach (@$aRef)
{
if (!exists($counts{$_}))
{
$counts{$_} = 1;
}
else
{
$counts{$_}++;
}
}

}

while (($key,$value) = each %counts)
{
print $key = $value\n;
}
/snip

-Original Message-
From: steve silvers [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 06, 2002 10:51 AM
To: [EMAIL PROTECTED]
Subject: Regular Expression


I have seen a couple of good regular expression questions asked and 
answered. Now I have a question. This is probably easy but i'm stuck on it. 
All I want to do is take.


my @numbers = 
(01,02,03,03,05,08,09,12,14,13,11,18,17,12,15,16,15,16,12,13,14,16,17,22,23,
24,25,25,23,22,21,20); 
  so on, could be up to 99. Read them in and get a count of all the numbers.

How many 01 or 17 or 22 there are in the array. I saw an answer for doing 
this with single numbers such as 2897, but how with double numbers. The out 
put i'm looking for is similar.

one - however many times.
two - however many times.
...
...
twenty - however many times.
...
...

You get the picture :-)

Any help would be great.
Thanks in advance. Steve.

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: :FTP CONNECTION REFUSED ERROR

2002-04-30 Thread Toby Stuart

Hi Mike,

Have you tried running it with the Debug option set?

eg. 

my $ftp = new Net::FTP('some.host', Debug = 1);

This should at least give you some idea as to why the connection is refused
etc..

hth

toby


-Original Message-
From: Mike Reilley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 11:29 AM
To: 
Subject: NET::FTP CONNECTION REFUSED ERROR


I have an FTP PERL program that intermittently comes up with the error.
Can't build data connection. Connection refused.
If I immediately rerun the PERL program there is a good chance that it will
run successfully with out any changes.
Can some one explain to me what this error really means or possible a way to
avoid this error.
THANKS IN ADVANCE
All Help, Comments, Code Examples, Thoughts Greatly Appreciated. 

It has recently  come to my attention that some people consider my use of
uppercase letters in email as obnoxious, I would like to apologize but in
light of having lost 6 fingers and the use of a seventh that leaves me with
just a thumb and pinky on my left hand and only a thumb on my right hand.
Therefore nothing is meant or implied by my haphazard capitalization.


Mike Reilley
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Module for parsing INI files -- FOUND

2002-04-15 Thread Toby Stuart

Found one, Config::IniFiles
Seems i am blind :)


-Original Message-
From: Toby Stuart [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 3:56 PM
To: '[EMAIL PROTECTED]'
Subject: Module for parsing INI files


Hi All,

Anyone know of a module for parsing INI files?
I've searched CPAN for things like: INI, Ini, Win32::TieIni, TieIni etc etc.
Nothing!  Am i blind?  I would've thought this to exist.
Something that loads the whole INI into a hash would be ideal.  It has to
work with sections however.

If not, i guess i'll try knock one up.

TIA

t0by
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Module for parsing INI files

2002-04-14 Thread Toby Stuart

Hi All,

Anyone know of a module for parsing INI files?
I've searched CPAN for things like: INI, Ini, Win32::TieIni, TieIni etc etc.
Nothing!  Am i blind?  I would've thought this to exist.
Something that loads the whole INI into a hash would be ideal.  It has to
work with sections however.

If not, i guess i'll try knock one up.

TIA

t0by
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: perl ping?

2002-03-19 Thread Toby Stuart

Why not use the Net::Ping module.  Example follows:

snip
#!perl.exe -w

use strict;
use Net::Ping;

my $host = 'blah';
my $timeout = 15;

my $p = new Net::Ping(icmp);

if ($p-ping($host,$timeout)) {
print Host is contactable.\n;
}
else {
print Host is NOT contactable.\n;
}

$p-close();
/snip

hth

t0by

-Original Message-
From: Tim Rhodes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 9:29 AM
To: [EMAIL PROTECTED]
Subject: perl ping?


i was just wondering how to write a perl ping script. i wrote one and 
couldn't figure out why it isn't working. this is what i have:

===

#!/usr/bin/perl
@results = `ping @ARGV[0]`;
print @results;
exit;

===

thank you!
Tim.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: No referrer

2002-03-04 Thread Toby Stuart

sounds like hack attempts.  probably proxy chaining/switching.

-Original Message-
From: TimeShadow [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: No referrer


I am having a problem with a user trying to access a formmail.pl script on a
Linux server.

I have a cgi script that alerts me when a user tries to connect to a file
that doesn't exist (ie. broken links).   For a few months now, a user has
been trying to access formmail.pl in my cgi-bin.  Formmail.pl was installed
to cgi-sys by my hosting company so the user is trying for nothing.

My script is suppose to tell me the referring url as well.  With this
person/persons, there has not ever been a referrer.  The ip and host is
always different and from all over the world.  This makes me think it is
coming from a submission form of some sort.  Here is one thing that is
always constant:

HTTP_USER_AGENT: Gozilla/4.0 (compatible; MSIE 5.5; windows 2000)

and most of the time this:

SERVER_PROTOCOL: HTTP/1.1Content-Type: application/x-www-form-urlencoded

My question is:  Is there a way I can find out where this is coming from?
Tracing the ip and host has been no help.  There has never been a referrer.
Any ideas?

James

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: multitasking - listening to a socket while remaining interactive or doing other tasks

2002-02-17 Thread Toby Stuart



Sounds 
very similar to this (different modules but problem seems 
same)...

ps. i 
rec'd this a couple of weeks back

t0by



Trisha Adams wrote: Wed 30/01/2002 9:11 PM
 I am very new to perl, so please 
excuse me if this is a 'newbie
 question.' I was recently trying 
to make a bot for irc using net::irc.
 I also made a gui interface for it 
using win32::gui. However,
 everytime I try to combine gui 
windows and the irc code, the program
 doesn't work. It works until I 
tell it $irc-start; or $W-Show().
 Do these two libraries conflict 
with each other or is there some way I
 can use a gui interface and 
connect with net::irc?
yes, the two libraries "conflict" with 
each other, at a conceptual level:
they're both event-based. when you call 
$irc-start, Net::IRC takes the
control of your program flow and calls 
handlers when it feels the need (eg.
when something happens on the 
connection).
Win32::GUI does pretty much the same. 
when you call $W-Dialog(), it takes
the control flow and calls events when 
it feels the need (eg. when you
interact with the GUI).
there are 2 possible solutions: the 
first, and better, but harder to reach,
is to resort to some kind of 
multitasking (eg. let Net::IRC and Win32::GUI
run in parallel and communicate each 
other).
the worst, but easier, solution, is to 
let one of the two modules do its
stuff only in the "spare time" of the 
other one. of course, when one of the
two modules is actively working on 
something, the other one will be freezed.
so while you're trasferring data over 
the IRC channel, the GUI will hang up,
and while you're doing something on 
your window, the IRC communication will
be paused. this is suboptimal in 
principle, but feel free to do your tests
and decide if the lag it's 
acceptable.
quoted from the Net::IRC 
documentation:
If you're tying Net::IRC into another 
event-based module, such as
perl/Tk, there's a nifty do_one_loop() 
method provided for your
convenience. Calling 
$irc-do_one_loop() runs through the IRC.pm event
loop once, hands all ready filehandles 
over to the appropriate handler
subs, then returns control to your 
program.
do_one_loop() is the way to go 
(Win32::GUI is, in fact, another event-based
module). take a look at 
Win32::GUI::Timer, and add a Timer event to your
window that will call Net::IRC 
do_one_loop() repeatedly.

cheers,
Aldo
__END__
$_=q,just perl,,s, , another ,,s,$, 
hacker,,print;

  -Original Message-From: John V. Pataki 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, February 18, 2002 8:35 
  AMTo: perl-win32-users@listserv. ActiveState. 
  comSubject: multitasking - listening to a socket while remaining 
  interactive or doing other tasks
  I am trying to 
  write an perl/Tk application that will allow user interaction while at the 
  same time monitoring a socket for other apps that want to talk to 
  it.
  I seem to be able 
  to do either or... 
  
  I can write a 
  simple server to listen to the socket as in the example 
  below
  
  (examples from 
  O'reilly)
  -
  use Socket;use 
  Carp;sub logmsg { print "@_ at ", scalar localtime, "\n" 
  }
  
  my $port = shift 
  || 2345;my $proto = getprotobyname('tcp');
  
  socket(Server, 
  PF_INET, SOCK_STREAM, $proto) or die "socket: $!";setsockopt(Server, 
  SOL_SOCKET, SO_REUSEADDR, pack("l", 
  1)) 
  or die "setsockopt: $!";bind(Server, sockaddr_in($port, INADDR_ANY)) or 
  die "bind: 
  $!";listen(Server,SOMAXCONN) 
  or die "listen: $!";
  
  logmsg "server 
  started on port $port";my $paddr;$SIG{CHLD} = 
  \REAPER;
  
  for ( ; $paddr = 
  accept(Client,Server); close Client) { my($port,$iaddr) 
  = sockaddr_in($paddr); my $name = 
  gethostbyaddr($iaddr,AF_INET); logmsg "connection from 
  $name [", 
   
  inet_ntoa($iaddr), "] at port $port"; print Client 
  "Hello there, $name, it's now ", 
   
  scalar localtime, "\n";}
  -
  
  
  or even a simpler 
  one like this
  
  
  
  
  use 
  IO::Socket;$sock = new IO::Socket::INET (LocalHost = 
  'localhost', 
  LocalPort = 
  1200, 
  Proto = 
  'tcp', 
  Listen = 
  5, 
  Reuse = 
  1 
   
  );die "Socket could not be created. Reason: $!" unless $sock;while 
  ($new_sock = $sock-accept()) { while (defined ($buf 
  = $new_sock)) { print 
  $buf; }}close ($sock);
  
  -
  
  and I have written 
  several perk/Tk apps that do various items.
  
  But once, I add 
  the socket listening code to the perl/Tk app... I am 
  locked.
  Is there a way to 
  have the same app listen to a socket and remain unlocked to do other 
  tasks?
  
  It seems to me it 
  would involve somehow making the listen or accept commands operate in an eval 
  block or something.
  But I haven't 
  gotten that to work yet.
  
  Thanks for any 
  help,
  
  John
  
  
  


RE: Table or TableMatrix

2002-02-17 Thread Toby Stuart



here's 
a little script which uses Tk::Table (amongst other things) 
:-

#!perl.exe -w

use 
strict;use Tk;use Tk::Table;use Net::Ping;

my 
($mw,$table,$txtHost,$cmdPing,$txtStatus,$status);

$mw = 
new MainWindow;

$table 
= $mw-Table(-columns = '2',-rows = 
'4',-scrollbars = '0')-pack;

$txtHost = $mw-Entry(-width = 
'30');

$status = "Idle ...";$cmdPing = 
$mw-Button(-text = 'Ping',-command = 
sub{ping_host($txtHost)});

$txtStatus = $mw-Label(-textvariable 
= \$status);

$table-put(0,0,"Host");$table-put(0,1,$txtHost);

$table-put(1,1,$cmdPing);$table-put(2,1,$txtStatus);

MainLoop;

sub ping_host($){my $host = 
shift;my $p = new Net::Ping("icmp");$status = "Attempting to 
ping ...";if ($p-ping($host-get)) { $status = $host-get . 
" is reachable."; 
}else 
{ $status = $host-get . " is NOT reachable."; 
}$p-close();undef $p;#$status = "Idle 
...";}

  -Original Message-From: Mike DeWolfe 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, February 18, 2002 4:50 
  AMTo: [EMAIL PROTECTED]Subject: 
  TK: Table or TableMatrix
  Does anyone have an example of Tk::Table, 
  Tk::TableMatrix or Tk::TableMatrix::Spreadsheet available? The code from the 
  synopsis on these is a dead-end and it's looking for INC not referenced in the 
  documentation.
  
  Thanks in advance,
  
  Mike 
DeWolfe


RE: Handling Japanese characters with Perl

2002-02-07 Thread Toby Stuart




this 
may help

http://examples.oreilly.com/cjkvinfo/perl/svpm99.pdf
-Original Message-From: 
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Friday, February 
08, 2002 3:46 PMTo: [EMAIL PROTECTED]; 
[EMAIL PROTECTED]Subject: Handling Japanese 
characters with Perl
My apologies if 
  this is a duplicate message (I think the first one never went out) and if 
  this is not the right lists to post this but I will appreciate if anybody 
  who has some experience with handling Japanese strings with Perl will 
  provide me with some direction. I have a text file that contains 
  English (ASCII) and Japanese (Shift JIS and EUC-JP) characters. I want to 
  match certain Japanese characters. It seems that the normal pattern 
  matching doesn't work with Japanese characters (or does it?) Is there a 
  package for processing Japanese? I read I18l::Collate but I could not figure 
  how to set the locale etc.. Actually, Perl could not even find the 
  package. Is this the right direction? Any sites/manuals where I can get 
  some assistance? Does anybody have any sample code? Thanks, 
  --tassos 


RE: what is this variable/value anyway?

2001-12-11 Thread Toby Stuart

ref() is the beast u require.


 Toby J Stuart
 Senior Web Developer
 Figtree Systems P/L
 http://www.figtreesys.com.au
 mailto:[EMAIL PROTECTED]

 -Original Message-
 From: Edward G. Orton [SMTP:[EMAIL PROTECTED]]
 Sent: Sunday, December 09, 2001 10:11 AM
 To:   Perl-Win32-Users Mailing List
 Subject:  what is this variable/value anyway?
 
 I dimly remember that there is a function in perl which will
 tell you if a variable is a scalar, array, or hash. I tried
 perldoc, and a number of other things, but can't for the life of
 me remember what it was, or where I used it before.
 
 Suggestions?
 
 ego
 Edward G. Orton, GWN Consultants Inc.
 Phone: 613-764-3186, Fax: 613-764-1721
 email: [EMAIL PROTECTED]
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: want to make exe

2001-12-11 Thread Toby Stuart

www.indigostar.com


 -Original Message-
 From: thiyag [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, December 12, 2001 2:40 PM
 To:   [EMAIL PROTECTED]
 Subject:  want to make exe
 
 i have written perl scripts using perl/tk and perl wld someone suggest me
 how to make exeout of this code so that it can be used in machines which
 dosent have perl/tk module installed
 
 thanks
 
 regards
 
 thiyag
 
   _  
 
 Get Your Private, Free E-mail from Indiatimes at
 http://email.indiatimes.com
 Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from
 http://www.planetm.co.in 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Re: Numbers in perl

2001-05-09 Thread Toby Stuart

$number = 455368900;

print str2ssn($number);

sub str2ssn
{
my $n = shift;
return undef if length($n) != 9; #assuming an SSN is always 9 chars
(less the dashes '-') ... i've no idea ... [t0by]
$n =~ m/^(\d{3})(\d{2})(\d{4})$/;
return $1 . - . $2 . - . $3
}

hth

t0by

 -Original Message-
 From: Mark [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, May 09, 2001 9:05 AM
 To:   Lee Goddard; Ron Hartikka; perl win32 users
 Subject:  Re: Re: Numbers in perl
 
 Guys,
 I have a question kind of along these lines. If I have a number, string,
 that I extract from the dB using DBI and CGI.pm like 455368900 (ssn) which
 I am using as a unique identifier but also need to display on a report.
 And need to insert the dashes xxx-xx- to format the number properly in
 SSN format, what would be the best way to do it? Pattern matching? A
 regular expression? I am a bit deficient in this area and would appreciate
 any example help at all.
 
 Mark Bergeron
 
 -Original Message-
 From: Lee Goddard[EMAIL PROTECTED]
 To: Ron Hartikka[EMAIL PROTECTED], perl win32
 users[EMAIL PROTECTED]
 Date: Tue May 08 08:25:15 PDT 2001
 Subject: Re: Numbers in perl
 
 Thanks, got there too: re-assignment
 
 Thanks again,
 lee
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of
 Ron
  Hartikka
  Sent: 08 May 2001 14:46
  To: perl win32 users
  Subject: RE: Numbers in perl
 
 
  When you compute your sum this way, adding to an accumulating
  sum, the error
  usually accumulates too.
 
  It's like trying to measure a field with a pocket ruler instead of a
  surveyor's tape.
 
  If you let it go to, say 3200, your code prints 3199.819.
 
  This code does the same thing your code does without ever accumulating
  error:
 
  my $start = 1;
  my $sum = 1;
  my $i = 0;
 
  while ($sum  32){
 print \t$sum\n;
 $sum = $start + $i++ * 0.1;
  }
  __END__
 
  prints
 
 5.8
 5.9
 6
 6.1
 6.2
 6.3
 6.4
 ...
 3199.9
 3200
 
  Here, Perl accumulates the sum in $i incrementing by 1 in this
  code without
  accumulating error. It also works if you increment by .125 and some
 other
  numbers, too. Any power of 2, I think.
 
  Formatting the output, as perlfaq4 suggests, hides accumulating errors
 in
  many (most?, nearly all?) situations. If you're sure formatting will do
 it
  in your case, fine. In some programs, though, you _have_ to manage your
  errors.
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of
 Lee
  Goddard
  Sent: Tuesday, May 08, 2001 6:42 AM
  To: Perl_Users
  Subject: Numbers in perl
 
 
  my $i = 1;
  while ($i  32){
 print \t$i\n;
 $i += 0.1;
  }
  __END__;
 
  Outputs:-
 
 5.8
 5.9
 6
 6.1
 6.19
 6.29
 6.39
 
 
  But why?  Is there something I can do to get the expected results?
 
  Thanks in anticipation
  Lee
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
 
 From the end of the world to your town
 ___
 GO.com Mail
 Get Your Free, Private E-mail at http://mail.go.com
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: very basic TK ?

2001-05-09 Thread Toby Stuart

i think it's

use Tk;
^
see the little 'k'


 -Original Message-
 From: Gregg Martinson [SMTP:[EMAIL PROTECTED]]
 Sent: Thursday, May 10, 2001 4:41 AM
 To:   [EMAIL PROTECTED]
 Subject:  very basic TK ?
 
 Hello,  
 I have been playing with TK today...reading the O'Reilly book on the
 subject, and am now trying to work through some of the examples. I have
 typed verbatim the hello world program.  It compiles and executes, but
 quits before any GUI shows on the screen.  I'm sure that this is a
 ridiculouly easy thing to fix, but I can't figure it out.  Here's the
 script
 ===
 #! /usr/bin/perl
 use TK;
 my $mw=MainWindow-new;
 $mw-title('Hello world');
 $mw-Button(-text='done',-command=sub{exit})-pack;
 MainLoop;
 ===
 Perl spins, and then returns me to the console prompt.  What gives? TIA
 gregg
   
 
 
 
 
 
 __
 D O T E A S Y - Join the web hosting revolution!
  http://www.doteasy.com
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: setting perl interpreter for asp, perl 5.6.x

2001-04-16 Thread Toby Stuart

what's the error?  any example code?
you do know that %@ perlscript really looks like %@ LANGUAGE="PerlScript"
% ... i guess you were abbreviating it.

t0by


 -Original Message-
 From: john z [SMTP:[EMAIL PROTECTED]]
 Sent: 17/04/2001 12:31
 To:   [EMAIL PROTECTED]
 Subject:  setting perl interpreter for asp, perl 5.6.x
 
 i wonder if somebody knows how to fix the following. when i run an asp, it
 
 seems that the %@ perlscript tags get ignored. i know that perlscript is
 
 running ok, cause the code wrapped with script perscript runat= server 
 run properly.  i even tried the samples under /eg/aspsamples and got
 bombed.
 
 the install was with defaults. i carefully checked for the mappings, 
 perscript etc.
 
 where else should i look. i know its something dumb that ive done (or
 didnt 
 do). but it escapses me.
 
 tks
 john z.
 [EMAIL PROTECTED]
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: setting perl interpreter for asp, perl 5.6.x

2001-04-16 Thread Toby Stuart

maybe you could try something simpler, say;

%@ LANGUAGE="PerlScript" %
% $Response-Write("Hello World !"); %

try running this.  should simply print "Hello World !" to your browser.

t0by

 -Original Message-
 From: john z [SMTP:[EMAIL PROTECTED]]
 Sent: 17/04/2001 12:54
 To:   Toby Stuart
 Subject:  RE: setting perl interpreter for asp, perl 5.6.x
 
 hi toby:
 i was running, for exampke, /eg/aspsamples/dumpvars.asp and got no 
 variables listed. all the normal html stuff came over- just no values.
 
 i tried other samples, and same thing. no http errors. just no results.
 
 
 At 12:33 PM 4/17/01 +1000, you wrote:
 what's the error?  any example code?
 you do know that %@ perlscript really looks like %@
 LANGUAGE="PerlScript"
 % ... i guess you were abbreviating it.
 
 t0by
 
 
   -Original Message-
   From: john z [SMTP:[EMAIL PROTECTED]]
   Sent: 17/04/2001 12:31
   To:   [EMAIL PROTECTED]
   Subject:  setting perl interpreter for asp, perl 5.6.x
  
   i wonder if somebody knows how to fix the following. when i run an
 asp, it
  
   seems that the %@ perlscript tags get ignored. i know that
 perlscript is
  
   running ok, cause the code wrapped with script perscript runat=
 server
   run properly.  i even tried the samples under /eg/aspsamples and got
   bombed.
  
   the install was with defaults. i carefully checked for the mappings,
   perscript etc.
  
   where else should i look. i know its something dumb that ive done (or
   didnt
   do). but it escapses me.
  
   tks
   john z.
   [EMAIL PROTECTED]
  
   ___
   Perl-Win32-Users mailing list
   [EMAIL PROTECTED]
   http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
 
 tks
 john z.
 [EMAIL PROTECTED]
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Beginner's problems

2001-03-14 Thread Toby Stuart

incorrect!

chomp $word;

not

$word =~ chomp $word ;

 -Original Message-
 From: Bellenger, Bruno (Paris) [SMTP:[EMAIL PROTECTED]]
 Sent: 15/03/2001 12:29
 To:   [EMAIL PROTECTED]
 Subject:  RE: Beginner's problems
 
 
 To stay closer to your code, this works : 
 
 open(IN, "words.txt");
 while(IN){
 $word = $_ ;
 $word =~ chomp $word ;
 print "$word and $word\n";
  }
 
 
 The way you did it assigned chomp's return code to $word, 
 not the content of $_
 
 To avoid this, you must write 
 
 $word =~ chomp $word ;
 and not 
 $word  =  chomp $word ;
 
 
 _
 Bruno Bellenger
 Sr. Network/Systems Administrator 
 
   -Original Message-
   From:   BP Jonsson [SMTP:[EMAIL PROTECTED]]
   Sent:   mercredi 14 mars 2001 14:03
   To: [EMAIL PROTECTED]
   Subject:Beginner's problems
 
   Hi,
 
   I'm a Perl beginner who has problems with things that according to
 the 
   literature should be quite straightforward.  Suppose that I have
 this program:
 
open(IN, "words.txt");
while(IN){
$word = chomp;
print "$word and $word\n";
}
 
   If I the file "words.txt" contains the three lines
fred
barney
dino
   then this program should print out
fred and fred
barney and barney
dino and dino
 
   But all I get is a single digit "1"!
 
   WTH is going on?
 
   TIA,
 
   /BP 8^)
   --
   B.Philip Jonsson mailto:[EMAIL PROTECTED] (delete X)
   
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users