Re: export variables

2007-12-29 Thread patmarbidon
Hello if you want to share variables content you might to use 'our' instead of 'my'. But I don't understand your example with 'use "file1.pl"'. I always use 'use module_name' and never 'use program_name' Can you tell us more [EMAIL PROTECTED] a écrit : Hello, Could someone tell me if this i

Re: Use of uninitialized value in numeric ne error

2007-12-21 Thread patmarbidon
What is the origin of $line ? if you wrote $line = you should remove the "\n" and or "\r\n" at the end of $line. And if the user enter not numeric value you should always shuch an error. You should check if the value is numeric or use 'eq' instead of '!=' . If you removed the "\n" ou "\r\n"

Re: Extract attribute from huge xml file

2007-12-10 Thread patmarbidon
If you are sure that the element is always writtent on a separate line. you should try open (FILE, my_file); while () if // { print "$1\n" ; } close (FILE) ; It is not XML like but it works very faster. Beginner a e'crit : Hi, I have a huge XML file, 1.7GB, 53080215 lines. I am t

Re: Write the output to a file

2007-12-10 Thread patmarbidon
Patrick Marion has written: I think that your 'close (OUTPUT)' is inside the sub 'pits' you might put it before 'sub pits {' to get it at the logiccal end of your program. John Jack has written : Hi Group I'm new to perl and haven't used it before. I'm still practising and trying my best to

Re: Perl script running

2007-12-10 Thread patmarbidon
patmarion has written perhaps you have sme quotas or restriction about CPU usage for a script. Can you have a look in your /var/log/messages just after the perl script stop sivasakthi a écrit : Hi all, I have running the perl script. In that script i have opened the very large file (2.5GB

Re: Question abount counting the total number of lines and put to an variable?

2007-11-30 Thread patmarbidon
Try this : my $number = 0 ; open (MYFILE, '123.txt'); while () { if ($_ =~ /^User:/) { ++$number ; print $_; } } close (MYFILE); print "Number:$number\n" ; Marco a écrit : Hi.. I have a question about how to count the total of line that shows on the screen. Here below is my code

Re: Freebsd + cron job +perl script

2007-11-30 Thread patmarbidon
Patrick MARION a écrit : Can you tell more about your script. The first thing about difference between command line dand cron is about environment or perhaps STDIN. Perhaps you can make a trace with several "print tracexxx" at several critical places in your script. Without redirection to

Re: FW: Regular expression

2007-10-21 Thread patmarbidon
Can you try if ( $projet =~ /^([EMAIL PROTECTED])@/ ) { $provb = $1 } You will collect all characters from the beginnning to the first '@'. If The first character is a '@' you will obtain an empty string. If the first character is a '@' and you want to exclude this case use '^([EMAIL PROTECTED

Re: Regular expression

2007-10-19 Thread patmarbidon
Can you try if ( $projet =~ /^([EMAIL PROTECTED])@/ ) { $provb = $1 } You will collect all characters from the beginnning to the first '@'. If The first character is a '@' you will obtain an empty string. If the first character is a '@' and you want to exclude this case use '^([EMAIL PROTECTED

Re: perl tk question

2007-09-25 Thread patmarbidon
can you add after your 'insert' $text1->update() to make a refresh. You need an update if there is no new event in your widget. Be areful : Don't use update for each line if you insert a lot of lines but only at the end of a batch or only every 100 lines to keep good performance. macus

Re: double-bars graph

2007-09-20 Thread patmarbidon
If you use one array for lib et one for data you will get one bar by lib If you use one array for lib and two arrays for data tou will get two bars for each lib. If you use one array for lib and three arrays for data tou will get three bars for each lib. And so long lists user a écrit :

Re: Perl/Tk Help

2007-09-19 Thread patmarbidon
PatMar : Can you add $text1->update() after your $text1->insert. widget->update is like a refresh on other X11 windows manager. CM Analyst a écrit : Hi All, I hope this is still the correct forum to get help with Perl/Tk... My goal is display the time in the GUI window but it doesn't do it

After fedora update, problem with CPAN install Compress::Zlib::gzopen

2007-09-14 Thread patmarbidon
Hello, I use fedora 7 and yesterday I updated perl with perl-5.8.8-23.fc7 After this update I want to install new modules with CPAN and I got this message : Catching error: 'Undefined subroutine &Compress::Zlib::gzopen called at /usr/lib/perl5/5.8.8/CPAN/Tarzip.pm line 103. ' at /usr/lib/perl5

Re: question over increasing the speed of a perl script

2007-08-14 Thread patmarbidon
patmarbidon a écrit : Luba Pardo a écrit : Dear list: I wrote a script that takes a list of ids from an input file and store these in an array in a pairwise-like manner (if total list is n then the array is (2 ^n)-n). I need to extract for each pair of ids a certain value from a huge file

Re: question over increasing the speed of a perl script

2007-08-14 Thread patmarbidon
Luba Pardo a écrit : Dear list: I wrote a script that takes a list of ids from an input file and store these in an array in a pairwise-like manner (if total list is n then the array is (2 ^n)-n). I need to extract for each pair of ids a certain value from a huge file that contains the pair of