Question about writing to excel file
Hi All, I am writing a script (needless to mention that it is in perl :)), that would read an excel file and save a copy of one of the sheet as another excel file and do processing on it. (Adding formats..etc). Can u please tell me which would be the best module to handle this. I have searched the CPAN and there were lots of modules related to writing to excel file. Please let me know to proceed... Thanks in advance. Alok __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Question about writing to excel file
Hi All, I think I found the answer (checking at previous posts), I think I am going to use Spreadsheet::WriteExcel. Thanks, Alok --- Alok Bhatt [EMAIL PROTECTED] wrote: Hi All, I am writing a script (needless to mention that it is in perl :)), that would read an excel file and save a copy of one of the sheet as another excel file and do processing on it. (Adding formats..etc). Can u please tell me which would be the best module to handle this. I have searched the CPAN and there were lots of modules related to writing to excel file. Please let me know to proceed... Thanks in advance. Alok __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Running perl code through ssh
Hi All, I need to run a perl script, which ssh'es to another box and has to run some code, which is given in the present script and return some value. Is that possible? Net::SSH doesnt seem to be the answer as it merely runs a command at the remote host. Thanks, Alok __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Keeping track of a variable
Hi All, Can someone please tell me how do we keep track of a variable. ie Whenever a particular variable is accessed (printed, incremented etc.), a counter should increase, so that we can know how many times it has been accesssed. Thanks in Advance, Regards, Alok __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: DBD for SQL Server?
--- Richard Crawford [EMAIL PROTECTED] wrote: Is there a DBD for SQL Server so that I can connect to our SQL Server 2000 database with DBI? I've hunted all over CPAN but I can't seem to find one. Windows uses the Open Database Connectivity (ODBC) Model. You can connect to an MS-SQL server using Win32::ODBC, available at http://search.cpan.org/~gsar/libwin32-0.191/ODBC/ODBC.pm More info - perldoc Win32::ODBC HTH, Alok __ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Perl Scripts examples
I am new to perl. Can somebody tell me about some link on internet from where i can find some scripts to begin with so that i can start getting style of writing code in perl. I have gone through o'reilly book and is looking for some practical exercises. Hi, the examples from Learning perl are available at: http://examples.oreilly.com/lperl3/llamasamp.zip the examples from Programming perl are available at: http://examples.oreilly.com/pperl3/examples.zip This info is also given on oreilly books. Alok __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Array in a regexp
--- Jason Dusek [EMAIL PROTECTED] wrote: Hi List, But if I have a long list of suffixes, then I would like to store the suffixes in an array, and then evaluate the array in my regular expression. What does this? I've tried: @SUFF = (fish,foul); foreach (@ARGV) { print if (/\.(@SUFFIXES)$/); } and also: @SUFF = (fish,foul); foreach (@ARGV) { print if (/\.(@[EMAIL PROTECTED])$/); } Hi, try this my @suffix=(txt, jpg, tif); my $pattern= join |, @suffix; foreach (@ARGV) { print if /\.$pattern$/; } HTH, Alok (BTW- Nice sig.) but I can't get it to work. -- -- Jason Dusek (`-''-/).___..--''`-._ -- | `6_ 6 ) `-. ( ).`-.__.`) -- | (_Y_.)' ._ ) `._ `. ``-..-' -- | _..`--'_..-_/ /--'_.' ,' -- | (il),-'' (li),' ((!.-' -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Array in a regexp
--- Alok Bhatt [EMAIL PROTECTED] wrote: --- Jason Dusek [EMAIL PROTECTED] wrote: Hi List, But if I have a long list of suffixes, then I would like to store the suffixes in an array, and then evaluate the array in my regular expression. What does this? I've tried: @SUFF = (fish,foul); foreach (@ARGV) { print if (/\.(@SUFFIXES)$/); } and also: @SUFF = (fish,foul); foreach (@ARGV) { print if (/\.(@[EMAIL PROTECTED])$/); } Hi, try this my @suffix=(txt, jpg, tif); my $pattern= join |, @suffix; foreach (@ARGV) { print if /\.$pattern$/; Forgot to add you should use /o option print if /\.$pattern$/o; so that it runs fater } HTH, Alok (BTW- Nice sig.) but I can't get it to work. -- -- Jason Dusek (`-''-/).___..--''`-._ -- | `6_ 6 ) `-. ( ).`-.__.`) -- | (_Y_.)' ._ ) `._ `. ``-..-' -- | _..`--'_..-_/ /--'_.' ,' -- | (il),-'' (li),' ((!.-' -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Variable $some_var will not stay shared
This is coz you have defined $arg1 and $arg2 to be local, hence when u defined a new subroutine, a new sope is defined, and is beyond the scope of $arg1 and $arg2. Hence the error. But wait, I thought 'my' variables were 'local to the enclosing block'. If you look at the enclosing block in my sample, it DOES include the nested subroutine. I guess I still don't understand. Hi, Not very sure but ... since show_results is accessing a variable outside its scope, it has become a closure. Also, it is a nested sub-routine. So the first-time it is called, both it and the calling func (_main) will refer to the same variable. But when it is called the next time, it will access its own copy of the two variables ($arg1 and $arg2) and hence the error message that the variables will not remain shared. HTH, Alok _main(); sub _main { my $arg1 = shift @ARGV; my $arg2 = shift @ARGV; show_results(); sub show_results { print $arg1 and $arg2\n; # - line 17 } } gives the following warnings: [EMAIL PROTECTED]:~/src/bempl/junk$ perl ev2.pl mary jane Variable $arg1 will not stay shared at ev2.pl line 17. Variable $arg2 will not stay shared at ev2.pl line 17. mary and jane Can you nest subroutines? What do the warnings mean? Aloha = Beau; __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Date problem
Hi All, I am facing this strange problem related to dates. When I print the date using the system's date command, it prints correctly. But when I do the same using localtime, it shows the month as wrong (1 month previous. bash-2.03$ perl -e '@a=localtime; print @a\n' 18 4 8 26 3 104 1 116 0 ^^^ bash-2.03$ perl -e '@a=localtime(time); print @a\n' 20 4 8 26 3 104 1 116 0 ^^^ bash-2.03$ date Mon Apr 26 08:04:23 GMT 2004 bash-2.03$ It shows the month as March (3) instead of April. What could I be doing wrong? Thanks in Advance __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Date problem
Hi, Thanks everyone for the answer. So silly of me. Didnt check the docs :$ --- Patrick Heffernan [EMAIL PROTECTED] wrote: On Mon, 26 Apr 2004 06:07:03 -0700 (PDT) Alok Bhatt hammered out: I am facing this strange problem related to dates. When I print the date using the system's date command, it prints correctly. But when I do the same using localtime, it shows the month as wrong (1 month previous. bash-2.03$ perl -e '@a=localtime; print @a\n' 18 4 8 26 3 104 1 116 0 ^^^ [Snip] bash-2.03$ date Mon Apr 26 08:04:23 GMT 2004 bash-2.03$ It shows the month as March (3) instead of April. What could I be doing wrong? I'm only a raw beginner in Perl, so hopefully I'm giving you the right information. I'm sure others in the list will point out my mistakes :) localtime returns the following: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) with $mon, the month, being in the range (0 .. 11). So January is 0 to December being 11. You aren't doing anything wrong, just misinterpreting the information. HTH -- Patrick Heffernan * Over the years, I've developed my sense of Maryvale Computer Service * deja vu so acutely that now I can remember Warwick - QLD * things that *have* happened before ... 07 4667 3807 * -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Help in using Modules
Hi all, Hi Urvashi, I am trying to use a module named Nary.pm in my code... tree.pl first line of my code says use Nary; # Module in the same dir as the script Can't locate object method new via package Nary (perhaps you forgot to load Nary?) at tree-trial.pl line 3. can anyone tell me where i am going wrong!!! The module that you are trying to load is not in the default path where perl searches for any modules. just do perl -e print @INC and copy the module (Nary.pm) to any of those directories. If the module needs to be installed, You will have to use the proper process to install the module. Just untar the module and read the README file. But I think, it should not be that difficult. Alok Bhatt __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Generating a chart/graph for comparison
Hi all, I need to capture data from oracle database and present it in form of a chart/ graph. Also, we need to compare the cureent week reports with last week, which can be done best through chart comparison. I checked out CPAN and found quite a few under category graph. Can someone please let me know, which would be the best module to handle this scenario. Thanks in advance. Alok __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Execute include and return variables
Hi all: Hi Tomas, I cannot include a file so it can return all the variables I assigned. #FILE1.pl $var1= tom; #FILE2.pl do FILE1.pl #open $prog,'FILE1.pl' or die $!, #use 'FILE1.pl' #import 'FILE1.pl' In FIle2: do FILE1.pl (use double quotes) If you want to use use , rename to file1.pm and use use file1, instead of use file1.pm. Hope that helps. :-) Alok __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: warn ?!
Hi Jai, A similar question was posted just yesterday. The difference between between the two lines (37 and 57) is that the second line contains a space after \n. As pointed earlier, you can take take it as a debugging option (ie remove \n or add a space and perl prints out the line no. too) :-) Alok Bhatt --- Jayakumar Rajagopal [EMAIL PROTECTED] wrote: Hi, In my program , $sth-execute fails since oracle tables already present. It is very natural. But the waring message output line 37 is different(just behaves as print) from same kind of message at line 57. Any suggestions please.. regards, Jay regression Testing table( default : reg_test_cols) name : Not able to create reg_test_cols ?? * this output is not similar as line 57 *** discrepancy report table ( default : disc_table) name : Not able to create disc_table at /tmp/selfextract.XX/install line 57, chunk 5. 26 $query=qq { create table reg_test_cols 27 ( tabname varchar2(40), 28colname varchar2(40), 29iskey varchar2(1), 30tocomp varchar2(1), 31primary key (tabname,colname) ) 32}; 33 34 $sth=$dbh-prepare($query)|| warn $DBI::errstr \n; 35 unless ($sth-execute() ) 36 { 37 warn Not able to create reg_test_cols \n ; 38 } 39 else 40 { 41 print Successfully created table reg_test_cols \n; 42 } 43 44 45 46 $query=qq { create table disc_table 47 ( tabname varchar2(40), 48querycols varchar2(2000), 49cond varchar2(2000), 50rerun varchar2(1), 51seq number(4), 52primary key (tabname,cond,seq) ) 53}; 54 $sth=$dbh-prepare($query) || warn $DBI::errstr\n ; 55 unless ($sth-execute() ) 56 { 57 warn Not able to create disc_table\n ; 58 } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response