Re: Sorting dir output

2007-04-10 Thread yaron
unlink($afile) or warn "Cannot delete $afile. $!"; } } } Hope that helps Yaron Kahanovitch - Original Message - From: "Craig Schneider" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Tuesday, April 10, 2007 2:19:40 PM (GMT+0200) Auto-De

Re: Using regular expressions with delimitaters

2007-04-12 Thread yaron
takes the $version a treat it as a regular expression. I don't think that this is what you want. You actually want something like $version =~ /8\.1\.8/. Yaron Kahanovitch - Original Message - From: "Rodrigo Tavares" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Wedne

Re: Mails should not go in SPAM Box

2007-04-12 Thread yaron
Hi, What type of mail mechanism are you using? Do you really use sendmail or connect smtp server? Yaron Kahanovitch - Original Message - From: "Chas Owens" <[EMAIL PROTECTED]> To: "Anish Kumar K" <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Sent: Thursday

Re: How to set FTP module time out?

2007-04-12 Thread yaron
Hi, Lets set it to 200 secs use Net::FTP; my $ftp = new Net::FTP(hostnale,Timeout => 200); ... - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Thursday, April 12, 2007 5:33:30 PM (GMT+0200) Auto-Detected Subject: How to set FTP module time out? I see

Uninstalling perl module

2007-04-13 Thread yaron
Hi, I am using cpan to install modules. >From time to time I have to uninstall a module. Untill now I did not find a tool to do it. Is there an official tool for this? Thanks in advanced, Yaron Kahanovitch -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Uninstalling perl module

2007-04-14 Thread yaron
Hi, Thanks for the reply, I think that I understand you point. Now I am starting to fear cpan installations. Is there a chance that by doing a simple - naive cpan installation of a module I, potentially, can damage another installed module? Best regards, Yaron Kahanovitch - Original

cpanplus module cyclic dependency

2007-04-22 Thread yaron
/CPANPLUS/Error.pm - K/KA/KANE/CPANPLUS-0.78.tar.gz..pm blib/lib/CPANPLUS/Internals/Constants.pm Cannot continue.Dist/Base.pm blib/lib/CPANPLUS/Dist/Base.pm I am tring to install cpanplus on a cygwin. Has anyone a clue for that? Best regards, Yaron Kahanovitch -- To unsubscribe, e-mail: [EMAIL

Re: Environment variable

2007-04-23 Thread yaron
How about use lib split("\s+",$ENV{PATH}); Yaron Kahanovitch - Original Message - From: "Klaus Jantzen" <[EMAIL PROTECTED]> To: "Beginner Perl" Sent: 10:35:39 (GMT+0200) Asia/Jerusalem יום שני 23 אפריל 2007 Subject: Environment variable I l

Test of scripts with Test::More

2007-04-24 Thread yaron
Hi, Recently i wrote a perl module that includes package and a script. As part of the module sanity tests, I would like to run the script and verify a success. For that, I am using Test::More and Test::Simple. Is there any recommendations how to do this? Thanks, Yaron Kahanovitch -- To

Re: module installation problem

2007-04-24 Thread yaron
Hi, I think that you have a little mistake Run perl -MNet::FTP::Recursive -e "1;" instead of perl -MNet::Ftp::Recursive -e "1;". Yours, Yaron Kahanovitch - Original Message - From: "I.B." <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Wednesday,

Re: hellp improve efficiency

2007-04-29 Thread yaron
om# or $uri =~ s#www\.example\.com/([wulp])/#$1.example.com/#; print $uri; } Best regards Yaron Kahanovitch - Original Message - From: "Jen mlists" <[EMAIL PROTECTED]> To: "beginners perl" Sent: Saturday, April 28, 2007 10:57:07 AM (GMT+0200) Auto-Detected S

Re: creating hash from scalar variable

2007-04-29 Thread yaron
Hi, The line --> my %test = my($fname, $fvalu)=split(/=/, $test); Will insert only two elements into %test. Try: my %test = split (/=/,$test); Yaron Kahanovitch - Original Message - From: "Goksie" <[EMAIL PROTECTED]> To: "Perl Beginners" Sent: Sunday, A

Binary search

2007-05-01 Thread yaron
Hi all, Is there a perl built in function that search a value in sorted array? Although I found such an algorithm in the cpan (Search::Binary), I wonder if there is an efficient solution within the core perl. Thanks in advanced, Yaron Kahanovitch -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: How to eliminate the bareword error

2007-05-03 Thread yaron
You need to quote the sss and ttt use strict; use warnings; my $x=param("hhh"); my $y=param("sss"); my $z=param("ttt"); Yaron Kahanovitch - Original Message - From: "sivasakthi" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Thursday, Ma

Re: hash containing a hash, sorting keys help

2007-05-05 Thread yaron
Just a guess but maybe you shout use this: foreach my $child (sort keys( %{$parent{$pid}} )) { dump_process( $child ); } Yaron Kahanovitch - Original Message - From: "Ken Foskey" <[EMAIL PROTECTED]> To: "Perl Beginners" Sent: 16:48:17 (GMT+0200

Re: regular expression

2007-05-05 Thread yaron
Hi, If you wish to read, change xml tree structure and create a xml string again than XML::TreePP (http://search.cpan.org/~kawasaki/XML-TreePP-0.19/lib/XML/TreePP.pm) should be helpfull. Yaron Kahanovitch - Original Message - From: "xavier mas" <[EMAIL PROTECTED]&g

Re: Creating 100 buttons!

2007-05-06 Thread yaron
Hi, in stric mode you need to avoid soft references like this. Instead you can store the buttons in a hash: use Tk; use strict; my $mw = MainWindow->new; my %buttons = (); for(my $i=1;$i<=100;$i++){ my $bt='b'.$i; $buttons{$bt} = $mw->Button->pack; } MainLoop;

Re: looping through a file

2007-05-08 Thread yaron
ach my $prime_id ( @id_hits ) { foreach my $line( @lines ) { if ( $line =~ /$prime_id/ ) { print "$line\n"; next; } } } Hope that helps Yaron Kahanovitch - Original Message - From: "Robert Hicks" <[EMAIL PROTECTED]

Re: How to return actual string rather than the address to the result string

2007-05-09 Thread yaron
); $p->handler( text => \&text_handler, "dtext"); $p->parse($z); print $text; Yaron Kahanovitch - Original Message - From: "Michael Goopta" <[EMAIL PROTECTED]> To: "Perl Help" Sent: Wednesday, May 9, 2007 4:32:04 PM (GMT+0200) Auto-Dete

Re: How to return actual string rather than the address to the result string

2007-05-09 Thread yaron
HI again, You can consider using HTML::FormatText. This module returns a nice formatted text out of html data. Hope that helps Yaron Kahanovitch - Original Message - From: "Michael Goopta" <[EMAIL PROTECTED]> To: "Perl Help" Sent: Wednesday, May 9, 2007

Re: Stuck on a hash referrence, kinda

2007-05-13 Thread yaron
Hi, I am not sure that I understand your problem. In General if you want to check the existence of the key "user" in the first hash, you can use the following if ($dept and exists($dept->{user}){ }else{} Hope that helps Yaron Kahanovitch - Original Message -

Re: Stuck on a hash referrence, kinda

2007-05-13 Thread yaron
Hi again, In that case can use the following: if ($dept and exists($dept->{customer}{user}){ }else{} Yaron Kahanovitch - Original Message - From: "Mathew Snyder" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: "Perl Beginners" Sent: Sunday, May 13, 200

Re: Store contents of array in a variable?

2007-05-17 Thread yaron
Hi, >From your question I understand that you are looking for the join commang: my $var = join ("delimiter",[EMAIL PROTECTED]); Hope that helps Yaron Kahanovitch - Original Message - From: "Romeo Theriault" <[EMAIL PROTECTED]> To: beginners@perl.org S

Re: Store contents of array in a variable?

2007-05-17 Thread yaron
i again A little correction: my $var = join ("delimiter",@$array_ref); Yaron Kahanovitch - Original Message - From: [EMAIL PROTECTED] To: "Romeo Theriault" <[EMAIL PROTECTED]> Cc: beginners@perl.org Sent: 23:53:23 (GMT+0200) Asia/Jerusalem יום חמישי 17 מ

Re: pass variable to another program

2007-05-17 Thread yaron
Hi, I think that you are looking for a serialization mechanism. For that you can use the Storable module (http://search.cpan.org/~ams/Storable-2.16/Storable.pm) All you need to do is to freeze the variable in the first process, send it by pipe and thaw it in the other process. Yaron

Re: RegEx again

2007-05-20 Thread yaron
) @keywords=sort(@keywords); my $diff = Array::Diff->diff( [EMAIL PROTECTED], [EMAIL PROTECTED] ); print "1\n" if $diff->count; $diff = Array::Diff->diff( [EMAIL PROTECTED], [EMAIL PROTECTED] ); print "2\n" if $diff->count; This might give you a hint. Yaron Kah

Re: Query an IP from file

2007-05-22 Thread yaron
, Yaron Kahanovitch - Original Message - From: "Jeff Pang" <[EMAIL PROTECTED]> To: "Perl Beginners" Sent: 11:45:43 (GMT+0200) Africa/Harare יום שלישי 22 מאי 2007 Subject: Query an IP from file Hello, I have a text file which contains lots of IPs,like: 58

Re: parsing html data

2007-05-22 Thread yaron
www.dictionary.com (and use the perl module WWW::Dictionary http://search.cpan.org/~cog/WWW-Dictionary-0.01/lib/WWW/Dictionary.pm) or even wikipedia (WWW::Wikipedia at http://search.cpan.org/~bricas/WWW-Wikipedia-1.92/lib/WWW/Wikipedia.pm). You can manu more dictionaries in the cpan. Yaron

Re: Upload a directory to remote FTP server

2007-05-24 Thread yaron
Hi, Did you try to use Net::FTP::Recursive (http://search.cpan.org/~jdlee/Net-FTP-Recursive-2.00/Recursive.pm) It seems to fit to your task. Yaron Kahanovitch - Original Message - From: "Shu Cho" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Thursday, May 24, 2007

Re: accesing a hash of an array of hashes

2007-05-26 Thread yaron
my ($field,$value) = each %$hash_ref) { print "Fieal = $field, value = $value\n"; } } Hope that helps Yaron Kahanovitch - Original Message - From: "pauld" <[EMAIL PROTECTED]> To: beginners@perl.org, [EMAIL PROTECTED] Sent: 14:17:57 (GMT+0200) A

Re: accesing a hash of an array of hashes

2007-05-26 Thread yaron
Hi, Be aware that you have a small problem. Your script includes: for (my $j=1;$j<$#rows;$j++) ... for (my $i=0;$i<$#columns;$i++) I think It should be for (my $j=1;$j<=$#rows;$j++) ... for (my $i=0;$i<=$#columns;$i++) Cheers Yaron Kahanovitch - Original Message -

Re: Remove a specific element from an Array

2007-07-09 Thread yaron
Hi You might want to take a look at Array::Diff http://search.cpan.org/~typester/Array-Diff-0.04/lib/Array/Diff.pm Yaron Kahanovitch - Original Message - From: "Sumit" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Monday, July 9, 2007 10:43:48 AM (GMT+0200) Auto-

How to get a list of child processes (Unix systems only)

2007-07-10 Thread yaron
Hi, I am looking for an efficient way to get list of child (forked) processes of a given processes id. Has anyone idea how to do it in "pure perl style" ? Thanks in advance, Yaron Kahanovitch -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: How to get a list of child processes (Unix systems only)

2007-07-11 Thread yaron
::Forking object. Yours, Yaron Kahanovitch - Original Message - From: "Jeff Pang" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Wednesday, July 11, 2007 10:18:12 AM (GMT+0200) Auto-Detected Subject: Re: How to get a list of child processes (Unix systems only) --- [EMAIL

Re: How to get a list of child processes (Unix systems only)

2007-07-12 Thread yaron
Hi, Thanks for the reply, Indeed our code solves the problem but not efficiently. Your have to iterate over all running processes in order to filter the child processes. I wondered if there is a possibility to directly get the child processes. anyway thanks, Yaron Kahanovitch

Re: How to get a list of child processes (Unix systems only)

2007-07-12 Thread yaron
Thanks, Seems so logical. Yaron Kahanovitch - Original Message - From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: "Paul Lalli" <[EMAIL PROTECTED]>, beginners@perl.org Sent: Thursday, July 12, 2007 12:59:02 PM (GMT+0200) A

Re: obtaining file properties

2007-07-15 Thread yaron
Hi, You can use File::stat. perldoc -f stat or http://search.cpan.org/~nwclark/perl-5.8.8/lib/File/stat.pm Yaron Kahanovitch - Original Message - From: "Sam DeForest" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Sunday, July 15, 2007 8:05:15 AM (GMT+0200) Auto-

Re: Optimize my script

2007-07-18 Thread yaron
nce breaking complicated regular expression into some small >ones with the /\G.../gc idiom improve performance. Yaron Kahanovitch - Original Message - From: "JeeBee" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: 11:49:24 (GMT+0200) Africa/Harare יום רביעי 18 יולי 2007

Re: Query

2007-07-22 Thread yaron
You can always choose to walk the kings road: use Filesys::DiskSpace; ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir; $total = $used + $avail; print "Total:$total\nUsed:$used\ n"; Yaron Kahanovitch - Original Message - From: "kapil.V" <[EMAIL PR

Re: Simple loop issue

2007-07-23 Thread yaron
as/libwww-perl-5.806/lib/HTTP/Status.pm for details Hope that helps Yaron Kahanovitch - Original Message - From: "Javier Prats" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Monday, July 23, 2007 5:04:58 PM (GMT+0200) Auto-Detected Subject: Simple loop issue Hello

Re: Accessing to a HTML Frame

2007-07-25 Thread yaron
HI Tatiana, There is a special module that specialize in such tasks: WWW::Mechanize You can take a look at a similar question at: http://search.cpan.org/~petdance/WWW-Mechanize-1.30/lib/WWW/Mechanize/FAQ.pod#How_do_I_handle_frames? Good luck Yaron Kahanovitch - Original Message - From

Re: Test if string does not exist in an array.

2007-07-26 Thread yaron
Hi, Perl has a built in function that do just that: if (my $username = getpwuid($input_uid)) { print "Founf the user $username\n"; } else { print "No user found\n"; } for help try perldoc -f getpwent perldoc -f getpwnam perldoc -f getpwuid BFN Yaron Kahanovi

Re: Light at the end of Module Prerequisite Tunnel?

2007-07-29 Thread yaron
Hi, I would say that cpan does just that. Just run perl -MCPAN -e shell and.. >> install XML::RSS For more help see http://cpan.uwinnipeg.ca/htdocs/CPAN/CPAN.html BFN, Yaron Kahanovitch - Original Message - From: "Jerry Krinock" <[EMAIL PROTECTED]> To: beginner

Re: Read and Write Image Files

2007-07-29 Thread yaron
Hi... open (IMAGE, $imgfile) || die "Can't Open $imgfile\n"; binmode(IMAGE); open (OUTPUT, ">$outputfile") || die "Can't Open $outputfile\n"; binmode(OUTPUT); my $buf; my $bufSize = 4096; while (read(IMAGE,$buf,$bufsize)) { pri

Re: Precedence?

2007-07-29 Thread yaron
See http://www.perl.com/doc/manual/html/pod/perlop.html Yaron Kahanovitch - Original Message - From: "Ryan Dillinger" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: 21:06:55 (GMT+0200) Africa/Harare יום ראשון 29 יולי 2007 Subject: Precedence? Hello, I have written this

Re: Light at the end of Module Prerequisite Tunnel?

2007-07-31 Thread yaron
Hi Jerry, Most of the perl distribution comes with cpan. If you don't have cpan by default (say you work with active perl), I suggest you work with distribution that supplies cpan. If you work on windows I reccomend to work with cygwin (http://www.cygwin.com/). Best regards, Yaron Kahano

Re: XML to inMemory Hash

2007-08-01 Thread yaron
Hi, Did you try to use XML::TrePP. It seems to fit your needs. http://search.cpan.org/~kawasaki/XML-TreePP-0.22/lib/XML/TreePP.pm Yaron Kahanovitch - Original Message - From: "Prabu Ayyappan" <[EMAIL PROTECTED]> To: "perl Beginner" Sent: Wednesday, August 1,

Re: Removing duplicate records

2007-08-01 Thread yaron
Small correction Try open my F, '>outputsample1' or die 'Failed to open outputsample1'; my $f = \*F; while (($key, $value) = each %hash) { print $f $value."\n"; } close $f; Yaron Kahanovitch - Original Message - From: [EMAIL PROT

Re: Removing duplicate records

2007-08-01 Thread yaron
mple1'; while (($key, $value) = each %hash) { print $f $value."\n"; } close $f; Try open my F, '>outputsample1' or die 'Failed to open outputsample1'; my $f = \*F; while (($key, $value) = each %hash) { print F $value."\n&quo

Re: Removing duplicate records

2007-08-01 Thread yaron
Hi, The code was tested. and it compiles for mee Yaron - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Wednesday, August 1, 2007 2:23:44 PM (GMT+0200) Auto-Detected Subject: Re: Removing duplicate records [EMAIL PROTECTED]

Range operator

2007-08-09 Thread yaron
6 I would like to accomplish that with range operator. But the following script will add the FROM ann the END line to the output. Is there an efficient way to do that. In other words I would like to have range operator that will return true for all the line inside the range not includin

Re: Range operator

2007-08-09 Thread yaron
Hi Chas and Jeff, Thanks for your detailed answers. From chas answer I understand that this problem is addressed in perl 6. So, I will have to wait a bit In the meanwhile I will have to write my own "smart" flipflop. BFN Yaron Kahanovitch - Original Message - F

Re: qr + shift

2007-08-11 Thread yaron
Hi, my $id = qr(shift); will not work from the same reason that my $id = "shift" will not work!!! Yours, Yaron Kahanovitch - Original Message - From: "yitzle" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Sunday, August 12, 2007 7:55:38 AM (GMT+0200)

Re: first ip and last ip

2007-08-12 Thread yaron
Hi, Take a look at Net::IP http://search.cpan.org/~manu/Net-IP-1.25/IP.pm Yaron Kahanovitch - Original Message - From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Monday, August 13, 2007 7:30:27 AM (GMT+0200) Auto-Detected Subject: first ip and last ip Hello, Given this ip range

Re: How to read a very large file??

2007-08-13 Thread yaron
Hi, You can always read a file backwards until you reach a position that was already processed. This can be done by using File::ReadBackwards. Hope that helps Yaron Kahanovitch - Original Message - From: "sivasakthi" <[EMAIL PROTECTED]> To: "beginners perl"

Re: perl script to crawl the web

2007-08-27 Thread yaron
/Mechanize.pm end some useful examples at http://search.cpan.org/~petdance/WWW-Mechanize-1.30/lib/WWW/Mechanize/Examples.pod Yaron Kahanovitch - Original Message - From: "perl pra" <[EMAIL PROTECTED]> To: "Beginners List" Sent: Monday, August 27, 2007 10:13:25 A

Re: Overlapping substitution

2007-10-16 Thread yaron
Hi, I think that you are looking for a "zero-width positive lookahead assertion" i.e. (?=...) So a solution for problem might be: my $line = ",.,.,."; $line =~ s/,\.(?=,|$)/,/g; TTFN Yaron Kahanovitch - Original Message - From: "Kevin Viel" <

Re: Trying to figureout regex please help

2007-10-24 Thread yaron
Hi, You can also try use Regexp::Common::Email::Address. See http://search.cpan.org/~cwest/Regexp-Common-Email-Address-1.01/lib/Regexp/Common/Email/Address.pm Yaron Kahanovitch - Original Message - From: "Andrew Curry" <[EMAIL PROTECTED]> To: "Andrew Curry" &

Re: qx string

2007-10-24 Thread yaron
Hi, I think you don't run the script under perl try: perl Any way, if you are using Unix system, look at your script and figure if the first line have the shbang "#!/usr/bin/perl" Yaron Kahanovitch - Original Message - From: "Irfan Sayed (Irfan)" <[EMA

Re: qx string

2007-10-24 Thread yaron
Hi, Sorry my mistake its not a shbang problem... Yaron - Original Message - From: [EMAIL PROTECTED] To: "Irfan Sayed (Irfan)" <[EMAIL PROTECTED]> Cc: beginners@perl.org Sent: Wednesday, October 24, 2007 7:06:47 PM (GMT+0200) Asia/Jerusalem Subject: Re: qx string Hi, I

Re: How can I assign system() call to a Variable

2007-11-14 Thread yaron
Hi, Note that you can use the $? variable to get the command exit status: Yaron Kahanovitch - Original Message - From: "Jeff Pang" <[EMAIL PROTECTED]> To: "Beginner" <[EMAIL PROTECTED]> Cc: beginners@perl.org Sent: Wednesday, November 14, 2007 11:24

[perl #40345] splice question

2006-09-19 Thread Tova Yaron
Hello, Trying to remove from array blank lines, its look like splice get confuse with the array size after removing the blank entry. Or maybe I'm getting confuse.. Thanks Dov use strict; my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8, $str9,) =