a question about @ISA

2012-04-09 Thread xiaolan
Hi, I just want to send email using MIME::Lite with Net::SMTP::SSL. But MIME::Lite is going only with Net::SMTP by default. So I searched and found a hack: use Net::SMTP::SSL; BEGIN { @MIME::Lite::SMTP::ISA = qw(Net::SMTP::SSL); } This does work, now I can send messages with SMTPs. But how does

Re: Help parsing tab delimited files

2012-04-09 Thread Dr.Ruud
On 2012-04-09 03:12, Tiago Hori wrote: Is there any way that I could parse a row at a time while ( $fh ) { $_ eq 'foo' and print $.:$_\n for split /\t/; } -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Re: a question about @ISA

2012-04-09 Thread 'lesleyb'
On Mon, Apr 09, 2012 at 04:13:36PM +0800, xiaolan wrote: Hi, I just want to send email using MIME::Lite with Net::SMTP::SSL. But MIME::Lite is going only with Net::SMTP by default. So I searched and found a hack: use Net::SMTP::SSL; BEGIN { @MIME::Lite::SMTP::ISA = qw(Net::SMTP::SSL); }

Re: a question about @ISA

2012-04-09 Thread Shlomi Fish
Hi xiaolan, On Mon, 9 Apr 2012 16:13:36 +0800 xiaolan practicalp...@gmail.com wrote: Hi, I just want to send email using MIME::Lite with Net::SMTP::SSL. But MIME::Lite is going only with Net::SMTP by default. So I searched and found a hack: use Net::SMTP::SSL; BEGIN {

Problems: UTF8 charset and print on line from data extract

2012-04-09 Thread Fabrizio Di Carlo
Hello to all, I'm very newbie of Perl but every I'm understanding how is powerful this language, but I have a problem: I'm using Perl with Selenium for scraping data (for a job) the code looks like this [code] use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use

Deleting Lines From File

2012-04-09 Thread ExecMan
Hi, We have a Perl script that sends out emails. It reads a sequential file and sends out the emails. The file is big, like 500,000 lines. Sometimes this process has gone down and it is a pain to see whom we've sent to and whom we have not. Is there a way within the script to remove the

stacked processing

2012-04-09 Thread Bryan Harris
Hello there! I love perl's ability to stack processing without intermediate variables, e.g. to read in a pipe, strip off commented lines, pull out column 5, and join, I can just do this: $txt = join , map { (split)[4] } grep { !/^#/ } ; What I haven't figured out is how to do a substitution

Re: stacked processing

2012-04-09 Thread Shlomi Fish
Hi Bryan, On Sun, 08 Apr 2012 00:08:48 -0500 Bryan Harris bryansli...@gmail.com wrote: Hello there! I love perl's ability to stack processing without intermediate variables, e.g. to read in a pipe, strip off commented lines, pull out column 5, and join, I can just do this: $txt =

Re: stacked processing

2012-04-09 Thread Dr.Ruud
On 2012-04-08 07:08, Bryan Harris wrote: I love perl's ability to stack processing without intermediate variables, e.g. to read in a pipe, strip off commented lines, pull out column 5, and join, I can just do this: $txt = join , map { (split)[4] } grep { !/^#/ }; What I haven't figured out

Re: Deleting Lines From File

2012-04-09 Thread Binish A.R
So these files contain email addresses or something else? In any case, you may store the line number of the last read email address in a separate file, say status.log. When the process starts, check for the existences of this file, and read the content ( may be last line or first line, depends

Re: Deleting Lines From File

2012-04-09 Thread Shlomi Fish
Hi ExecMan, On Thu, 5 Apr 2012 13:44:57 -0700 (PDT) ExecMan artme...@yahoo.com wrote: Hi, We have a Perl script that sends out emails. It reads a sequential file and sends out the emails. The file is big, like 500,000 lines. Sometimes this process has gone down and it is a pain to see

Re: stacked processing

2012-04-09 Thread Uri Guttman
On 04/08/2012 01:08 AM, Bryan Harris wrote: Hello there! I love perl's ability to stack processing without intermediate variables, e.g. to read in a pipe, strip off commented lines, pull out column 5, and join, I can just do this: $txt = join , map { (split)[4] } grep { !/^#/ }; What I

Re: Problems: UTF8 charset and print on line from data extract

2012-04-09 Thread Shlomi Fish
Hi Fabrizio, see below for my response. On Fri, 6 Apr 2012 03:30:46 -0700 (PDT) Fabrizio Di Carlo dicarlo.fabri...@gmail.com wrote: Hello to all, I'm very newbie of Perl but every I'm understanding how is powerful this language, but I have a problem: I'm using Perl with Selenium for

Re: a question about @ISA

2012-04-09 Thread 'lesleyb'
On Mon, Apr 09, 2012 at 12:59:04PM +0300, Shlomi Fish wrote: Hi xiaolan, On Mon, 9 Apr 2012 16:13:36 +0800 xiaolan practicalp...@gmail.com wrote: Hi, I just want to send email using MIME::Lite with Net::SMTP::SSL. But MIME::Lite is going only with Net::SMTP by default. So I

Re: Help parsing tab delimited files

2012-04-09 Thread Tiago Hori
Hi All, Thanks for all your inputs. Part of the problem I was having is that I was creating tab delimited files in excel and I forgot the excel uses a different way to create newlines, right? I remember having the same issue with MySQL. Now, i got it working! Is there way around this issue?

Re: Help parsing tab delimited files

2012-04-09 Thread Tiago Hori
Sorry guys, Another quick question: I got this from perlmonks: #!/usr/bin/perl -w use strict; my @desired_cols = qw(colname1 colname3); #order matters here # reads first line to get actual column names my $header_line = (DATA); my @actual_cols = split(/\s+/,$header_line); # get column number of

Re: foreach and next

2012-04-09 Thread Vyacheslav
My code my %attr = ( PrintError = 0, RaiseError = 0 ); my $dbh = DBI-connect($dsn, $user, $pass, \%attr); unless ($dbh) { next; } my $query = SHOW DATABASES; I use unless ($dbh) { next; } and this work fine. Thanks 09.04.2012 01:22, Jim Gibson написал: At 12:50 AM + 4/9/12, Vyacheslav

Re: foreach and next

2012-04-09 Thread Rob Dixon
On 09/04/2012 14:24, Vyacheslav wrote: My code my %attr = ( PrintError = 0, RaiseError = 0 ); my $dbh = DBI-connect($dsn, $user, $pass, \%attr); unless ($dbh) { next; } my $query = SHOW DATABASES; I use unless ($dbh) { next; } and this work fine. Thanks 09.04.2012 01:22, Jim Gibson написал:

Re: Help parsing tab delimited files

2012-04-09 Thread Jim Gibson
At 10:21 AM -0230 4/9/12, Tiago Hori wrote: Sorry guys, Another quick question: I got this from perlmonks: #!/usr/bin/perl -w use strict; my @desired_cols = qw(colname1 colname3); #order matters here # reads first line to get actual column names my $header_line = (DATA); my @actual_cols =

Template::Toolkit question

2012-04-09 Thread Manfred Lotz
Hi all, Let's say I use Template:Toolkit like this: -snip--- #! /usr/bin/perl use strict; use warnings; use Template; my $variables = { nrme = Manfred, }; my $cmd = 'Hi [% name %], how are you.'; my $template = Template-new(); $template-process(\$cmd,

Re: Use of SFTP::Foreign with backend processing and having problems ( not apparent within the code ) in getting remote SFTP to quit it's processes

2012-04-09 Thread Chris Charley
Wagner, David --- Sr Programmer Analyst --- CFS wrote in message I am running AS 5.10.1 on Windows XP SP3 and attempting to use sFTP within my processing communicating to MVS/IBM. What I am trying to do is to do so many gets, then undef the variable and re-login and to continue on to end of

Re: Template::Toolkit question

2012-04-09 Thread Brendan Gilroy
In before actually helpful people: This script with an added OR (viz. || ::ERR:Cannot print value::) works as you'd expect #! /usr/bin/perl use strict; use warnings; use Template; my $variables = { nrme = Manfred, }; my $cmd = 'Hi [% name || ::ERR:Cannot substitute variable:: %], how are

Re: Template::Toolkit question

2012-04-09 Thread Manfred Lotz
On Mon, 9 Apr 2012 20:28:14 +0200 Manfred Lotz manfred.l...@arcor.de wrote: Hi all, Let's say I use Template:Toolkit like this: -snip--- #! /usr/bin/perl use strict; use warnings; use Template; my $variables = { nrme = Manfred, }; my $cmd = 'Hi

Re: Use of SFTP::Foreign with backend processing and having problems ( not apparent within the code ) in getting remote SFTP to quit it's processes

2012-04-09 Thread Wagner, David --- Sr Programmer Analyst --- CFS
-Original Message- From: Chris Charley [mailto:char...@pulsenet.com] Sent: Monday, April 09, 2012 9:02 To: beginners@perl.org Subject: [Marketing Mail] Re: Use of SFTP::Foreign with backend processing and having problems ( not apparent within the code ) in getting remote SFTP to quit it's

Re: Help parsing tab delimited files

2012-04-09 Thread Tiago Hori
Hey Jim, Makes perfect sense now. Thanks. Just so I make sure I understand it correctly: So every time I use a while (FILEHANDLE) loop each line of input from the file gets assigned to $_ in each iteration of the loop? Cheers, Tiago On Mon, Apr 9, 2012 at 1:00 PM, Jim Gibson

Re: Help parsing tab delimited files

2012-04-09 Thread Jim Gibson
On 4/9/12 Mon Apr 9, 2012 12:22 PM, Tiago Hori tiago.h...@gmail.com scribbled: Hey Jim, Makes perfect sense now. Thanks. Just so I make sure I understand it correctly: So every time I use a while (FILEHANDLE) loop each line of input from the file gets assigned to $_ in each iteration

Re: regex

2012-04-09 Thread Somu
WOW!!! Still to see the world... Thanks :) On Mon, Apr 9, 2012 at 4:04 AM, John W. Krahn jwkr...@shaw.ca wrote: Somu wrote: Hello everyone... Hello, Thanks for the previous replies. I'm really improving! A new problem.. Check if the word begins with un or in and has exactly 5

Re: Template::Toolkit question

2012-04-09 Thread Uri Guttman
On 04/09/2012 02:28 PM, Manfred Lotz wrote: Hi all, Let's say I use Template:Toolkit like this: -snip--- #! /usr/bin/perl use strict; use warnings; use Template; my $variables = { nrme = Manfred, }; my $cmd = 'Hi [% name %], how are you.'; my $template =

Re: Template::Toolkit question

2012-04-09 Thread Jenda Krynicky
To: beginners@perl.org From: Manfred Lotz manfred.l...@arcor.de Subject:Template::Toolkit question Date sent: Mon, 9 Apr 2012 20:28:14 +0200 Hi all, Let's say I use Template:Toolkit like this:

Re: split

2012-04-09 Thread Matthew Bonner
Hi Anamika I know this thread has focussed on using split -- thought I'd add a regex powered version for reference/comparison. cheers Matthew use strict; use warnings; while (DATA) { my @keys; @keys = $_ =~ m/(NM_\d+)+/g; $_ =~ m/\:1\s+(.*)$/; print $_ =

Re: Help parsing tab delimited files

2012-04-09 Thread John W. Krahn
Jim Gibson wrote: On 4/9/12 Mon Apr 9, 2012 12:22 PM, Tiago Horitiago.h...@gmail.com scribbled: Hey Jim, Makes perfect sense now. Thanks. Just so I make sure I understand it correctly: So every time I use a while (FILEHANDLE) loop each line of input from the file gets assigned to $_ in

Re: split

2012-04-09 Thread John W. Krahn
Matthew Bonner wrote: Hi Anamika I know this thread has focussed on using split -- thought I'd add a regex powered version for reference/comparison. cheers Matthew use strict; use warnings; while (DATA) { my @keys; @keys = $_ =~ m/(NM_\d+)+/g; $_ =~ m/\:1\s+(.*)$/;

Re: Template::Toolkit question

2012-04-09 Thread Manfred Lotz
On Mon, 09 Apr 2012 17:03:13 -0400 Uri Guttman u...@stemsystems.com wrote: On 04/09/2012 02:28 PM, Manfred Lotz wrote: Hi all, Let's say I use Template:Toolkit like this: -snip--- #! /usr/bin/perl use strict; use warnings; use Template; my

Re: Template::Toolkit question

2012-04-09 Thread Manfred Lotz
On Tue, 10 Apr 2012 01:07:32 +0200 Jenda Krynicky je...@krynicky.cz wrote: Hi all, Let's say I use Template:Toolkit like this: -snip--- #! /usr/bin/perl use strict; use warnings; use Template; my $variables = { nrme = Manfred, }; my

Re: Help parsing tab delimited files

2012-04-09 Thread Rob Dixon
Jim Gibson wrote: Tiago Hori wrote: Just so I make sure I understand it correctly: So every time I use a while (FILEHANDLE) loop each line of input from the file gets assigned to $_ in each iteration of the loop? Almost. is an operator. Each timeFILEHANDLE is evaluated, a line is read