Re: Automation

2008-06-30 Thread Eko Budiharto
you can use crontab in linux.

On Mon, Jun 30, 2008 at 2:26 PM, Ram <[EMAIL PROTECTED]> wrote:

> Hi All,
>
> I am begineer to perl language. Want help for the automation of the
> perl script.
> Is it possible to run a perl script at defined time interval without
> cliking over the scipt and using command prompt.
>
> I want it run without any GUI. it shoud run automatically at defined
> time ?
>
> Please give your valuable suggestions
>
> Thanks in advance.
>
> Ram
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>


-- 
Eko Budiharto


Re: Connecting MS SQL from linux

2008-11-09 Thread Eko Budiharto
or yon can try DBD::ODBC
(http://cpan.uwinnipeg.ca/htdocs/DBD-ODBC/DBD/ODBC.html).

On Sun, Nov 9, 2008 at 5:19 PM, Ow Mun Heng <[EMAIL PROTECTED]> wrote:
>
>
> -Original Message-
> From: Jeff Pang [mailto:[EMAIL PROTECTED]
>>> De : "[EMAIL PROTECTED]"
>>> I'm using perl to connect to mysql, but now i need it to connect to MS
>>> SQL server and after google search i still don't understand the best
>>> way to do it.
>>>
>
>>Try Class::DBI::MSSQL or UnixODBC.
>>See the documents on CPAN.
>
> I'm currently connecting to MSSQL using
>
> use DBI;
>
> and the main package which does that magic is -> perl-DBD-Sybase-1.08
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>



-- 
Eko Budiharto

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: perl on windows

2009-05-15 Thread Eko Budiharto
you can download the newest perl from activestate.com. for your work,
you can download your necessary module needed using ppm from your perl
installation.


On Fri, May 15, 2009 at 9:00 PM, Sharan Basappa
 wrote:
> Hi,
>
> I would like to know install perl on my windows laptop. Any
> suggestions on which one to use.
> Also, my work requires some special modules like algorithm. How do I
> handle that?
>
> Regards
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>



-- 
Regards,
Eko Budiharto
GMGWEB.NET/SANGATMURAH.NET
Jl. Kalijudan Madya V/18
Surabaya 60114
Jawa Timur
Telp: +623160214440, +628175093588
http://www.sangatmurah.net
http://www.gmgweb.net
Email: eko.budiha...@gmgweb.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: perl on windows

2009-05-19 Thread Eko Budiharto
I usually perl by activestate. It is very simple in installing and
upgrading/adding any modules.

On Tue, May 19, 2009 at 2:56 AM, Dr.Ruud  wrote:
> Sharan Basappa wrote:
>>
>> Ruud:
>>>
>>> Sharan:
>
>>>> I would like to know install perl on my windows laptop. Any
>>>> suggestions on which one to use.
>>>
>>> Strawberry Perl  http://vanillaperl.com/
>>
>> I downloaded strawberry and extracted it. I dont see any install
>> notes.
>> Any idea how to install (is extraction all we have to do)
>
> So you downloaded the exe and ran it?
>
> --
> Ruud
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>



-- 
Regards,
Eko Budiharto
GMGWEB.NET/SANGATMURAH.NET
Jl. Kalijudan Madya V/18
Surabaya 60114
Jawa Timur
Telp: +623160214440, +628175093588
http://www.sangatmurah.net
http://www.gmgweb.net
Email: eko.budiha...@gmgweb.net

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: CGI scripting

2009-06-08 Thread Eko Budiharto
On Mon, Jun 8, 2009 at 2:06 PM, Irfan Sayed wrote:
> Hi All,
>
> I need to configure Apache web server to execute the CGI scripts (in perl). 
> Servers has windows XP operating system.
> i have downloaded apache but i am not able to see any www folder in the 
> installed dir. of apache.
>
> do i need to configure IIS on this machine? and then manualy create the 
> cgi-bin dir. and keep the perl scripts inside that?
> please let me know the steps so that i can configure the same and execute 
> perl script in web browser.

first, you have to decide which web server you want to use, IIS or
apache? If you will use apache, then you need to configure the apache.
if you will use IIS, then you need to configure IIS.

-- 
Regards,
Eko Budiharto
GMGWEB.NET/SANGATMURAH.NET
Jl. Kalijudan Madya V/18
Surabaya 60114
Jawa Timur
Telp: +623160214440, +628175093588
http://www.sangatmurah.net
http://www.gmgweb.net
Email: eko.budiha...@gmgweb.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: CGI scripting

2009-06-09 Thread Eko Budiharto

Irfan,
please read the readme or the user guide. I think you should modify to 
specify the virtual directory name on the apache.


Irfan Sayed wrote:




*From:* Eko Budiharto 
*To:* Irfan Sayed 
*Cc:* beginners@perl.org
*Sent:* Monday, June 8, 2009 1:17:59 PM
*Subject:* Re: CGI scripting

On Mon, Jun 8, 2009 at 2:06 PM, Irfan Sayed<mailto:irfan_sayed2...@yahoo.com>> wrote:

> Hi All,
>
> I need to configure Apache web server to execute the CGI scripts (in 
perl). Servers has windows XP operating system.
> i have downloaded apache but i am not able to see any www folder in 
the installed dir. of apache.

>
> do i need to configure IIS on this machine? and then manualy create 
the cgi-bin dir. and keep the perl scripts inside that?
> please let me know the steps so that i can configure the same and 
execute perl script in web browser.


first, you have to decide which web server you want to use, IIS or
apache? If you will use apache, then you need to configure the apache.
if you will use IIS, then you need to configure IIS.

--
Regards,
Eko Budiharto
GMGWEB.NET/SANGATMURAH.NET <http://gmgweb.net/SANGATMURAH.NET>
Jl. Kalijudan Madya V/18
Surabaya 60114
Jawa Timur
Telp: +623160214440, +628175093588
http://www.sangatmurah.net
http://www.gmgweb.net
Email: eko.budiha...@gmgweb.net <mailto:eko.budiha...@gmgweb.net>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org 
<mailto:beginners-unsubscr...@perl.org>
For additional commands, e-mail: beginners-h...@perl.org 
<mailto:beginners-h...@perl.org>

http://learn.perl.org/

I need to use apache. can you please let me know then how shud i 
configure it so that i can execute CGI script.
 
Regards

Irf





Re: Automating Weblogic monitoring Using Perl Scripts.

2010-09-15 Thread Eko Budiharto

 dear Prasad,
you can buy a book or find e-book about perl. You might want to start 
with simple scripts.


There is a site that you can download packages, http://www.cpan.org.

I hope it helps.



On 9/16/2010 6:24 AM, prasad.prabhak...@aps.com wrote:

Hi, please can anyone suggest me a way how to get into this loop, I am really 
interested in programming and I don't know which way to go and start. I think 
someone can help me since I am new to Perl programming.

Thanks,
Prasad Prabhakara
Infrastructure Applications
Cell:480-889-4171
Phone:81-5389




Email Firewall made the following annotations

-
--- NOTICE ---

This message is for the designated recipient only and may contain confidential, 
privileged or proprietary information.  If you have received it in error, 
please notify the sender immediately and delete the original and any copy or 
printout.  Unintended recipients are prohibited from making any other use of 
this e-mail.  Although we have taken reasonable precautions to ensure no 
viruses are present in this e-mail, we accept no liability for any loss or 
damage arising from the use of this e-mail or attachments, or for any delay or 
errors or omissions in the contents which result from e-mail transmission.

-





--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: perl or python

2010-10-10 Thread eko . budiharto
Perl is better.

Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

-Original Message-
From: "Octavian Rasnita" 
Date: Sun, 10 Oct 2010 11:24:42 
To: 
Subject: Re: perl or python

On Tue, Oct 5, 2010 at 10:55 AM, Kaushal Shriyan
 wrote:
> Hi
>
> Is it better to learn Perl or Python since i can manage only writing
> simple bash shell scripts.
>
> Please suggest/guide.
>
> Thanks and Regards
>
> Kaushal


It depends on more things, like the things you need to do, the language 
prefered by your team members, the platform you are targeting, etc.

If you need to do cli system administration, Perl is better.
If you need to do very many programs in many fields, Perl is better because 
there are very modules on CPAN that can help you.
If you need to do web programming, Perl is better if you consider to use the 
tools like Catalyst framework, DBIx::Class ORM, Template-Toolkit templating 
system, HTML::FormFu or HTML::FormHandler form processors and many other 
modules you can get from CPAN.

If you need to do programs that interact with the GUI of the OS, Python is 
better.
If you need support for Windows or for apps with a GUI, Python is better.
If you need to do programs to run on Symbian-based phones, Python is a choice 
while Perl is not (because symbianperl doesn't really exist).

If you work alone and you respect the best practices, Perl can be as clear as 
Python but if you work in a team, more and more new programmers consider to 
learn Python and not Perl, because Python code is clearer.
If you need to work in a team which has blind programmers, Perl is better 
because the punctuation chars that makes Perl code uglier makes the code more 
accessible than the Python code which needs a strict indentation.

If you want to use something trendy, Python is a much better choice these days.

Good luck.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: perl real life exercise

2010-10-15 Thread eko . budiharto
The best way to learn perl ini real life is the real case in the real life, so 
you will be much more familiar and gain more knowledge about perl. 

I think learning other programming language is the same. :)

Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

-Original Message-
From: Agnello George 
Date: Fri, 15 Oct 2010 12:32:51 
To: 
Subject: perl real life exercise

HI

Is there any site or any book other than "learning perl" where i would get
real life exercises on perl scripting.

Thanks

-- 
Regards
Agnello D'souza



Re: Seeking opinions about YAPCs

2011-06-14 Thread eko . budiharto
Dear all,
Can someone tell me what the YAPC is? Thx.

Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

-Original Message-
From: D 
Date: Tue, 14 Jun 2011 05:50:37 
To: 
Subject: Seeking opinions about YAPCs

Hello everyone,

I just now realized that the next YAPC is in Asheville, NC, which is
right in my backyard (+2 hrs of driving).  I'm very tempted to attend,
but I've never been to a YAPC.  Any opinions out there as to their
usefulness?  Also, what happens in the hackathons?  I have a program
that I've been working on that I'd love to discuss with more learned
perl folks; I know it needs some reorganization and reworking.  I'm
dreaming of this hackathon being a place where people mull about
tables kibitzing perl programs... maybe I should start playing chess
again.

Demian


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: book on perl

2007-07-02 Thread Eko Budiharto

camel books by oreilly. There are all good books even for beginners or
for advanced. Oreilly books are the best.

On 7/2/07, Garg, Mayank IN BOM SISL <[EMAIL PROTECTED]> wrote:

Hi all,

Can some one suggest me a good book on perl (basics and advanced)



Thanks & Regards,

Mayank Garg





--
Eko Budiharto

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: calculating time difference with localtime

2007-08-08 Thread Eko Budiharto
you can use one of the CPAN modules,  called Time::Format.


On 8/9/07, Srinivas <[EMAIL PROTECTED]> wrote:
>
> perldoc -q "How can I compare two dates and find the difference"
>
> Wagner, David --- Senior Programmer Analyst --- WGO wrote:
> >> -Original Message-
> >> From: timbo [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, August 08, 2007 07:03
> >> To: beginners@perl.org
> >> Subject: calculating time difference with localtime
> >>
> >> Once I calculate the difference between 2 epoch times, is there a way
> >> I can convert the difference into a proper time format?
> >>
> >> For example...
> >>
> >> $difference = 13452
> >>
> >> then convert it to show
> >>
> >> timedifference = 35 minutes
> >>
> >> Thanks in advance.
> >>
> >>
> >   Either spin your own or find a CPAN module . Usually easier to
> > write your own little routine to take seconds and come back with hours,
> > minutes, seconds or if necessary days, hours, etc.
> >
> > Wags ;)
> >
> >> --
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> http://learn.perl.org/
> >>
> >>
> >>
> >>
> >
> > **
> > This message contains information that is confidential and proprietary
> to FedEx Freight or its affiliates.  It is intended only for the recipient
> named and for the express  purpose(s) described therein.  Any other use is
> prohibited.
> > **
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>


-- 
Eko Budiharto


Re: Installing Date::Calc

2007-12-05 Thread Eko Budiharto
It is strange that C compiler does not include in the first time
installation. I installed solaris 8 and Fedora, red hat, I always get C
compiler when I installed the OS and I rarely does not get C compiler.

Only last time, I installed Date::Calc in my FC6 machine, it was asked the
newest GCC version. And then I used yum to update the gcc, then the rest
worked smoothly.

On Dec 4, 2007 8:46 PM, Peter Scott <[EMAIL PROTECTED]> wrote:

> On Mon, 03 Dec 2007 11:40:16 -0700, Gerald Wheeler wrote:
> > It appears that installing the prerequisites for Date::Calc
> > (Bit::Vector) requires a C compiler.
> >
> > Is there any way to install Date::Calc (and it's prerequisites) when
> > one does not have the capability to compile the module?
> >
> > Are precompiled modules for Solaris 10 SPARC available form somewhere?
>
> gcc installs easily under Solaris 10 and will make the installation of
> CPAN modules with XS components as simple as it can get.  Is there some
> reason you don't want to install gcc?
>
> --
> Peter Scott
> http://www.perlmedic.com/
> http://www.perldebugged.com/
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>


-- 
Eko Budiharto


Re: DATA Transfer from a remote machine :: which one is best SCP or VSFTPD

2008-03-26 Thread Eko Budiharto
I use SCP. About faster or not, it depends on the bandwidth in both
locations and load CPU in each locations.

On Thu, Mar 27, 2008 at 1:16 PM, Anirban Adhikary <
[EMAIL PROTECTED]> wrote:

> Dear List
> I need to collect bulk data files from some remote machines into my local
> machine. I will be using a perl script to read about the  remote machines
> directory listing from where I will get the  source data files.The remote
> machines' directory listing from where I will get the data files most
> probably changes time by time . So now please tell me which one is good
> options can be used in this situation SCP or VSFTPD? I need a secure and
> fast data transfer.
>
> Thanks & Regards in Advance
> Anirban Adhikary.
>



-- 
Eko Budiharto


Re: perl 5.8.8 installation

2008-05-13 Thread Eko Budiharto
It should be ok. I believe there will be no effect after upgradation.

On Tue, May 13, 2008 at 4:27 PM, Anirban Adhikary <
[EMAIL PROTECTED]> wrote:

> Dear List
> I have one sun solaris machine which has installed perl 5.6.1. the details
> of machine is as follows
>
> SunOS MARS 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V440
>
> Now I want to install perl 5.8.8 in this machine. Since the machine is a
> production server I need to very careful about the upgradation of perl.
> Now
> my question if i want to upgrade to perl 5.8.8 is there any chance of data
> loss and how do I upgrade it i.e. from 5.6.1 to 5.8.8 ? what are the steps
> for this upgradation procedure ???
>
> Thanks & Regards in advance
> Anirban Adhikary.
>



-- 
Eko Budiharto


Re: Free Perl Editor

2007-01-01 Thread Eko Budiharto

who said only GNU emacs is everything. Actually, there are other plain
text editors you can use.

On 1/2/07, eko hermiyanto <[EMAIL PROTECTED]> wrote:

GNU Emacs is everything. I seldom to use other program than GNU Emacs in my
work and personal computing at home.

I do text editing, programming for various languages, web browsing, sending
email, chatting in IRC and yahoo messaging protocol and various other
computing activities with only GNU Emacs.

The only sad thing is that I can not use my beloved GNU Emacs when I am in
public internet cafe just like this one.

Thanks,
Eko Hermiyanto





--
Eko Budiharto

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




[ask] oracle date

2012-03-09 Thread Eko Budiharto

dear list,
I have a date data extracted from oracle, stored as this 1993-11-30 
00:00:00. The datatype in the oracle is date. I would like to save into 
mysql (the datatype is also date), I got an error. When I do a small 
debug, I print the date directly, it comes out into 30-NOV-93. I am 
trying to use date::manip, time::format, date::format, it still got an 
error and cannot be saved into mysql.


Please help to tell me how to convert the date format and can be stored 
into mysql. Thanks.



Eko

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




script produced no output

2012-03-16 Thread Eko Budiharto

dear list,
I have a perl script that I would like to run from any browsers. I tried 
it on firefox and internet explorer, but both gave me, the same error 
message, "Content-type: text/html


'C:\HRMS\cgi-bin\cetakKuponMakanHarian.pl' script produced no output"

I am using IIS under windows 7 32 bit, I set already the security into 
allow to everyone to read and execute.


Please tell me what I miss. Thanks.

here is the upper part of the script:

use strict;
use DBI;
use Time::Format;
use MySQL::DateFormat;

my ( $KODE_UNIT, $KODE_BAGIAN, $NIK, $TANGGAL, $JUMLAH, $KD_S_NASI, 
$JENIS, $USER_ID, $TGL_CREA, $TGL_UPD, $CK1, $SHIFT ) = '';


my $query4 = qq { select * from fo_lain where TANGGAL = curdate(); };
my $sth = $Mdbh->prepare($query4) or die "Couldn't prepare statement: " 
. $Mdbh->errstr;;

$sth->execute();

print "Content-type: text/html\n\n";
print "";
print "\n";
print "charset=windows-1252\">\n";


print "\n";

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




[question] array

2012-03-30 Thread Eko Budiharto

hi list,
I would like to ask about 2 dimensional array

my code:
my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
( $KODE_UNIT, $KODE_BAGIAN, $NIK, $TANGGAL ) = @$row;
@row = @$row;
push(@array_2d, @row  );

print "";
print "width=>@array_2d[0][0]@array_2d[0][1]@array_2d[0][2]";

print "";

}


The result that I expected:
@array_2d[0][0]
@array_2d[0][1]
@array_2d[0][2]
@array_2d[1][0]
@array_2d[1][1]
@array_2d[1][2]
@array_2d[2][0]
@array_2d[2][1]
@array_2d[2][2]


I tried a few ways, I still get an error message.

I am kind of confused with 2D arrays. Please help. Thanks.


[question] : array

2012-04-01 Thread Eko Budiharto

hi list,
I would like to ask about 2 dimensional array

my code:
my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
( $KODE_UNIT, $KODE_BAGIAN, $NIK, $TANGGAL ) = @$row;
@row = @$row;
push(@array_2d, @row  );

print "";
print "width=>@array_2d[0][0]@array_2d[0][1]@array_2d[0][2]";

print "";

}


The result that I expected:
@array_2d[0][0]
@array_2d[0][1]
@array_2d[0][2]
@array_2d[1][0]
@array_2d[1][1]
@array_2d[1][2]
@array_2d[2][0]
@array_2d[2][1]
@array_2d[2][2]


I tried a few ways, I still get an error message.

I am kind of confused with 2D arrays. Please help. Thanks.


writing a value from a variable in PDF::API2

2012-08-27 Thread Eko Budiharto
dear members,
I wrote a perl script to write a pdf file. I am stuck in writing a
value from a variable.  Please help. thanks in advance.

Here is my script:
#!/usr/local/bin/perl

use CGI qw(:standard);
use strict;
use PDF::API2;


my $endDate2 = $time{'dd-mm-', time + 86400 * 14};
my $startDate2 = $time{'dd-mm-', time - 86400 * 0};


# Create a blank PDF file
my $pdf = PDF::API2->new(-file => 'C:/HRMS/cgi-bin/testPDF.pdf');

# Add a blank page
my $page = $pdf->page();

# Set the page size
$page->mediabox('A4');

# Add a built-in font to the PDF
my $font = $pdf->corefont('Arial');


# Add some text to the page
my $text = $page->text();
$text->font($font, 10);
$text->translate(30, 750);
$text->text('Periode :', $startDate2 - $endDate2, autoflow => 'on');


# Save the PDF
$pdf->save();
$pdf->end;

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




newbie question for parsing incoming mails

2017-02-14 Thread Eko Budiharto
dear all,
I have a question.
If I would like to parse all incoming mails from my qmail, which perl
module is easy to use?
my qmail emails incoming is /var/qmail/mailnames//support. In
this folder I already have preline in .qmail for piping emails to my perl
script.
And, my perl script what I already have is like this:

#!/usr/bin/perl -w

use Mail::Internet;

my $mail = Mail::Internet->new( [  ] );
my $headers = $mail->head->header_hashref;
my @subject = @{${$headers}{'Subject'}}; # or otherwsie do it in list
context it works

print @subject;


when I run it, I do not get anything.

please help.

regards,
Eko


Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
Jim, 
if I want to extract all incoming emails from my qmail emails, how can specify 
the folder location and specify the file name since the file name always 
different?

Thx.
> On Feb 15, 2017, at 22:56, Jim Gibson  wrote:
> 
>> 
>> On Feb 14, 2017, at 10:38 PM, Eko Budiharto  wrote:
>> 
>> dear all,
>> I have a question. 
>> If I would like to parse all incoming mails from my qmail, which perl module 
>> is easy to use?
>> my qmail emails incoming is /var/qmail/mailnames//support. In 
>> this folder I already have preline in .qmail for piping emails to my perl 
>> script.
>> And, my perl script what I already have is like this:
>> 
>> #!/usr/bin/perl -w
>> 
>> use Mail::Internet;
>> 
>> my $mail = Mail::Internet->new( [  ] );
>> my $headers = $mail->head->header_hashref;
>> my @subject = @{${$headers}{'Subject'}}; # or otherwsie do it in list 
>> context it works
>> 
>> print @subject;
>> 
>> 
>> when I run it, I do not get anything.
>> 
>> please help.
> 
> I use Email::MIME to parse email messages. After reading the email file into 
> the variable $text I do this:
> 
> my $mime = Email::MIME->($text);
> my @parts = $mime->parts();
> 
> for my $npart ( 0..$#parts ) {
>  my $part = $parts[$npart];
>  my $header = $part->header_obj();
>  my $htext = $header->as_string();
>  my $body = $part->body();
>  …
> }
> 
> 
> 
> 
> 
> Jim Gibson



Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
dear Jim,
I tried to add lines to read file like this:

use Email::MIME;

my $file = '/var/qmail/mailnames//support/Maildir/cur/1487041394.M984019P23084V0803I00E03878.ABCD.NET,S=3987:2,';
open my $ifh, '<', $file
  or die "Cannot open '$file' for reading: $!";
local $/ = '';
my $contents = <$ifh>;
close( $ifh );

my $mime = Email::MIME->($contents);  —> line 13

my @parts = $mime->parts();

for my $npart ( 0..$#parts ) {
  my $part = $parts[$npart];
  my $header = $part->header_obj();
  my $htext = $header->as_string();
  my $body = $part->body();

  print $header;
}

after I ran its from CLI, I got an error message Undefined subroutine 
&Email::MIME called at line 13.

what does the error mean?



> On Feb 15, 2017, at 22:56, Jim Gibson  wrote:
> 
> I use Email::MIME to parse email messages. After reading the email file into 
> the variable $text I do this:
> 
> my $mime = Email::MIME->($text);
> my @parts = $mime->parts();
> 
> for my $npart ( 0..$#parts ) {
>  my $part = $parts[$npart];
>  my $header = $part->header_obj();
>  my $htext = $header->as_string();
>  my $body = $part->body();
>  …
> }
> 
> 
> 
> 
> 
> Jim Gibson



Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
dear all,
I have one a couple questions.
-. For the header, what if, I just need the subject, the from, and the 
recipient, what is the command? I read the manual in the 
https://metacpan.org/pod/Email::MIME#header 
<https://metacpan.org/pod/Email::MIME#header>, it does not tell me how to 
extract all of those.
-. And then, for the email contents of the body, it just shows Content-Type: 
multipart/alternative; boundary=f403045de9521d20cc054874ce1a 
instead of the contents of the email body. How to extract it into string 
because it is under html format.

> On Feb 16, 2017, at 11:45, Jim Gibson  wrote:
> 
> 
>> On Feb 15, 2017, at 8:10 PM, Eko Budiharto  wrote:
>> 
>> dear Jim,
>> I tried to add lines to read file like this:
>> 
>> use Email::MIME;
>> 
>> my $file = '/var/qmail/mailnames/> name>/support/Maildir/cur/1487041394.M984019P23084V0803I00E03878.ABCD.NET,S=3987:2,';
>> open my $ifh, '<', $file
>>  or die "Cannot open '$file' for reading: $!";
>> local $/ = '';
>> my $contents = <$ifh>;
>> close( $ifh );
>> 
>> my $mime = Email::MIME->($contents);  —> line 13
>> 
>> my @parts = $mime->parts();
>> 
>> for my $npart ( 0..$#parts ) {
>>  my $part = $parts[$npart];
>>  my $header = $part->header_obj();
>>  my $htext = $header->as_string();
>>  my $body = $part->body();
>> 
>>  print $header;
>> }
>> 
>> after I ran its from CLI, I got an error message Undefined subroutine 
>> &Email::MIME called at line 13.
>> 
>> what does the error mean?
> 
> That means I mistyped the line. It should be this:
> 
>   my $mime = Email::MIME->new($contents);
> 
> 



captcha

2018-03-04 Thread Eko Budiharto

dear all,

I am trying to put a captcha on my site. I already have public key and 
secret key from google. I already put the public key on my html and 
secret key on the server respond site. But when I ran it, I got an 
error, For security reasons, you must pass the remote ip to reCAPTCHA at 
respond.pl line 66.


the CPAN library used is

Captcha::reCAPTCHA;


the line 66 (respond.pl) is

my $result = $c->check_answer(
    "xxx123", $ENV{'REMOTE_ADDR'},
    \$challenge, $response
);

if ( $result->{is_valid} ) {
    print "Yes!";
} else {
    # Error
    print "No";
}


please help.


thx.




stupid question about to protect source code of perl web application scripting

2019-07-06 Thread Eko Budiharto

dear all,

I have a question. I have written a web application with perl, 
unfortunately everything written in perl, everyone can see all source 
codes I wrote. My question is is there anyway to protect those source 
codes? Compile or encrypt it?



I am looking forward to a favorable reply from you. Thank you.


regards,

Eko

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: stupid question about to protect source code of perl web application scripting

2019-07-06 Thread Eko Budiharto

dear Uri,

it is a web application but it is on premise. The user is not honest. 
That's why I am trying to find a way to protect the source code like in 
java we can compile into java class and still can be run.


I read some articles in the internet. Some method are using PAR, perlc, 
Filter::Crypto, acme::bleach, but I am not sure it will encrypt the 
source code and it still can be runnable.


The application users of course cannot read the source code, but the sys 
admin can access the source code and this sys admin is a dishonest 
person. :)



On 07/07/19 10.08, Uri Guttman wrote:

On 7/6/19 11:01 PM, Eko Budiharto wrote:

dear all,

I have a question. I have written a web application with perl, 
unfortunately everything written in perl, everyone can see all source 
codes I wrote. My question is is there anyway to protect those source 
codes? Compile or encrypt it?




if it is a web application and you don't give out the source, it 
should be inaccessible to users of the application. but in general 
there is no secure way to hide perl source if you want to distribute 
the program. if your application is worth something, then honest users 
will pay for it and you shouldn't need to hide the source.


uri



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: stupid question about to protect source code of perl web application scripting

2019-07-07 Thread Eko Budiharto

dear all,

first of all, thank you for the respond of my inquiry. And then, there 
is a few questions I would like to ask:


1. if someone takes your works and then he steals the credit by claiming 
the work is his work instead of your work, what will you do?


2. if someone has a problem, he does not want to try to find a way to 
solve the problem first, and then he asks your help and then problem 
solved, then he is blaming the person who already helped him and 
claimed, that is his work. what will you do?


This is kind of some images of this dishonest person.

I do not mind to share my code to the person, if he does not have that 
character.


So far, I am using the perl code for web application in a hosting 
server. But this time, I have to create a web application on a on 
premise server.


I am not an expert yet in perl and still learning although I know perl 
when I got still in my university 19 years ago.


regards,

Eko Budiharto


On 07/07/19 14.54, Kent Fredric wrote:

On 7/6/19 11:21 PM, Eko Budiharto wrote:

it is a web application but it is on premise. The user is not honest.
That's why I am trying to find a way to protect the source code like
in java we can compile into java class and still can be run.

That's a false sense of securtiy. A sufficiently "dishonest" person
can decompile your class files back into source.

It may not be the original source, comments may be lost, function
names and variables may become nonsensical, ( but this last part
typically requires additional obfuscation beyond the standard java
compiler )

But the logic, the interface, and all the metadata required to make
backtraces remotely comprehensible, is all still there for anyone who
wants to look.


I read some articles in the internet. Some method are using PAR,
perlc, Filter::Crypto, acme::bleach, but I am not sure it will encrypt
the source code and it still can be runnable.

Perl is basically the same, you can make it harder for the laziest of
people to obtain readable source code, but ultimately, all these
systems are obfuscation, _not_ protection, they all internally decode
the code first before handing it over to the perl interpreter, as
that's the only way to get it to execute. All an enterprising person
has to do is put some glue between that decoder and the perl runtime,
and the code reveals itself. Or ... you simply need to have that
decoded stuff loaded in memory, and then point deparse at the
in-memory function, and it will spit out something that looks a lot
like the original code.

In short, the time invested in this aspect will basically cost you
money, without materially giving you anything for it. And worse, it
increases the odds that your code will randomly stop working,
frustrating your user, making them swear to never do business with you
again, _AND_ then forcing them to attempt to break your "protection"
in order to fix their broken code.

Just don't bother.

Either simply place the software on a platform where they have no
access to any form of the code whatsoever, not even in its executable
state ( as Uri says ), or put an Iron Clad contract on it that
empowers you to sue the pants off them if they do anything you don't
like with it.

Spend your time working on making a great product that works and makes
them happy so they never *need* to reverse-engineer it, so they never
*need* to compete with you, and you'll have a customer for life.

Don't waste time and money on misguided attempts at "protecting your
code" which will only make you enemies and give your competition the
advantage.

( This stupidity has been tried ad-infinitum in everything, and entire
websites now exist for the sole purpose of distributing defeat
mechanisms, and distributing defeated copies of the software. Its an
arms race, one you will ultimately lose. )



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: stupid question about to protect source code of perl web application scripting

2019-07-08 Thread Eko Budiharto




2. if someone has a problem, he does not want to try to find a way to
solve the problem first, and then he asks your help and then problem
solved, then he is blaming the person who already helped him and
claimed, that is his work. what will you do?


What do you mean?



dear Shlomi,

what I mean in this one is the person has a problem, but he does not 
make any efforts first, he just ask the solution from someone else. 
After the problem is solved, he blames the person.


For example:

I have a problem and then I do not do anything or make my own effort and 
then I ask your help to solve it for me. After the problem solved 
because you helped me, I blame you instead you being grateful and thank 
you and plus I said to anyone that I am the one who solved if instead of 
your name.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




datatables

2019-07-15 Thread Eko Budiharto

dear all,

I have a question about datatables (jquery). I have been trying although 
with a simple file, it is not displaying in a browser (got 500 internal 
server error), but in CLI is working.


here is the HTML side:

#!/usr/bin/perl -w

use URI::Escape;
use strict;




print "Content-type: text/html; charset=utf-8\n\n";
print "\n";
print "\n";

print "href=\"http://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css\";>\n";


print "src=\"http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js\";>\n";

print "https://code.jquery.com/jquery-3.3.1.js\";>\n";
print "
\$(document).ready( function () {
    \$('#pt_table').DataTable( {
    serverSide: true,
    processing: true,
    lengthMenu: [ 10, 25, 50, 100 ],
    columns: [ [ {'sName': 'Child_ID'}, {'sName': 'Full_Name_EN'}, {'sName': 'Full_Name_KH'}, {'sName': 'Gender'}, {'sName': 'Date_of_Birth'}  ]
    pageLength: 10,
    ajax: {
    url: 'children_dynamic_finder_ajax.pl',
    type: 'POST',
    dataType: 'json'
    }
    } );
} );
\n";
print "\n";
print "\n";
print "\n";
    print "\n";
    print "\n";
    print "10px 18px; border-top: 1px solid #11; border-bottom: 1px solid 
#11;\" width=12%>Child ID\n";
    print "10px 18px; border-top: 1px solid #11; border-bottom: 1px solid 
#11;\">Full Name EN\n";
    print "10px 18px; border-top: 1px solid #11; border-bottom: 1px solid 
#11;\">Full Name KH\n";
    print "10px 18px; border-top: 1px solid #11; border-bottom: 1px solid 
#11;\" width=12%>Gender\n";
    print "10px 18px; border-top: 1px solid #11; border-bottom: 1px solid 
#11;\" width=12% >Date of Birth\n";

    print "\n";
    print "\n";
    print "\n";
    print "\n";
    print "class=\"dataTables_empty\">...\n";

    print "\n";
    print "\n";
print "\n";


print "\n";
print "\n";



here is the ajax file used in the query.

#!/usr/bin/perl -w

use URI::Escape;
use strict;
use DBI;
use CGI qw(:standard);
use Time::Format;
use JSON;
use JSON::XS;
use Log::Log4perl;
use Data::Dumper;

my ($logger, $data) = "";


# Initialize Logger
my $log_conf ='/var/www/html/logs/log4perl.conf';  #config file with 
logger parameters

Log::Log4perl::init($log_conf);
$logger = Log::Log4perl->get_logger("children_dynamic_finder_ajax");

#$logger->info("Info message");

#my @columns = qw/child_id Full_Name_EN Full_Name_KH gender Date_of_Birth/;
my @columns = 
qw/Id,ContactCode,FirstNameEN,NameEN,FirstNameKH,NameKH,Gender,DateOfBirth/;

$logger->debug(@columns);
print @columns;




my $q = CGI->new;
my $params = $q->Vars;
#$logger->info("Parameter's received: " . Dumper($params));
print $params;
$logger->debug($params);

#my $table_length = $q->param('pt_table_length');
my $server2 = 'localhost';
my $db2 = 'css';
my $username2 = 'root';
my $password2 = 'PSE#2019';

my $dbh2 = DBI->connect("dbi:mysql:$db2:$server2", $username2, $password2);
my $sql_count = "select count(id) from Contacts";
my $count = $dbh2->selectrow_arrayref($sql_count)->[0];
$dbh2->disconnect();

$dbh2 = DBI->connect("dbi:mysql:$db2:$server2;mysql_enable_utf8mb4=1", 
$username2, $password2);

# Start building up the database query
my @values;
my $sql = "select 
Id,ContactCode,FirstNameEN,NameEN,FirstNameKH,NameKH,Gender,DateOfBirth 
from Contacts";


# if a search parameter was supplied in the AJAX call, build the WHERE 
part in the SQL statement

if( $params->{sSearch} ){
    $sql .= ' WHERE ';
    $sql .= 'ContactCode LIKE ? OR FirstNameEN LIKE ? or NameEN LIKE ? 
or Gender LIKE ? or DateOfBirth LIKE ?';
    push @values, 
('%'.$params->{sSearch}.'%','%'.$params->{sSearch}.'%','%'.$params->{sSearch}.'%','%'.$params->{sSearch}.'%','%'.$params->{sSearch}.'%');

}

# if a sorting parameter was supplied in the AJAX call, build up the 
ORDER BY part in the SQL statement

if( $params->{iSortingCols} ){
    $sql .= ' ORDER BY';
    foreach my $c (0 .. ( $params->{iSortingCols} -1 )){
    $sql .= ' ' . $columns[ $params->{"iSortCol_$c"} ] . ' ' . 
$params->{"sSortDir_$c"};

    $sql .= ','
    }
    $sql =~ s/,$//;
}

# Limit the output and also allow to paginate or scroll infinitely
#print $table_length;
$sql .= " LIMIT ? OFFSET ?";
push @values, (($params->{iDisplayLength} > 0 ? 
$params->{iDisplayLength} : 25), ( $params->{iDisplayStart} // 0));

print ($sql);
# Fetch the data from the database
$data = $dbh2->selectall_arrayref($sql, { Slice => [] }, @values);
print ($data);


# Return the JSON object
print $q->header('application/json');
my $json = encode_json({ aaData => $data, iTotalRecords => $count, 
iTotalDisplayRecords => $count, sEcho => int($params->{sEcho}) });
#my $json = encode_json({ tableLength => $table_length, iTotalRecords => 
$count, params=>$params, iTotalDisplayRecord

Re: datatables


dear Andy and all,

I opened and read the apache error log. it said there is an invalid 
character. And I think there is a unicode character. My question is also 
how to pass a unicode data from mysql to a browser through JSON.


in the mysql connection, I already enable utf8mb4, but I do not know how 
to enable specific charset in JSON.


On 16/07/19 01.01, Andy Bach wrote:

I have been trying although with a simple file, it is not displaying in a 
browser (got 500 internal server error)

500 errors mean the actual error msg is in the httpd error log (e.g.
/var/log/httpd/error_log) and often are about permissions or paths or
simple syntax errors.  But it does mean that your probably not
actually running anything, the script is dying at interpolation time.




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: datatables


dear Andy and all,

while waiting for any respond from the group, I try to debug and get 
better understanding about it. I stripe everything and start with one 
column of data. I got a new understanding. The error was caused in the 
sql query statement. In the SQL query statement, there is "? mark, wrong 
concat (it is my mistake to put in the wrong way).


Now, it is showing the JSON data in the browser console, not in the 
browser page. I am still looking for how to do it.


On 18/07/19 02.45, Andy Bach wrote:

You may want to give us the entire error msg.  If it's saying an
invalid char, it may be an actual non-ascii char in the text of the
program, not necessarily from the data, though that might depend upon
how you're displaying the data.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/