Questions for scalar variable in perl

scmuser created the topic: Questions for scalar variable in perl

Hi,

Could you please explain following questions in details..

1. Various way to define and initialize scalar variable.
2. Various ways to print scalar variable?
3. Various ways to use scalar variable in programming?

Tagged :

Questions over Arrays variable in perl

scmuser created the topic: Questions over Arrays variable in perl

Hi,

Could you please explain following questions in details..

1. Various way to define and initialize Arrays variable.
2. Various ways to print Arrays variable?
3. Various ways to use Arrays variable in programming?
4. How to display Numbers of Arrays?
5. How to Print arrays of specific location

Tagged :

Questions over hash variable in perl

scmuser created the topic: questions over hash variable in perl

Hi,

Could you please explain following questions in details..

1. Various way to define and initialize hash variable.
2. Various ways to print hash variable?
3. Various ways to use hash variable in programming?
4. How to Store Hash key values to array and print
5. How to Store hash values to array and print them

Tagged :

Regular expression perl question

rajeshkumar created the topic: Regular expression perl question

I am just beginner in perl. Just want to do following task through regular expression.

I have huge sql file and trying to replace value of each line first 4 digit separated by comma.

FILE 1:
(7, 0, 7, 55, NULL, 0, ”, ‘Wise Package Studio Overview and its advantage’, 1260350867, ‘203.145.176.177’, 0, 0, 0, 0, 197, 0, 0, 0, ”),
(8, 0, 8, 55, NULL, 0, ”, ‘what is Tarma QuickInstall 2 and its usage’, 1260351089, ‘203.145.176.177’, 0, 0, 0, 0, 61, 0, 0, 0, ”),
(9, 0, 9, 55, NULL, 0, ”, ‘what is Tarma Installer 5 and its usage?’, 1260351321, ‘203.145.176.177’, 0, 0, 0, 0, 253, 0, 0, 0, ”),
(10, 0, 10, 56, NULL, 0, ”, ‘what is Tarma ExpertInstall 3 and its usage?’, 1260351466, ‘203.145.176.177’, 0, 0, 0, 0, 69, 0, 0, 0, ”),
(11, 0, 11, 55, NULL, 0, ”, ‘What is Smart Install Maker and its usage?’, 1260351588, ‘203.145.176.177’, 0, 0, 0, 0, 241, 0, 0, 0, ”),
(14, 0, 14, 55, NULL, 0, ”, ‘what is MSI Studio and its use?’, 1260352667, ‘203.145.176.177’, 0, 0, 0, 0, 174, 0, 0, 0, ”),

FILE 2 : It should be manipulated from first file based on following specification…
First Digit – should be incremented by 1
Second Digit – if its 0, no change but with others digit +3
Third Digit -Should be added +3
Fourth Digit – if 55 then make it 65 and if 56 then make it 66
Rest digit should remain unchanged.

Any help on this? I am basically got stuck in regular expression part

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Useful info on Perl defined Function

rajeshkumar created the topic: Useful info on Perl defined Function

Very good url for the following topis…
How to use Perl defined function with scalars
How to use Perl defined function with an array
How to use Perl defined function with a hash
How to use Perl defined function with

www.misc-perl-info.com/perl-defined.html

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Difference between use and require in perl

rajeshkumar created the topic: Difference between use and require in perl
|| use Vs require in perl || What is the difference between use and require?

Except of course that use is evaluated at compile time where as require is evaluated at run time in other word, A use anywhere in the code will be evaluated when the code is run compiled, but require – import’s can only get evaluated when encoutered.

The differences are many and often subtle:

use only expects a bareword, require can take a bareword or an expression

use is evaluated at compile-time, require at run-time

use implicitly calls the import method of the module being loaded, require does not

use excepts arguments in addition to the bareword (to be passed to import), require does not

use does not behave like a function (i.e can’t be called with parens, can’t be used in an expression, etc), whereas require does

do $file is like eval `cat $file`, except the former:
1.1: searches @INC and updates %INC.
1.2: bequeaths an *unrelated* lexical scope on the eval’ed code.

require $file is like do $file, except the former:
2.1: checks for redundant loading, skipping already loaded files.
2.2: raises an exception on failure to find, compile, or execute $file.

require Module is like require “Module.pm”, except the former:
3.1: translates each “::” into your system’s directory separator.
3.2: primes the parser to disambiguate class Module as an indirect object.

use Module is like require Module, except the former:
4.1: loads the module at compile time, not run-time.
4.2: imports symbols and semantics from that package to the current one.

Command to learn more about use and require
> perldoc -f require
> perldoc -f use

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Using perl send an html email

rajeshkumar created the topic: using perl send an html email

Using perl send an html email

#!/usr/bin/perl -w
use strict;
use MIME::Lite;
# SendTo email id
my $email = 'rajesh@scmgalaxy.com';
# create a new MIME Lite based email
my $msg = MIME::Lite->new
(
Subject => "HTML email test",
From => 'rajesh@scmgalaxy.com',
To => rajesh@scmgalaxy.com,
Type => 'text/html',
Data => '

Hello


This is a test email.
Please visit our site online


'
);
$msg->send();

use strict;
use Email::Sender::Simple qw(sendmail);
use Email::Simple;
use Email::Simple::Creator;

my $email = Email::Simple->create(
header => [
To => '"RAJESH KUMAR" ',
From => '"RAJESH KUMAR" ',
Subject => "don't forget to *enjoy the sauce*",
],
body => "This message is short, but at least it's cheap.\n",
);
sendmail($email);

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: using perl send an html email

Some Good Reference

www.cyberciti.biz/faq/how-do-i-send-html-email-from-perl/
www.revsys.com/writings/perl/sending-email-with-perl.html

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Send an HTML email using perl and sendmail

rajeshkumar created the topic: Send an HTML email using perl and sendmail

Send an HTML email using perl and sendmail

open(MAIL,"|/usr/sbin/sendmail -t");

## Mail Header
print MAIL "To: rajeshk\@xxx.com\n";
print MAIL "From: rajeshk\@xxxx.com\n";
print MAIL "Subject: TEST\n";
## Mail Body
print MAIL "Content-Type: text/html; charset=ISO-8859-1\n"
. "@emailBody";
close(MAIL)

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Perl script to monitor disk space and send an email

rajeshkumar created the topic: Perl script to monitor disk space and send an email

Perl script to monitor disk space and send an email

Very good link i found out.
www.cyberciti.biz/tips/howto-write-perl-…itor-disk-space.html

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :