Re: die and exit

2007-08-15 Thread Gunnar Hjalmarsson
Jeff Pang wrote: Does die call exit when it's excuted? If so,when I overwrote exit() function in my script,would die call this customized exit? I gave a test,but didn't see die calling exit distinctly. Neither did I. But you can override die() directly. sub die { print test

Format Question

2007-08-15 Thread Mathew Snyder
How would I go about sub-listing something. For instance, if I have a work order that has been worked on during different days, I want to list the work order once and each day below it. It would look like this: Ticket ID SubjectDate hh:mm

Re: Emptying several arrays at once

2007-08-15 Thread Paul Lalli
On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: From: Andrew Curry [EMAIL PROTECTED] Whilst you can do by turning off strict and using an array of arraynames and looping over them, its clear concise the way you are doing it. I think you could do something like

RE: Emptying several arrays at once

2007-08-15 Thread Andrew Curry
If you read my original email, I said it was a bad idea and also that you would need to turn strict off to do anything like that. The example below declared the arrays on the fly with strict not in place. -Original Message- From: Paul Lalli [mailto:[EMAIL PROTECTED] Sent: 15 August

Re: qr + shift

2007-08-15 Thread Paul Lalli
On Aug 14, 3:57 pm, [EMAIL PROTECTED] (Jay Savage) wrote: On 8/12/07, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: John W. Krahn wrote: yitzle wrote: Works: my $t = shift; my $id = qr($t); Doesn't work: my $id = qr(shift); Why? perldoc -q How do I expand

Re: Emptying several arrays at once

2007-08-15 Thread JeffHua
In a message dated 2007-8-15 22:08:56 中国标准时间, [EMAIL PROTECTED] writes: Not if you turn off strict like the poster suggested. Then symrefs are allowed, and you can access the an array by pretending that a string containing the name of the array is an array reference. This is not,

Re: die and exit

2007-08-15 Thread Gunnar Hjalmarsson
[ A while ago I commented on the same question in beginners-cgi, without knowing about the discussion here. Please do not multi-post!! http://lipas.uwasa.fi/~ts/http/crospost.html ] Jeff Pang wrote: Yes that's fine. I think when we say 'use Apache qw/exit/' in modperl scripts,it may do the

Re: Emptying several arrays at once

2007-08-15 Thread Chas Owens
On 8/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: In a message dated 2007-8-15 22:08:56 中国标准时间, [EMAIL PROTECTED] writes: Not if you turn off strict like the poster suggested. Then symrefs are allowed, and you can access the an array by pretending that a string containing the name

Read only part of file

2007-08-15 Thread Toddy Prawiraharjo
HI all, Is it possible to read only part of file in perl? At this moment I have script similar to: open (FH, “file); @FH = FH; foreach $line(@FH){ processing linebyline } close FH; However, I only need certain part of file only to be read (let say beginning 20 lines). Above method

Re: Read only part of file

2007-08-15 Thread JeffHua
In a message dated 2007-8-15 23:39:42 中国标准时间, [EMAIL PROTECTED] writes: open (FH, “file); @FH = FH; foreach $line(@FH){ processing linebyline } close FH; However, I only need certain part of file only to be read (let say beginning 20 lines). Yes perl's builtin variable '$.' stores the

Re: Format Question

2007-08-15 Thread Tom Phoenix
On 8/15/07, Mathew Snyder [EMAIL PROTECTED] wrote: How would I go about sub-listing something. For instance, if I have a work order that has been worked on during different days, I want to list the work order once and each day below it. It would look like this: Ticket ID

Re: die and exit

2007-08-15 Thread JeffHua
In a message dated 2007-8-15 23:24:44 中国标准时间, [EMAIL PROTECTED] writes: In addition to all the other replies, and if die() in mod_perl is your actual concern, please read http://perl.apache.org/docs/1.0/guide/porting.html#die___and_mod_perl exit(), OTOH, is a mod_perl issue that needs

Re: Emptying several arrays at once

2007-08-15 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Paul Lalli wrote: On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: From: Andrew Curry [EMAIL PROTECTED] I think you could do something like @arrays=('test1','test2','test3'); foreach my $array(@arrays) { @{$array}=(); } This wouldn't work. Correction.

Re: Emptying several arrays at once

2007-08-15 Thread JeffHua
In a message dated 2007-8-16 0:03:51 中国标准时间, [EMAIL PROTECTED] writes: Hey, please don't shout! YOU TMD SHOUT LIKE A DOG!ZAZHONG! ** Get a sneak peek of the all-new AOL at http://discover.aol.com/memed/aolcom30tour

Re: Read only part of file

2007-08-15 Thread yitzle
On 8/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: In a message dated 2007-8-15 23:39:42 中国标准时间, [EMAIL PROTECTED] writes: open (FH, file); @FH = FH; foreach $line(@FH){ processing linebyline } close FH; However, I only need certain part of file only to be read (let say beginning

Re: Emptying several arrays at once

2007-08-15 Thread Paul Lalli
On Aug 15, 11:03 am, [EMAIL PROTECTED] wrote: Yes you know this is not a good idea.I don't like to say what,but someone others maybe say, DON'T SUGGEST THIS BAD IDEA! Hey, buddy, I didn't suggest it. But pointing out that it's a bad idea and saying It doesn't work are two different things.

One liner to change one line

2007-08-15 Thread Dennis G. Wicks
Greetings; I have, conservatively, dozens of html files to change. I can find them and pass the file name to perl and do the usual s/// changes but there is one change I can't figure out. There is a line in each file that looks like H1This-Is-The-Title/H1 of course, they are all

Re: piping and reading stdin

2007-08-15 Thread Dr.Ruud
Chas Owens schreef: A one second sleep is common, but you can sleep for less than a second with usleep from the Time::HiRes* module if this is too slow for your purposes. AFAIK, a sleep 1 could take anything between 0 and 2 seconds. See also select(). -- Affijn, Ruud Gewoon is een tijger.

Re: Read only part of file

2007-08-15 Thread Paul Lalli
On Aug 15, 11:38 am, [EMAIL PROTECTED] (Toddy Prawiraharjo) wrote: Is it possible to read only part of file in perl? Yes. You can stop reading at any time. At this moment I have script similar to: open (FH, file); @FH = FH; Well there's your problem. You just read the entire file, all at

Re: How to convert csv file to excel

2007-08-15 Thread Chas Owens
On 8/14/07, Lawrence Statton [EMAIL PROTECTED] wrote: Can anybody help me how to convert csv file to excel file using Perl or Shell scripts? I would use Text::CSV_XS to read the CSV file and SpreadSheet::WriteExcel to produce the Excel file. snip In addition to the fine modules you

Re: One liner to change one line

2007-08-15 Thread Xavier Noria
On Aug 15, 2007, at 6:45 PM, Dennis G. Wicks wrote: Greetings; I have, conservatively, dozens of html files to change. I can find them and pass the file name to perl and do the usual s/// changes but there is one change I can't figure out. There is a line in each file that looks like

Re: One liner to change one line

2007-08-15 Thread Paul Lalli
On Aug 15, 12:45 pm, [EMAIL PROTECTED] (Dennis G. Wicks) wrote: Greetings; I have, conservatively, dozens of html files to change. I can find them and pass the file name to perl and do the usual s/// changes but there is one change I can't figure out. There is a line in each file that

Re: One liner to change one line

2007-08-15 Thread Xavier Noria
On Aug 15, 2007, at 7:04 PM, Xavier Noria wrote: perl -0777 -pi.bak -we 's{(h1)(.*?)(/h1)}{$x = $2; $x =~ tr:-: :; $1$x$3}geis' *.html A small improvement, groups are unnecessary because the elements are guaranteed not to have hyphens (in general they could, for instance in a class

Re: piping and reading stdin

2007-08-15 Thread Chas Owens
On 8/15/07, Dr.Ruud [EMAIL PROTECTED] wrote: Chas Owens schreef: A one second sleep is common, but you can sleep for less than a second with usleep from the Time::HiRes* module if this is too slow for your purposes. AFAIK, a sleep 1 could take anything between 0 and 2 seconds. See also

MP3 tags

2007-08-15 Thread Evyn
Hi, Is it possible to change mp3 tags using perl? I use iTunes and iPodder to download a number of podcasts, but I like to order them myself. I don't like the way iTunes handles that aspect. What I would like to do is change a mp3 tag (like album) before I import it into iTunes. Thanks for your

Re: MP3 tags

2007-08-15 Thread Tom Phoenix
On 8/15/07, Evyn [EMAIL PROTECTED] wrote: Is it possible to change mp3 tags using perl? Have you looked on CPAN? http://search.cpan.org/search?query=mp3 Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Displaying html document.

2007-08-15 Thread ash
Hi! What is good way to display html documents in GUI created by Perl script? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: MP3 tags

2007-08-15 Thread Paul Lalli
On Aug 15, 5:56 pm, [EMAIL PROTECTED] (Evyn) wrote: Is it possible to change mp3 tags using perl? Whenever you have a question along the lines of Can I do in Perl?, the first place you want to look is http://search.cpan.org http://search.cpan.org/~ilyaz/MP3-Tag-0.9709/Tag.pm Download and

Re: Displaying html document.

2007-08-15 Thread Gunnar Hjalmarsson
ash wrote: What is good way to display html documents in GUI created by Perl script? Not sure what you mean, but use CGI; my $cgi = CGI-new; ... print $cgi-header; print $html; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe,

problem connecting to mysql database

2007-08-15 Thread alok nath
Hi, This is the first time I am trying to use DBI module. When I try to connect to mysql db, I get the below error. Error : Uncaught exception from user code: install_driver(mysql) failed: Can't locate loadable object for

Net:SFTP Configuration

2007-08-15 Thread kilaru rajeev
Hi All, I have installed Net:SFTP on my UNIX (SOLARIS) machine. I have generated the Public and Private key pair. I have installed the Public on my remote machine with the server as OpenSSH. All the dependent modules are also installed. Please let me know what are all the remaining things I need