Re: gettting rid of whitespace characters

2011-05-10 Thread Leo Susanto
http://en.wikipedia.org/wiki/Trim_%28programming%29 $string =~ s/^\s+//;# remove leading whitespace $string =~ s/\s+$//;# remove trailing whitespace or $string =~ s/^\s+|\s+$//g ; # remove both leading and trailing whitespace On Tue, May 10, 2011 at 10:25 AM, Irene

Re: Regular Expression help!

2011-05-11 Thread Leo Susanto
I ended up confused after reading your email. Please specify INPUT + OUTPUT/condition. You have already specify INPUT which is: LOGICAL UNIT NUMBER 587 UID:60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 LOGICAL UNIT NUMBER 128 UID:60:06:01:60:50:4

Re: sendmail in perl

2011-05-12 Thread Leo Susanto
I prefer using Net::SMTP with Authen::SASL for authentication. Plus, read this: http://en.wikipedia.org/wiki/HTML_email On Wed, May 11, 2011 at 11:20 PM, Irfan Sayed wrote: > hi all, > > i need to use sendmail module of perl to send mails. i have seen much perl > modules to send mails > but i d

Re: virtual drive

2011-06-15 Thread Leo Susanto
Try Win32::Lanman http://www.cpan.org/modules/by-authors/id/J/JH/JHELBERG/ On Tue, Jun 14, 2011 at 11:49 PM, Irfan Sayed wrote: > Hi, > > is there any way or module in perl to create the virtual drive in windows > lets say , i have to create M: mapped to c:\test > > so i can use command subst M:

Re: summarise input data using Perl

2011-07-13 Thread Leo Susanto
Mohan, I would suggest you learning perl hash: http://perl101.org/hashes.html #!/usr/bin/perl use Text::CSV; use DBI; use Data::Dumper; # CONFIG VARIABLES ... # DATA SOURCE NAME ... my @regions = ('east','north','south','west'); my @statuses_string = ('pws','open','hold','pwu','reopen'); my %re

Re: Help Parsing a Tab delimited file

2011-07-13 Thread Leo Susanto
On Wed, Jul 13, 2011 at 11:06 AM, Shlomi Fish wrote: > Hi Tiago, > > > You can write the data directly to the four filehandles as you go over them. > You can have filehandles as the values of arrays or hashes. > > Just make sure you are using a CSV parsing and output module: > > http://beta.metacp

Re: summarise input data using Perl

2011-07-14 Thread Leo Susanto
On Thu, Jul 14, 2011 at 2:36 AM, Shlomi Fish wrote: > Hi Leo, > > I'm commenting on your code below because it exhibits some bad elements. > > On Wed, 13 Jul 2011 11:00:33 -0700 > Leo Susanto wrote: > >> #!/usr/bin/perl >> use Text::CSV; >> use DB

Re: A beginners question regarding Perl on Windows 7

2011-08-10 Thread Leo Susanto
No problem with ActiveState 5.12.4 on Win7 64 bits On Wed, Aug 10, 2011 at 10:55 PM, Sisyphus wrote: > > - Original Message - From: "Octavian Rasnita" >> >> Do you know if Perl works fine under Windows 7 also? > > Yes, no problems with perl on Windows 7. > > Cheers, > Rob > > > -- > To un

Re: stuck and need some direction

2011-10-14 Thread Leo Susanto
Not sure how to answer this, could you please give more information? > With the sample input data (on the far bottom) the return value should > be CELL 20 in Column 1 with 2 Counts of CDM HEH in the third column. Is not sufficient for me. On Fri, Oct 14, 2011 at 10:08 PM, Chris Stinemetz wrote:

Re: stuck and need some direction

2011-10-15 Thread Leo Susanto
Chris, You need to let us know what do you want the script to do, believe me, writing the script is the easy part. > > But really I am probably speaking gibberish until you provide some > sample output. Especially it would be good to have other test cases -- > like what other cells would look like

Re: stuck and need some direction

2011-10-15 Thread Leo Susanto
H SUPPRESSED MSGS: 0 ERROR TYPE: ONEBTS MODULAR CELL ERROR SET: DS1-MLG ASSOCIATION CHANGE MLG 1 DS1 1,2 Output: CELL,CDM 1 20, 2 Let me know if it's correct. On Sat, Oct 15, 2011 at 11:55 AM, Chris Stinemetz wrote: > On Sat, Oct 15, 2011 at 1:12 PM, Leo Susanto wrote:

Re: stuck and need some direction

2011-10-15 Thread Leo Susanto
ELL 21 CDM 2, CRC, HEH <- my own test data CELL,CDM 1,CDM 2 20, 2, 0 21, 0, 1 > > Let me know if it's correct. > > On Sat, Oct 15, 2011 at 11:55 AM, Chris Stinemetz > wrote: >> On Sat, Oct 15, 2011 at 1:12 PM, Leo Susanto wrote: >>> Chris, Yo

Re: stuck and need some direction

2011-10-16 Thread Leo Susanto
On Sun, Oct 16, 2011 at 8:10 AM, Shlomi Fish wrote: > On Sun, 16 Oct 2011 07:59:00 -0500 > Chris Stinemetz wrote: > >> On Sat, Oct 15, 2011 at 2:40 PM, Leo Susanto wrote: >> > CELL,CDM 1,CDM 2 >> > 20, 2, 0 >> > 21, 0, 1 >> > Well, the probl

Re: Adding

2011-10-17 Thread Leo Susanto
s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal wrote: > Hi, > > my goal is to get in a directory the following: > > PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg > PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg >  ... > PIC00223.JPG r

Re: Adding \.JPG$/\.jpg/ to a perlregexp

2011-10-17 Thread Leo Susanto
dek_': s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/ 3. rename 'jpg' regardless of the combination of capitalization to simple 'jpg': s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i On Mon, Oct 17, 2011 at 12:07 PM, Csanyi Pal wrote: > Leo Susanto writes: > >>

Re: regex help

2011-10-17 Thread Leo Susanto
>From looking at the regex >  if ($line =~ > /17|18|19|20|21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH/){ against the data > 10/17/11 18:25:20 #578030 > >  25 REPT:CELL 221 CDM 2, CRC, HEH >     SUPPRESSED MSGS: 0 >     ERROR TYPE: ONEBTS MODULAR CELL ERROR >     SET: MLG BANDWIDTH CHANGE

Re: regex help

2011-10-18 Thread Leo Susanto
HEH On Tue, Oct 18, 2011 at 1:16 AM, Chris Stinemetz wrote: > On Mon, Oct 17, 2011 at 10:57 PM, Leo Susanto wrote: >> From looking at the regex >> >>>  if ($line =~ >>> /17|18|19|20|21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH/){ >> >> against

Re: Getting cpamn to work in Windows-7

2011-10-21 Thread Leo Susanto
If you choose to use ActiveState Perl, you need to do "ppm install MinGW" first before you can do "cpan App::cpanminus". On Thu, Oct 20, 2011 at 7:38 AM, Rowan Sylvester-Bradley wrote: > I'm pretty new to Perl, but now I need to install and use a Perl software > package (Daniel Klein's thermd).

Re: translate a file

2012-02-17 Thread Leo Susanto
On Fri, Feb 17, 2012 at 9:17 AM, lina wrote: > Thanks, here  why you use '<', not "<" http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators '<' is literal, no interpolation. "<" is literal with interpolation. in this particular case, there is no difference between '<' and "<". But,

Re: install modules from CPAN

2012-03-14 Thread Leo Susanto
I am not really sure what is going on here since I can get http://cpan.strawberryperl.com/authors/01mailrc.txt.gz without any problem from my computer. Can you try getting the file using your browser first? On Wed, Mar 14, 2012 at 10:48 PM, Bisiigwa Godfrey wrote: > Hi there, > i have perl 5.6 o

Re: how to constitute some value based on the possible abbrevation

2012-03-21 Thread Leo Susanto
use strict; my %abbreviation_shortcuts = ( 'Nat.' => 'National', 'Biol.' => 'Biology', ); while (my $line = ) { chomp $line; print "$line\n"; while ($line =~ /(\w+\.)/g) { my $abbr = $1; if (exists $abbreviation_shortcuts{$abb

Re: Why do I get a warning?

2012-03-22 Thread Leo Susanto
you should do print {$hdl} "a line\n"; instead of print $hdl "a line\n"; On Thu, Mar 22, 2012 at 1:06 PM, Chris Stinemetz wrote: > On Thu, Mar 22, 2012 at 2:47 PM, Manfred Lotz wrote: >> Hi all, >> If I run the following small test snippet >> >> <--snip

Re: Why do I get a warning?

2012-03-22 Thread Leo Susanto
Whoa, I didn't know that this is the case. On Thu, Mar 22, 2012 at 1:11 PM, Michael Putch wrote: >> >   You can't use "typeglob" style filehandles with autodie -- it only works > with lexical filehandles (one reason that the latter are now preferred). > See the Bugs section of "perldoc autodie".

Re: Why do I get a warning?

2012-03-22 Thread Leo Susanto
On Thu, Mar 22, 2012 at 1:54 PM, Manfred Lotz wrote: > On Thu, 22 Mar 2012 13:08:53 -0700 > Leo Susanto wrote: > >> you should do >> >> print {$hdl} "a line\n"; >> >> instead of >> >> print $hdl "a line\n"; >> > &g

Re: Need help with Win32::IEAutomation

2012-04-21 Thread Leo Susanto
Can you use Win32::GuiTest to find the SSL security warning windows (since it's a windows alert) and handle it? On Thu, Apr 19, 2012 at 10:45 AM, alok wrote: > I am trying to use Win32::IEAutomation module to test one web > application which is HTTPS based. > > I am unable to bypass SSL security

Re: Net::SMTP

2012-04-24 Thread Leo Susanto
Gmail is implementing secure SMTP, so plain SMTP won't work. use Net::SMTP::TLS; And make sure you are using these information Host => 'smtp.gmail.com', Hello=> 'gmail.com', Port => 587, User => 'x...@gmail.com', On Tue, Apr 24, 2012 at 9:57 AM, S

Re: Net::SMTP

2012-04-24 Thread Leo Susanto
nd out such information for other hosts? > Like I have an account at https://ems.sbi.co.in so again how do i do for > that? > > On Tue, Apr 24, 2012 at 10:38 PM, Leo Susanto wrote: > >> Gmail is implementing secure SMTP, so plain SMTP won't work. >> >> use Net::

Re: Script to test connecting to Oracle DBs

2012-08-01 Thread Leo Susanto
use strict; use DBI; use DBD::Oracle qw(:ora_types); my $user = ''; my $passwd = ''; my $tnsName = ''; $ENV{'ORACLE_HOME'} = 'C:\oracle\product\10.2.0\client_1'; my $dbh = DBI->connect("dbi:Oracle:$tnsName", $user, $passwd); my $SQL = qq{ SELECT XXX}; my $sth0 = $dbh->prepare($SQL); print "SQL

Re: Perl and Windows commands

2012-08-15 Thread Leo Susanto
It's not right. I have several batch file running sc command and it's not a synchronous command. When you run 'sc stop nexus-webapp' it will send termination command to the service manager and exit. It will not wait until the service itself is down. what you might want to do is: 'sc stop nexus-w

Re: how to handle two input files

2012-08-28 Thread Leo Susanto
Shouldn't '#!/usr/bin/perl -w' be put on the top of the script? On Tue, Aug 28, 2012 at 10:28 PM, Jim Gibson wrote: > > On Aug 28, 2012, at 9:01 PM, Wang, Li wrote: > >> Dear All >> > > [problem description snipped] > >> My script is as follows. And usage is: ./myscript.pl FstFile.txt >> annotat

Re: DBD::ODBC SQL Server Stored Procedure

2012-08-29 Thread Leo Susanto
Full code please. On Wed, Aug 29, 2012 at 12:01 PM, Gorrebeeck, Robert wrote: > All > > I am having an issue with retrieving output parameters from a SQL Server > stored procedure. > > Here is the definition of the stored procedure > > PROCEDURE [TestProcess] > @Id NUMERIC(20,0), > @Ref

Re: Fine tuning gmail send

2012-09-26 Thread Leo Susanto
Basic script for gmail with subject: use strict; use Net::SMTP::TLS; our $MAIL; do "mail.conf"; my $mailer = new Net::SMTP::TLS( $$MAIL{'Host'}, Hello => $$MAIL{'Hello'}, Port=> $$MAIL{'Port'},

Re: Learning CPAN

2012-10-04 Thread Leo Susanto
I enjoyed Mark Fowler's presentation "CPAN modules every perl programmer should know" but I don't have the link to the presentation. or you just can browse through perl advent: http://perladvent.org/ On Thu, Oct 4, 2012 at 7:03 PM, Danny Gratzer wrote: > Hello, > So I have been using perl for ab

Re: Need a Perl Book for Beginner

2012-12-04 Thread Leo Susanto
I want to recommend Perl Black Book, it's a good illustrating the scenario and solution approach with Perl On Tue, Dec 4, 2012 at 3:06 PM, Danny Gratzer wrote: > Id recommend beginning perl by brian d foy or try programming perk > On Dec 4, 2012 4:58 PM, "Asad" wrote: > >> Hi All , >> >>