Re: Proper way to halt a script

2007-07-06 Thread kapil.V
Chas Owens wrote: On 7/5/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: I am reading perldoc.perl.org and am not understanding exit and die clearly. If I have a conditional in a sub that I want to validate with, what is the correct way to do the following: 1. End the sub and return

Re: Proper way to halt a script

2007-07-06 Thread kapil.V
Chas Owens wrote: On 7/5/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: I am reading perldoc.perl.org and am not understanding exit and die clearly. If I have a conditional in a sub that I want to validate with, what is the correct way to do the following: 1. End the sub and return

Query

2007-07-18 Thread kapil.V
Hi, su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ M|G]/sg; print "Total:$total\nUsed:$used\ n";

Re: Optimize my script

2007-07-18 Thread kapil.V
JeeBee wrote: Because I'm trying to match this regular expression a lot of times, that could very well be the point to improve. I can imagine this is the slowest part of the script: my $exp = "nan|-?inf|[0-9\.e\+\-]+"; my $stat_pat = "(?:\\s+($exp))(?:\\s+($exp))" . # $1 number of samples,

Re: Query

2007-07-19 Thread kapil.V
John W. Krahn wrote: kapil.V wrote: Hi, Hello, su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ M|G]/sg

Re: Query

2007-07-21 Thread kapil.V
Paul Lalli wrote: On Jul 18, 6:43 am, [EMAIL PROTECTED] (kapil.V) wrote: su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9

Detect Html

2007-08-08 Thread kapil.V
Hi, I tried this to see if the file is an html: perl -ne '!.+?!s and print "html\n"' html.htm This does not work. What is the problem? Thanks, Kapil.V -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Convert from hex

2007-08-09 Thread kapil.V
ifiles.com/uploads/mf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_(Mama_Told_Me)(128Kbps).mp3-bash-2.05b$ outputs it. Thanks, Kapil.V -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Help with data returned by regex match

2007-09-11 Thread kapil.V
print "$&\n"; print @contacts; This prints "1" But printing $& prints a block of XML. Why does the array contacts not contain the pattern matched?(Also tried assigning the matched pattern to a scalar.) Thanks, Kapil.V -- To unsubscribe, e-mail: [EMAIL PROTECTED

Mysql database not being updated

2007-09-24 Thread kapil.V
Hi, I used the code: sub set_min{ $host = shift; $date = shift; print "The host is $host and the date is $date\nIn the function set_min\n"; $host = SOX::get_db_host(); $user = SOX::get_db_user(); $passwd = SOX::get_db_passwd(); $