Hi All,
Can somebody please let me know the meaning of this line.
while (<$in>)
{
if(/,/) {print "before match: $`\t and after match: $'\n\n";}; $x=$';
$y=$`; &mysubroutine($x,$y);
}
I know it is a while loop for the file handle ($in) and it will be
executed till the end of file b
Hi All,
I want to compare the two files in Perl. The requirement is that file 1
has 20 lines and file2 has 25 lines . I want to see only five lines as
output which are there in file2 not in file1 as I know that rest of the
20 lines are same in both the files.
I am using the following commands
Hi All,
Can somebody please help me on this???
Regards,
Irfan
-Original Message-
From: Sayed, Irfan
Sent: Monday, March 17, 2008 7:52 PM
To: beginners@perl.org
Subject: diff of two files
Hi All,
I want to compare the two files in Perl. The requirement is that file 1
has 20 lines a
No it is not a homework. It's a official script which I want to make it
into production???
Please help.
Regards,
Irfan
-Original Message-
From: Ken Foskey [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2008 1:48 PM
To: beginners@perl.org
Subject: RE: diff of two files
Sounds like
Hi All,
I need help in regular expression. I have string as follows.
OMS.FD.08.03.000.14
I need only OMS.FD.08.03.000 this much part of the string.i want to
exclude .14
Please help.
Regards,
Irfan
Hi All,
I need to execute the "export CCASE_NO_FILE_HEADER=yes" command through
Perl script.
What I did is qx(export CCASE_NO_FILE_HEADER=yes); but still the value
for CCASE_NO_FILE_HEADER is not getting set to "yes"
Regards,
Irfan
I tried the line : $ENV{CCASE_NO_FILE_HEADER} = 'yes';
But still the value is not getting set.
Please help.
Regards,
Irfan
Project Lead
TSINDIA - Production Line
Individual Software Solutions - UMO
T-Systems India Private Limited, Pune
Telephone: +91-20-30245000/25605000 (Extn: 5271)
Mobile: +
Hi All,
Is there any mechanism where I can take the log of entire Perl script. I
mean to say that I need the log of each and every step which I am doing
in Perl script. That step may include
1: input from user
2: internal Perl script commands
Ultimately whatever Perl script is doing , I
I want to execute "export CCASE_NO_FILE_HEADER=yes" command in Perl
script.
If I run this command on bash prompt then it is executing properly but
if I try to execute this command through perl script then it is not
executing at all
How should I achieve this . is there any another way.
Please help
Hi,
OK. Thanks.
IS there any other mechanism to achieve this??
Regards,
Irfan
-Original Message-
From: Martin Barth [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 17, 2008 1:01 PM
To: beginners@perl.org
Subject: RE: setting unix command through perl script
Hi
your "command" is execu
Thanks for your help.
Actually , I am automating one task in Perl in which this command is
there. If I don't execute this command then entire task would fail.
So it's very important that I should set this variable with proper value
and then start the execution of the task.
Regards,
Irfan
-O
Thanks for your reply.
I have run the command like this
-> qx(CCASE_NO_FILE_HEADER=yes perl /home/m.belgaonkar/merge_latest.pl)
bash: syntax error near unexpected token `qx(CCASE_NO_FILE_HEADER=yes'
[EMAIL PROTECTED] ():/view/m.belgaonkar_oms_test/vob/oms [320]
Please help.
Regards,
Irfan
Hi All,
I have string like OMS.FD.08.03.000.0 Now my req. is that if the string
contains .0 at the end then I want to remove that .0 but if any other
digit is there other than .0 then don't do anything.
For example: if string is : OMS.FD.08.03.000.0 then regular expression
should give OMS.F
Hi All,
How to find out whether the string contains null values or empty data.
For example : I have one scalar variable $str and now I want to check
whether it contains any data or not.
What I did : If ($str eq "NULL" || $str eq " "){ print $str conatins
nothing\n";}
Is this correc
Hi All,
I need to delete some lines in file using Perl. The requirement is that
I have one file which contains following lines.
Element * checkdout
Element * latest.
And now I want to delete these lines using Perl script.
Please help.
Regards,
Irfan
Hi All,
I have written once Perl script to perform certain task. In that script
I have defined one function to create the log file.
The issue is that whenever I am running that script it is executing fine
but the moment it reaches to log () function it throws me following
error.
Can't t
Hi All,
I am using @ARGV variable to record the argument passed to my Perl
script. Now the requirement is that if I don't pass any argument to Perl
script then it should show me following such output.
Perl ack
Usage: ack
-name
-pkg
-relno
Thanks a lot for all response.
Regards
Irfan.
-Original Message-
From: Mimi Cafe [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2008 6:34 PM
To: beginners@perl.org
Subject: Re: Argument for perl script
You may have to parse @ARGV manually depending on how arguments are
passed
to yo
Hi All,
I facing one issue in Perl script. I am executing one command in Perl
script and taking the output of that command in one array. Now I want
to execute some more commands on each value of the array.
But the problem is that I am passing each value of the array as a
argument to that
Hi,
Thanks for reply, but still the error is same. Following is script.
#! /usr/bin/perl
# Perl script to take the backup of critical clearcase data
@vob_lst=system("/usr/atria/bin/cleartool lsvob -s");
foreach $a (@vob_lst)
{
lockvob($a);
}
sub lockvob()
{
local ($lockitem) = @_;
print "
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply
e-mail and destroy all copies of the original message.
Any unauth
Hi All,
I have a string and I need to parse that string to check whether it is
in required format or not. I have a Perl script which ask for user
input. I have mentioned in the Perl script that input should be in the
following format.
For example:- 1,2,3 OR 1 2 3
Which means that delimit
Hi All,
Can somebody please tell me what is the meaning of $^X .
Regards
Irf.
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact th
But I don’t want to match 12,2, or 234432 53. I want to match whether string
contains 1 2 OR 1,2 OR 1,2,3 OR 1 2 3 Or any such combinations.
And I think this reg. exp. is doing that job.
-Original Message-
From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 200
Thanks really
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2008 6:31 PM
To: Perl Beginners
Cc: Sayed, Irfan (Cognizant)
Subject: Re: Regarding reg. exp.
[EMAIL PROTECTED] wrote:
> From: Rob Dixon [mailto:[EMAIL PROTECTED]
>> [EMAIL PROTECTED] wr
But then what is the difference between $0 and $^X
From: Jeff Pang [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2008 5:28 PM
To: Sayed, Irfan (Cognizant); beginners@perl.org
Subject: Re:variable in perl
> Message du 14/10/08 13:54
> De : [EMAIL PROTECTED]
>
Because I want comma (,) exactly once
-Original Message-
From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2008 4:41 PM
To: Sayed, Irfan (Cognizant)
Cc: [EMAIL PROTECTED]; beginners@perl.org
Subject: Re: Regarding reg. exp.
[EMAIL PROTECTED] пишет:
> if ($tri
thanks
From: Jeff Pang [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2008 5:28 PM
To: Sayed, Irfan (Cognizant); beginners@perl.org
Subject: Re:variable in perl
> Message du 14/10/08 13:54
> De : [EMAIL PROTECTED]
> A : beginners@perl.org
> Copie à :
if ($trig_np =~ m/\d,{1}\d|\d\s{1}\d/)
this what I did.
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2008 6:49 PM
To: Perl Beginners
Cc: Sayed, Irfan (Cognizant)
Subject: Re: Regarding reg. exp.
[EMAIL PROTECTED] wrote:
>
> I have a string and I
Hi All,
I am using Perl 5.6.1 and want to sue sendmail module. I have copied the
Sendmail.pm module to the mail dir. But still it is not executing
properly.
Following is the exact error.
Can't locate MIME/Base64.pm in @INC (@INC contains:
/usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5
Hi All/Jeff,
Somehow I am not able to install/configure Sendmail module. Can somebody
have another option/script/module then please let me know.
I am really stuck.
Please help/advise.
Regards
Irf.
-Original Message-
From: Jeff Pang [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16,
Hi all,
I have a string which contains spaces. I need to replace those spaces
with underscore, so I have written command like this
$string="fsdfsdfsdf fsdfsdfsdf";
chomp($string1 = ($string =~ s/\s+$/_/g));
print "$string1\n";
but still $string1 is not printing proper result. Result sho
Hi All,
Can somebody please help me for this block of code.
if ("$1" ne "-log"){
`$0 -log "$@" 2>&1 | tee the_log_file.$$.log`;
exit 0;
}
I know this code redirects the output of entire perl script to file but
it is not executing as expected.
Can somebody please explain / help
Re
Thanks but I need STD output and STD error in the same file. How should I do
that.
Regards
Irfan.
-Original Message-
From: Nitin Kalra [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2008 10:03 PM
To: Sayed, Irfan (Cognizant); beginners@perl.org
Subject: Re: help in redirecting
Hi All,
I need to write perl script which will SSH to different machine , run
some commands and then send out the mail with the output of that
command.
Can it be possible in perl. Please let me know some sample code.
Please help/suggest.
Regards
Irf
This e-mail and any files transm
Hi All,
I have several subroutines/functions in Perl script. I just wanted to
know how to check whether specific function/subroutine in my Perl script
is really executing or not. And if it is executing then what is the exit
status of that function.
Please help/suggest.
Regards
Irfan.
Hi All,
I am executing following command in Perl script
$vw=system("mk_view $view_name ETC");
if ($vw)
{ print "view created successfully\n";
}
When I run this command, I am getting message "view created
successfully". But in reality command is not executing at all
Please help
Hi,
Here is the modified code
$vw=system("mk_view $view_name ETC");
print "$vw\n";
if ($vw)
{ print "view is not created\n";
}
else{
print "View is created \n";
Please help
Regards
Irfan.
From: Sayed, Irfan
Sent: Thursday, Janua
Hello Rob,
I just want to find out whether command("mk_view $view_name ETC") is
properly running or not. In order to acieve this I have written this
code.
Please suggest what needs to be done to get the proper output.
Please help
Regards
Irfan.
-Original Message-
From: Rob Dixon [ma
Hi All,
I want to hide the standard output on the terminal when I am executing
the Perl script. For example I am running this command
"`/usr/atria/bin/cleartool lslock lbtype:$dep_lbl`;
if the execution of this command failed then whatever output is coming
on the terminal I want to hide that an
Thanks John. OOps I did not mentioned one condition while writing the
regular expression.
condition is : If after last dot(.) there are three digit then don't do
anything but if after last dot(.) there are no exactly three digit then
replace that dot(.) and all digits after that dot with space.
Hi All,
I have string like this. D.PRS.WEB.02.10.001.1 and my requirement is
that I want to remove last dot (.) and all the characters/digit after
that dot with the help of regular expression.
Please help.
Regards
Irfan.
Project Lead
TSINDIA - Production Line
Individual Software Solutions -
Hello All,
I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.
It means that I want take first element of first array and first element
of second array and then want to execute certain comm
Hi All,
How to find out the specific variable contains integer value. In my
script ,variable is storing some value but I want to find out whether
that value is string or integer.
Please help
Regards
Irfan.
Thanks Brown. It worked.
-Original Message-
From: Rodrick Brown [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 1:50 AM
To: Sayed, Irfan
Cc: beginners@perl.org
Subject: Re: variable help
#!/usr/bin/perl
my $p = 10;
if( int($p) ) {
print "$p is an interger\n";
}
~
On Tue,
Thanks.
Can you please explain the reg. expression in more detail.
Please
--Irfan.
Project Lead
TSINDIA - Production Line
Individual Software Solutions - UMO
T-Systems India Private Limited, Pune
Telephone: +91-20-30245000/25605000 (Extn: 5271)
Mobile: +91 9822 854 227
Fax: ++91-020 25674090
46 matches
Mail list logo