RE: Separating the body of the text in email from its header

2007-10-26 Thread Nagasamudram, Prasanna Kumar
The usually the format of the mail will be

HEADER1
HEADER2
HEADER3
..
..
..
HEADERn

BODY


Please note there will be a blank line b/w the end of the header and the
body.


So you start from the beginning of the mail and keep ignoring the lines
until you find a blank line

The rest of it would be the body.


Thanks
Prasanna



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 26, 2007 2:42 PM
To: beginners@perl.org
Subject: Separating the body of the text in email from its header

Hi,

 I need a urgent help

 How can we separate the body of the text in an email from its header?


Regards,
Praveena

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



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




RE: sendmail

2007-02-20 Thread Nagasamudram, Prasanna Kumar


-Original Message-
From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 20, 2007 4:07 PM
To: beginners@perl.org
Subject: sendmail

Hi All,
 
I need to send mail to all users defined in one array. I tried foreach
loop but what is happening is it is sending mail to only first user in
the array. not sending mails to rest of the users.
 
Is there any way to send a mail to all users in array in one shot. I am
using sendmail 2.09 module from CPAN.
 
Please help
 
Regards
Irfan.
 

Hi Irfan

Can you please send the code snippet, so that it will be easy to
identify the problem if any?



Thanks
Prasanna

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




RE: Calling a perl program from a perl script

2007-01-11 Thread Nagasamudram, Prasanna Kumar


-Original Message-
From: Dharshana Eswaran [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 11, 2007 12:12 PM
To: Jeff Pang
Cc: Perl Beginners
Subject: Re: Calling a perl program from a perl script

On 1/11/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
>
> >I Have a perl program which runs successfully and gets the required
> output.
> >
> >I need to call that program from a perl script. I tried this using
eval
> >function. But it failed.
> >
> > Can i know how to do this?
> >
> >Can anyone guide me in this?
> >
>
> It's maybe good to define the called program to be a perl
module/lib,then
> access the subroutines in the module by OO way.
>
> --
> Books below translated by me to Chinese.
> Practical mod_perl: http://home.earthlink.net/~pangj/mod_perl/
> Squid the Definitive Guide: http://home.earthlink.net/~pangj/squid/
>


Hi all,

I need to call the perl program and i have to pass arguments too along
with
the calling. And the called perl program has to return values too.

Can i do this without converting the called program into module?

Thanks and Regards,
Dharshana




Hi Dharshana

Probably you can use the tilde

$x = `perl otherscript.pl`;

print "value = $x\n";


Thanks
Prasanna



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




RE: constructing a http request using LWP..

2006-12-26 Thread Nagasamudram, Prasanna Kumar
Hi pm

 

Although I have not tired this, I think it should be an alternative for
Win32::Guitest on linux.

 

X11::GUITest

 

The following link has all the info including installation and example.

 

http://www.perl.com/pub/a/2006/02/02/x11_gui_testing.html

 

 

Thanks

Prasanna

 

 



From: positive mind [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 20, 2006 7:02 PM
To: Nagasamudram, Prasanna Kumar
Cc: beginners@perl.org
Subject: Re: constructing a http request using LWP..

 

Hi Prasanna,

Thanks for your reply, but i have to do this on linux. does Win32 or any
equivalent module is available on Linux?
thanks,
pm

On 12/20/06, Nagasamudram, Prasanna Kumar
<[EMAIL PROTECTED]> wrote: 

Hi pm

I had the same requirement, just with a press of a button, I need my
inbox(all the login etc should be automated)

I wrote the following script.  (You may have to install the
Win32::GuiTest module from cpan. (also change YOURLOGIN and YOURPASSWORD
appropriately).

With this you don't have to worry about constructing the query string. 





use Win32::GuiTest qw(:ALL);


system("start iexplore.exe");
sleep(3);  # this delay for the window
   # to comeup - try to increase
   #if it is not sufficient 
SendKeys('^(l)');
SendKeys('http://mail.yahoo.com{ENTER}'
<http://mail.yahoo.com%7bENTER%7d'> );
sleep(15); # This delay is to load the
   #page - try to increase if it is not sufficient
SendKeys('YOURLOGIN{TAB}');
SendKeys('YOURPASSWORD{ENTER}');



Thanks
Prasanna


-Original Message-
From: positive mind [mailto: [EMAIL PROTECTED]
Sent: Wednesday, December 20, 2006 5:24 PM
To: beginners@perl.org
Subject: constructing a http request using LWP.. 

Hi there,

is it possible to automate the login and log out say from  yahoo mail
using
LWP/HTTP module.
cause
i have application which is similar to this and i have to send my login
request alongwith few query parameters . after i login i will be logged 
in
to my applications mail box. how can i do this..i know which query
parameters to send but not able to construct the  url.

the query parameters are
site=xyz.abc.com
lang=en
locale=us
and few more..which are static.
but there is something called random number which is hidden one and
which is
generated randomly.
if i do view source on the login page then i can get the value of this 
random number.

my query is how do i get this random number from my perl script and pass
it
as query param. any idea will be helpful.

thanks in advance,
pm

 



RE: constructing a http request using LWP..

2006-12-20 Thread Nagasamudram, Prasanna Kumar
Hi pm

I had the same requirement, just with a press of a button, I need my
inbox(all the login etc should be automated)

I wrote the following script.  (You may have to install the
Win32::GuiTest module from cpan. (also change YOURLOGIN and YOURPASSWORD
appropriately).

With this you don't have to worry about constructing the query string.





use Win32::GuiTest qw(:ALL);


system("start iexplore.exe");
sleep(3);  # this delay for the window 
   # to comeup - try to increase 
   #if it is not sufficient
SendKeys('^(l)');
SendKeys('http://mail.yahoo.com{ENTER}');
sleep(15); # This delay is to load the 
   #page - try to increase if it is not sufficient
SendKeys('YOURLOGIN{TAB}');
SendKeys('YOURPASSWORD{ENTER}');



Thanks
Prasanna


-Original Message-
From: positive mind [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 20, 2006 5:24 PM
To: beginners@perl.org
Subject: constructing a http request using LWP..

Hi there,

is it possible to automate the login and log out say from  yahoo mail
using
LWP/HTTP module.
cause
i have application which is similar to this and i have to send my login
request alongwith few query parameters . after i login i will be logged
in
to my applications mail box. how can i do this..i know which query
parameters to send but not able to construct the  url.

the query parameters are
site=xyz.abc.com
lang=en
locale=us
and few more..which are static.
but there is something called random number which is hidden one and
which is
generated randomly.
if i do view source on the login page then i can get the value of this
random number.

my query is how do i get this random number from my perl script and pass
it
as query param. any idea will be helpful.

thanks in advance,
pm

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: :Graph...crashing...

2006-09-20 Thread Nagasamudram, Prasanna Kumar

Hi Lee

I found a solution . 
I ran  "ppm install http://theoryx5.uwinnipeg.ca/ppms/GD.ppd"; as
mentioned in
http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Repository

That solves everything.




Im now curious how your search is showing up "GD" where as my search
does'nt.

The following is my search result

ppm> search GD
Searching in Active Repositories
   1. CGI-Application-Plugin-LogDisp~ [1.00]
CGI-Application-Plugin-LogDispatch
   2. CGI-Builder-LogDispatch  [0.1] CGI-Builder-LogDispatch
   3. Finance-Bank-ES-INGDirect   [0.01] Finance-Bank-ES-INGDirect
   4. Finance-Bank-INGDirect  [1.05] Finance-Bank-INGDirect
   5. GD-Barcode  [1.15] GD-Barcode
   6. GD-Dashboard[0.04] GD-Dashboard
   7. GDBUI   [0.84] GDBUI
   8. GDGraph-Map [1.05] GDGraph-Map
   9. GDS2[2.07] GDS2
  10. SVG-GD  [0.07] SVG-GD
ppm>

Thanks
Prasanna

-Original Message-
From: Lee Goddard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 20, 2006 5:23 PM
To: Nagasamudram, Prasanna Kumar; beginners@perl.org
Subject: RE: :Graph...crashing...

> From: Nagasamudram, Prasanna Kumar 
> Hi Lee
> 
> I tried to search for the GD module through ppm and was 
> unable to find it, so I downloaded the tar file from cpan and 
> installed it manually.

Ah, that's the problem: GD is a perl binding (Perl, C and glue) to GD. 

Do you have a compiler?

But - I just did PPM search and got :
ppm> search GD
  1. CGI-Application-Plugin-LogDispatch   [1.00]
CGI-Application-Plugin-LogDispatch
  2. CGI-Builder-LogDispatch   [0.1] CGI-Builder-LogDispatch
  3. Finance-Bank-ES-INGDirect[0.01]
Finance-Bank-ES-INGDirect
  4. Finance-Bank-INGDirect   [1.05] Finance-Bank-INGDirect
  5. GD   [2.35] Interface to Gd
Graphics Library
  6. GD-Barcode   [1.15] GD-Barcode
  7. GD-Convert   [2.12] additional output
formats for GD
  8. GD-Dashboard [0.04] GD-Dashboard
  9. GD-Graph3d   [0.63] Creates 3D charts with
GD::Graph and GD.
 10. GDBUI[0.84] GDBUI
 11. GDGraph[1.4308] Produces charts with GD
 12. GDGraph-boxplot  [1.00] Produces PNG box and
whisker graphs
 13. GDGraph-Map  [1.05] GDGraph-Map
 14. GDS2 [2.07] GDS2
 15. GDTextUtil   [0.86] text utilities for GD
 16. SVG-GD   [0.07] SVG-GD
 17. Template-GD  [2.66] GD plugins for the
Template Toolkit
pm> 

Just need to type "install 5" after that search.

If after tyring PPM again, you still get no joy, add the Theory5
repository - more details if needed.

hth
-- 



http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.


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




RE: :Graph...crashing...

2006-09-20 Thread Nagasamudram, Prasanna Kumar
Hi Lee

I tried to search for the GD module through ppm and was unable to find
it, so I downloaded the tar file from cpan and installed it manually.

Also whan I say "remove GD" from ppm it says "pakage GD not installed" -
its actually installed.


The following is the search result.

ppm> search GD
Searching in Active Repositories
   1. CGI-Application-Plugin-LogDisp~ [1.00]
CGI-Application-Plugin-LogDispatch
   2. CGI-Builder-LogDispatch  [0.1] CGI-Builder-LogDispatch
   3. Finance-Bank-ES-INGDirect   [0.01] Finance-Bank-ES-INGDirect
   4. Finance-Bank-INGDirect  [1.05] Finance-Bank-INGDirect
   5. GD-Barcode  [1.15] GD-Barcode
   6. GD-Dashboard[0.04] GD-Dashboard
   7. GDBUI   [0.84] GDBUI
   8. GDGraph-Map [1.05] GDGraph-Map
   9. GDS2[2.07] GDS2
  10. SVG-GD  [0.07] SVG-GD
ppm>


Thanks
Prasanna

-Original Message-
From: Lee Goddard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 20, 2006 4:59 PM
To: Nagasamudram, Prasanna Kumar; beginners@perl.org
Subject: RE: :Graph...crashing...

> I'm trying to use the GD module. for plotting a graph on 
> WINDOWS but my Perl script is crashing.
> 
> Here is the piece of code which is crashing  [Perl Command 
> Line Interpreter has encountered a problem and needs to 
> close.  We are sorry for the inconvenience.]
> 
> use GD::Graph::bars;
> my $graph = GD::Graph::bars->new(400, 300);

It's not your syntax, it's fine here on 5.6.1 and 5.8.8. 

Try re-installing GD-Graph using the Perl Package Manger (you may need
to remove the package first).

hth
-- 

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.


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




GD::Graph...crashing...

2006-09-20 Thread Nagasamudram, Prasanna Kumar
Hi All

 

I'm trying to use the GD module. for plotting a graph on WINDOWS but
my Perl script is crashing.

 

Here is the piece of code which is crashing  [Perl Command Line
Interpreter has encountered a problem and needs to close.  We are sorry
for the inconvenience.]

 

use GD::Graph::bars;

 

==>  my $graph = GD::Graph::bars->new(400, 300);

 

 

 

I'm not sure what the problem is.

 

Can anybody throw some light on this ?

 

Thanks

Prasanna



RE: extracting line between words

2006-09-14 Thread Nagasamudram, Prasanna Kumar

Hi Mayank

Please add $\=" "; to your code as follows.
$\ is the output field separator.


#!/usr/bin/perl
use warnings;
use strict;
my @line = "The Sun rises in
the east and ";
my $store;

$\=" ";   ##   <- OUTPUT FIELD SEPERATOR##

while(<@line>){
print if $_ =~ /The/ .. /east/ ;

}
print "\n";

Thanks
Prasannna


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 14, 2006 4:57 PM
To: beginners@perl.org
Subject: extracting line between words

Hi Perlers...

I need to extract line between two words

like 


@line =  "The Sun rises in 
the east and ";

Now I want to extract the line from The word to east

For tht I am using the following code:

#!/usr/bin/perl
use warnings;
use strict;
my @line = "The Sun rises in
the east and ";
my $store;

while(<@line>){
print if $_ =~ /The/ .. /east/ ;

}
print "\n";


But the output is coming like this TheSunrisesintheeast

But I want the output like this The Sun rises in the east


So could u plz sugest me where I am wrong or where do I need to 
modify my code.

With warm regards

Macky
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Image split....

2006-08-29 Thread Nagasamudram, Prasanna Kumar


-Original Message-
From: Gretar Mar Hreggvidsson [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 28, 2006 6:41 PM
To: Nagasamudram, Prasanna Kumar
Cc: beginners@perl.org
Subject: Re: Image split

> 
> But If I change the following line
> 
> $img->read(file=>'p.bmp', type=>'bmp') or die $img->errstr();
> 
>TO
> $img->read(file=>'p.jpg', type=>'jpg') or die $img->errstr();
> 
> 
> 
> I get the following error.
> 
> 
> "format 'jpg' not supported at i.pl line 4."
> 
> 
> The same is for other formatsexcept bmp.
> 
> Is this a limitation or I'm I doing something wrong?
> 
The format is called 'jpeg'.  To get a list a supported formats try 
something like:

   perl -e 'use Imager; print "$_\n" for keys %Imager::formats;'

If, on the other hand, jpeg is not listed there, you are probably 
missing the jpeg libraries (/usr/lib/libjpeg*)

G.




--

Hi Gretar

Im working on windows and I downloaded libjpeg.dll from 

http://gnuwin32.sourceforge.net/packages/jpeg.htm


and copied it to c:\windows\system and system32

but the following 
   perl -e 'use Imager; print "$_\n" for keys %Imager::formats;'

displays only

bmp
rgb
w32
pnm
tga
ifs
raw


Thanks
Prasanna


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




RE: Image split....

2006-08-28 Thread Nagasamudram, Prasanna Kumar
-Original Message-
From: Gretar Mar Hreggvidsson [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 28, 2006 5:29 PM
To: Nagasamudram, Prasanna Kumar
Cc: beginners@perl.org
Subject: Re: Image split

Hi

I would probably use the module Imager (see CPAN), and it's crop() 
function.  The function doesn't modify the source, it returns a new, 
cropped image based on the coordinates you submit to it.

Best regards,
Grétar Mar

Nagasamudram, Prasanna Kumar wrote:
> Hi All
> 
>  
> 
> Can anybody suggest me any module/script that can be used to split and
> image into pieces?
> 
>  
> 
> I tried to search in CPAN also googled a lot.
> 
>  
> 
> I could only find image splitting software..but I need command line
> utility.
> 
>  
> 
>  
> 
> Thanks
> 
> Prasanna
> 
> 




Hi Gretar


Thanks a lot and that's exactly what I needed.

I have a small query related to this.


The following is my code which works perfectly fine for a BMP.

use Imager;

my $img = Imager->new();
$img->read(file=>'p.bmp', type=>'bmp') or die $img->errstr();

$newimg = $img->crop(left=>0, right=>510, top=>0, bottom=>384); 
$newimg->write(file=>"t1.bmp") or die $newimg->errstr();



But If I change the following line

$img->read(file=>'p.bmp', type=>'bmp') or die $img->errstr();

   TO
$img->read(file=>'p.jpg', type=>'jpg') or die $img->errstr();



I get the following error.


"format 'jpg' not supported at i.pl line 4."


The same is for other formatsexcept bmp.

Is this a limitation or I'm I doing something wrong?

Thanks
Prasanna

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




Image split....

2006-08-28 Thread Nagasamudram, Prasanna Kumar
Hi All

 

Can anybody suggest me any module/script that can be used to split and
image into pieces?

 

I tried to search in CPAN also googled a lot.

 

I could only find image splitting software..but I need command line
utility.

 

 

Thanks

Prasanna



RE: calculate the value in an array of array

2006-08-18 Thread Nagasamudram, Prasanna Kumar


-Original Message-
From: chen li [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 18, 2006 7:00 PM
To: beginners@perl.org
Subject: calculate the value in an array of array

Dear all,

I have an array of array look like this:

@array_of_array=(

[1,2,3,4,5],
[1,2,3,4,5],
[1,2,3,4,5],
[1,2,3,4,5]
)

How do I get the total values for each colume, such as

$column1=1+1+1+1;
$column2=2+2+2+2;
$column3=3+3+3+3;

...

Thanks,

Li




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 






Hi Li

Im just sending you the logic.if you can get the syntax correct then
you migt get the desired result.

for i 1 - n
{
  sum = 0
  for j 1-n
  {
sum= sum + a[j][i]
  }
  print coli = sum

}


Thanks
Prasanna

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: advise on writing cgi scripts to create + manage certificate authority.

2006-08-03 Thread Nagasamudram, Prasanna Kumar
Hi Gregory

If you want to lean how to write cgi scripts using perl ...
The following link would be a great start...

http://cgi101.com/book/ch1/text.html


Thanks
Prasanna

-Original Message-
From: Gregory Machin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 03, 2006 2:09 PM
To: beginners@perl.org
Subject: advise on writing cgi scripts to create + manage certificate
authority.

Hi
I have to write a cgi appliction to manage a certificate authority for
AES
256 CBC and 128 CBC ... How would I go about this the only application I
have used for this was comand lline interactive...

Any suggestions ..

-- 
Gregory Machin
[EMAIL PROTECTED]
www.linuxpro.co.za

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Specify download file name

2006-07-12 Thread Nagasamudram, Prasanna Kumar
Hi Anish

The following example works and I have tested it.


use CGI;
$cgiObject=new CGI;

$filename="SRQ.zip";

print $cgiObject->header(-charset=>'',
-Expires=>'-1d' ,
-'Cache-Control'=>'private,
max-age=0',
-attachment=> $filename,
-type=>'application/octet-stream'

);


open ZIPFILE, "$filename" || die "Can't open $filename for reading";

binmode (ZIPFILE);

@file=;

print @file;

close ZIPFILE;



Thanks
Prasanna

-Original Message-
From: Anish Kumar K. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 7:04 PM
To: Nagasamudram, Prasanna Kumar
Cc: beginners@perl.org
Subject: Re: Specify download file name

Hi Prasanna

Thanks for the reply. But that is not helping me in the situation

Thanks
Anish

Nagasamudram, Prasanna Kumar wrote:
> Hi Anish
>
> Can you try adding the following to your $cgiObject->header ?
>
> -attachment=>'$filename.zip',
>
> And changing
>
> -type=>'application/zip'   to -type=>'application/octet-stream'
>
>
> [PS : The above is not tested]
>
> Thanks
> Prasanna
>
> -Original Message-
> From: Anish Kumar K. [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 11, 2006 3:43 PM
> To: beginners@perl.org
> Subject: Specify download file name
>
> Hi
>
> This is somewhat easy question I feel but for some reason I am not 
> getting this
>
> The issue is I am using CGI to download a file, I am setting the
header 
> as this
> print 
>
$cgiObject->header(-type=>'application/zip',-charset=>'',-Expires=>'-1d'
> ,-'Cache-Control'=>'private, 
> max-age=0');
>
> the download works fine. But the issue is the file name it is coming
as 
> the filename...say when I download I am geting "downloadwav.pl".
> which is the file name of the perl file. Is there a way I can specify
a 
> file name, It is a zip file.
>
> I tried this
> $file_name="attachment.zip";
> print "Content-Disposition: attachment; filename = $file_name\n\n";
>
> Not working...any help
>
> Thanks
> Anish
>
>
>   


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




RE: Specify download file name

2006-07-11 Thread Nagasamudram, Prasanna Kumar
Hi Anish

Can you try adding the following to your $cgiObject->header ?

-attachment=>'$filename.zip',

And changing

-type=>'application/zip'   to -type=>'application/octet-stream'


[PS : The above is not tested]

Thanks
Prasanna

-Original Message-
From: Anish Kumar K. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 3:43 PM
To: beginners@perl.org
Subject: Specify download file name

Hi

This is somewhat easy question I feel but for some reason I am not 
getting this

The issue is I am using CGI to download a file, I am setting the header 
as this
print 
$cgiObject->header(-type=>'application/zip',-charset=>'',-Expires=>'-1d'
,-'Cache-Control'=>'private, 
max-age=0');

the download works fine. But the issue is the file name it is coming as 
the filename...say when I download I am geting "downloadwav.pl".
which is the file name of the perl file. Is there a way I can specify a 
file name, It is a zip file.

I tried this
$file_name="attachment.zip";
print "Content-Disposition: attachment; filename = $file_name\n\n";

Not working...any help

Thanks
Anish


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Tk problem

2006-07-07 Thread Nagasamudram, Prasanna Kumar
Hi Raimo

If you are running window, then can you try installing through ppm (perl
package manager)?

C:\>ppm

ppm>install Tcl-Tk


This way it wil go smoothly and also it will check for dependecies and
download automatically.



Thanks
Prasanna

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 07, 2006 11:55 AM
To: beginners@perl.org
Subject: Tk problem



Hi,

I try to install Tk module.
I have perl, v5.8.6 

...make tests give


t/zzScrolled.NOK 66# Test 66 got: "589x341+0+32"
(t/zzScrolled.t
at line 104 fail #2)
#Expected: "589x341+0+0" (Sizechk: geometry has not changed not
reset for
-height => 24+(5))
#  t/zzScrolled.t line 104 is: ok($newgeo, $oldgeo,
"Sizechk:
geometry has not changed not reset" .
t/zzScrolled.NOK 94# Test 94 got: "589x341+17+32"
(t/zzScrolled.t at line 104 fail #4)
#Expected: "589x341+0+32" (Sizechk: geometry has not changed not
reset for
-width => 80+(5))
t/zzScrolled.FAILED tests 66, 94
Failed 2/94 tests, 97.87% okay
t/zzText.ok
t/zzTixGrid..ok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed

---
t/browseentry-grabtest.t  255 65280 12 200.00%  1
t/entry.t 3361   0.30%  180
t/zzScrolled.t 942   2.13%  66 94
 (3 subtests UNEXPECTEDLY SUCCEEDED), 23 subtests skipped.
Failed 3/47 test scripts, 93.62% okay. 4/2619 subtests failed, 99.85%
okay.
make: *** [test_dynamic] Error 255
[EMAIL PROTECTED] Tk-804.027]# make test


What should I do?

/Raimo

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Urgent :search and replace

2006-06-22 Thread Nagasamudram, Prasanna Kumar
Hi Preethi

Can you try...

perl -pi.bak -e 's/(ab=test1.*?dc=test3)/ab=chk1,bc=chk2/sg' filename


[untested]

Thanks
Prasanna

-Original Message-
From: Preethi [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 22, 2006 3:21 PM
To: Dr.Ruud
Cc: beginners@perl.org
Subject: Re: Urgent :search and replace

Hi Ruud,

Thanks for the input. I will take care of your inputs next time I post
the
message.

The below solution did not work for me . My file runs almost to 1GB .
All I
have the string mentioned below.
I even tried the following option

perl -pi.bak -0777 -e 's/ab=test1, db=test2,dc=test3/ab=chk1,bc=chk2/gi'
filename.

But  it did not work. I also tried using -m. It failed.

Please let me know if there any other solution for this.

Thanks,
Preethi



On 6/22/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
>
> Preethi schreef:
>
>
> Never put "Urgent" in the Subject. Never address "us" as Experts. Just
> explain your problem.
>
> Subject: search and replace on broken lines
>
>
> > I have wired problem , I have search and replace string in very huge
> > text file . The problem with the string is broken in the differenet
> > line.
> >
> > I'm having a  string 'ab=test1, db=test2,dc=test3' and I want to
> > replace this with 'ab=chk1,bc=chk2'.
> > This string in the file is present in various fasion like
> > 
> > .ab=tes
> > t1, db=test2,dc=test3'
> > , ab=
> > test1,db=test2,dc=test3' .
> > ..
>
> What is "very huge"? Multiple GB?
>
> If the file is "only" a few MB, consider slurping it in:
>
> perl -i.bak -wpe '
> { local $/;
>s/a\n?
>  b\n?
>  =\n?
>  t\n?
>  e\n?
>  s\n?
>  t\n?
>  1\n?
>  ,\n?
> \ \n?
>  d\n?
>  b\n?
>  =\n?
>  t\n?
>  e\n?
>  s\n?
>  t\n?
>  2\n?
>  ,\n?
>  d\n?
>  c\n?
>  =\n?
>  t\n?
>  e\n?
>  s\n?
>  t\n?
>  3\n?
>  /ab=chk1,bc=chk2/xgi
> }
> ' filename
>
> (untested)
>
> The "local $/" sets the input record separator to undef. See perlvar.
> The inserted \n? are optional newlines.
>
>
> Your sample shows a
> ", db"
> and a
> ",db"
> so you'll need to adjust the regular expression above.
>
>
> Handy:
>
> perl -le '
> $s = q{ab=test1, db=test2,dc=test3} ;
> $r = join( q{\n}, split( q{}, $s ), undef) ;
> print qr/$r/
> '
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Does any one have nice programs for PERL AJAX

2006-06-21 Thread Nagasamudram, Prasanna Kumar
Hi Anish

I happened to browse through the following page

http://www.perl.com/pub/a/2006/03/02/ajax_and_perl.html


which actually explains what is Ajax and how to use the perl warapper
CGI::Ajax with a simple example.



Thanks
Prasanna

-Original Message-
From: Anish Kumar K. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 21, 2006 2:27 PM
To: beginners@perl.org
Subject: Does any one have nice programs for PERL AJAX

Hi
I searched out in the Google and all for some nice Ajax Programs with 
the perl template toolkit and all.Can any one mail me the programs.

Thanks
Anish


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Perl one liner....

2006-05-23 Thread Nagasamudram, Prasanna Kumar
Thanks Shawn...that worked...


I think it was everything to do with double quotes on windows.

-Original Message-
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 23, 2006 11:50 PM
To: beginners@perl.org
Subject: Re: Perl one liner

On Tue, 2006-23-05 at 11:36 -0700, M Senthil Kumar wrote:
> 
> On Tue, 23 May 2006, Nagasamudram, Prasanna Kumar wrote:
> 
> |I'm trying to do a find and replace on the file content using the
> |following command on windows.
> 
> [snipped]
> 
> |perl -p -i.bak -e 's/FOO/BAR/g' abc.txt
> 
> [snipped]
> 
> Hi,
> Try:
> 
> $ perl -pi.bak -e 's/FOO/BAR/' abc.txt
> 
> Note: abc.txt has BAR, abc.txt.bak has FOO after execution.


Try:

perl -pi.bak -e "s/FOO/BAR/g" abc.txt

Last time I was forced to use Windows, it went goofy on single quotes.


-- 
__END__

Just my 0.0002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



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



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




Perl one liner....

2006-05-23 Thread Nagasamudram, Prasanna Kumar
Hi All

 

I'm trying to do a find and replace on the file content using the
following command on windows.

 

perl -p -i.bak -e 's/FOO/BAR/g' abc.txt

 

 

abc.txt

===

test abcd sdfds sdfdsf

fdFOO fsd fds hgjhg df

fsd hfhj gFOOfd gfdgfd

gdf gdf gdf sfsd fsd

 

But the abc.txt remains unchanged

 

Can you please let me know if  I need to change anything in the command
?

 

Thanks

Prasanna



RE: Query

2006-05-19 Thread Nagasamudram, Prasanna Kumar
Hi Kaushal

-w is to enable warning messages.


Try running the following code to see the difference with and w/o -w.

x.pl
-
$str=a+2;

print $str,"\n";
-

$ perl x.pl
2



$ perl -w x.pl
Unquoted string "a" may clash with future reserved word at p2.pl line 3.
Argument "a" isn't numeric in addition (+) at p2.pl line 3.
2


Thanks
Prasanna

-Original Message-
From: Kaushal Shriyan [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 19, 2006 5:48 PM
To: beginners@perl.org
Subject: Query

Hi All

#!/usr/bin/perl -w

whats -w flag stands for and what is its use, I mean How do i use it
and any other flags are also there, Please specify

Thanks

Kaushal

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Print

2006-05-19 Thread Nagasamudram, Prasanna Kumar
Hi Kaushal

The only alternative I can think of is to convert your chm file to pdf
or rtf and then attempt a print.

You can get the convert from 

http://www.freedownloadscenter.com/Best/free-chm-to-pdf.html


Also can you please send me the chm file?
It can be quite handy to me.



Thanks
Prasanna

-Original Message-
From: Kaushal Shriyan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 18, 2006 6:08 PM
To: beginners@perl.org
Subject: Print

Hi All

I have perl.chm file Learning Perl, How do i print all the chapters
and all pages in
the perl.chm file

when i click on print, only one page gets selected and in the print
dialog I can see only one page

How do i select all the pages so that I can print the entire book

Kaushal

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Any CPAN module similar to Winrunner

2006-05-18 Thread Nagasamudram, Prasanna Kumar
Hi Dhanashri

If you are looking for GUI test automation.you can try
Win32::GUITest.




Thanks
Prasanna

-Original Message-
From: Shalaka [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 18, 2006 6:56 PM
To: beginners@perl.org
Subject: Any CPAN module similar to Winrunner

Hi List!
I'm a beginner in Perl, 
i want to know if there is any module available which
allows me automated testing of an application.

I saw there's WWW::Mechanize for Web based
applications, but the one i'll be testing is not
web-based.

Thanks in advance,
Dhanashri



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]