Re: Please help: perl run out of memory

2022-04-27 Thread David Emanuel da Costa Santiago
Às 11:33 de 17/04/22, wilson escreveu: hello the experts, can you help check my script for how to optimize it? currently it was going as "run out of memory". $ perl count.pl Out of memory! Killed My script: use strict; my %hash; my %stat; To be honest you don't need the %stat, however

Re: Please help: perl run out of memory

2022-04-26 Thread hw
On Sun, 2022-04-17 at 17:33 +0800, wilson wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ perl count.pl > Out of memory! > Killed I would use a database like Mariadb for this, not only to create a repor

Re: Please help: perl run out of memory

2022-04-22 Thread David Precious
On Thu, 21 Apr 2022 07:12:07 -0700 al...@coakmail.com wrote: > OP maybe need the streaming IO for reading files. Which is what they were already doing - they used: while () { ... } Which, under the hood, uses readline, to read a line at a time. (where "HD" is their global fileh

Re: Please help: perl run out of memory

2022-04-21 Thread alice
OP maybe need the streaming IO for reading files. Thanks On 2022-04-21 21:56, David Precious wrote: > On Thu, 21 Apr 2022 17:26:15 +0530 > "M.N Thanishka sree Manikandan" wrote: > >> Hi wilson >> Try this module file::slurp > > Given that the OP is running into memory issues processing an 80

Re: Please help: perl run out of memory

2022-04-21 Thread David Precious
On Thu, 21 Apr 2022 17:26:15 +0530 "M.N Thanishka sree Manikandan" wrote: > Hi wilson > Try this module file::slurp Given that the OP is running into memory issues processing an 80+ million line file, I don't think suggesting a CPAN module designed to read the entire contents of a file into mem

Re: Please help: perl run out of memory

2022-04-21 Thread M.N Thanishka sree Manikandan
Hi wilson Try this module file::slurp Regards, Manikandan On Sun, 17 Apr, 2022, 15:03 wilson, wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ perl count.pl > Out of memory! > Killed > > > My script: > u

Re: Please help: perl run out of memory

2022-04-21 Thread Adriel Peng
I am not sure, but can Tie::Hash etc be used by tying hash to a local file to reduce the memory use? regards.

Re: Please help: perl run out of memory

2022-04-18 Thread Rob Coops
Hi Wilson, Looking at the script I see some room for improvement. You currently declare %hash as a global variable, and keep it around forever. With tens of millions of rows that is quite a large structure to just have sitting around after you have build the %stat hash. So I would start by limitin

Re: Please help: perl run out of memory

2022-04-17 Thread David Mertens
I see nothing glaringly inefficient in the Perl. This would be fine on your system if you were dealing with 1 million items, but you could easily be pushing up against your system's limits with the generic data structures that Perl uses, especially since Perl is probably using 64-bit floats and int

RE: please help correct my script

2013-11-07 Thread Wang, Li
From: Shaji Kalidasan [shajiin...@yahoo.com] Sent: Thursday, November 07, 2013 4:30 AM To: Wang, Li; beginners@perl.org Subject: Re: please help correct my script Dear Wang, It is actually writing the desired info to the output file "summaryOFdNdS.txt". Here is the content of

RE: please help correct my script

2013-11-07 Thread Wang, Li
Dear Shaji Yes, that is what I want for the output file. Best Li From: Shaji Kalidasan [shajiin...@yahoo.com] Sent: Thursday, November 07, 2013 4:30 AM To: Wang, Li; beginners@perl.org Subject: Re: please help correct my script Dear Wang, It is actually writing

Re: please help correct my script

2013-11-07 Thread Jim Gibson
On Nov 7, 2013, at 2:28 AM, David Precious wrote: > On Wed, 6 Nov 2013 23:51:04 + > "Wang, Li" wrote: > >> Dear Perl Users >> >> I have hundreds of input files, named as geneName_paml_formated.mlc >> In each file, there are some contents similar as follows: >> >> w (dN/dS) for branches:

Re: please help correct my script

2013-11-07 Thread Shaji Kalidasan
Dear Wang, It is actually writing the desired info to the output file "summaryOFdNdS.txt". Here is the content of the output file. In my case, I gave the filename "mydata.txt" as command line argument [content of summaryOFdNdS.txt] geneNamebranchtNSdN/dSdNdSN*dNS*dS mydata.txt5..1      0.043  1

Re: please help correct my script

2013-11-07 Thread David Precious
On Wed, 6 Nov 2013 23:51:04 + "Wang, Li" wrote: > Dear Perl Users > > I have hundreds of input files, named as geneName_paml_formated.mlc > In each file, there are some contents similar as follows: > > w (dN/dS) for branches: 0.00010 1.07967 145.81217 0.00010 > dN & dS for each branch > b

please help correct my script

2013-11-07 Thread Wang, Li
Dear Perl Users I have hundreds of input files, named as geneName_paml_formated.mlc In each file, there are some contents similar as follows: w (dN/dS) for branches: 0.00010 1.07967 145.81217 0.00010 dN & dS for each branch branch t N S dN/dS dN dS N*dN S*dS

Please help me polish the code

2012-03-14 Thread lina
Hi, If you have time, I will be very appreciate you helping transform below code. I have just uploaded the whole files into the following link: https://docs.google.com/open?id=0B93SVRfpVVg3QzdsYUNkOU5SSHEtOTlqVm54WUdjdw can run with perl extractbib.pl sample.tex #!/usr/bin/env perl use strict

Re: Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread Jim Gibson
On 7/21/11 Thu Jul 21, 2011 4:27 PM, "newbie01 perl" scribbled: > Hi all, > > In Oracle, there is a file named tnsnames.ora that contains connection > strings to Oracle Databases. > > At the moment the file is 1+ lines long. We are currently having a > problem where the file is malformed,

Re: Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread Jim Gibson
On 7/21/11 Thu Jul 21, 2011 4:27 PM, "newbie01 perl" scribbled: > Hi all, > > In Oracle, there is a file named tnsnames.ora that contains connection > strings to Oracle Databases. > > At the moment the file is 1+ lines long. We are currently having a > problem where the file is malformed,

Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread newbie01 perl
Hi all, In Oracle, there is a file named tnsnames.ora that contains connection strings to Oracle Databases. At the moment the file is 1+ lines long. We are currently having a problem where the file is malformed, i.e. missing matching brackets. Can any of the experts please advise how best to

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-23 Thread addie
> Where did $var come from? Sorry about that. That was a left over from the actual code that I tried to pare down to be a small example. Messed that up as badly as the copy/paste of the code made it really very ugly. Addie -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "JWK" == John W Krahn writes: JWK> Uri Guttman wrote: >>> "a" == addie writes: >> a> %hash = split(/\s/, $locus_line); >> >> that assigns a single pair to the hash. a SINGLE PAIR to the WHOLE >> HASH. anything in the hash before that is wiped out. also the values >> w

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Rob Dixon
On 21/11/2010 09:56, addie wrote: I have been fighting with this problem for over a week now he really aggravating thing is that I had it working for over a year without problem. have tried everything I can imagine. I've cut the code down to a toy version to isolate the problem and it is no help

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread John W. Krahn
Uri Guttman wrote: "a" == addie writes: a> %hash = split(/\s/, $locus_line); that assigns a single pair to the hash. a SINGLE PAIR to the WHOLE HASH. anything in the hash before that is wiped out. also the values will have newlines on them which isn't the main bug but is usually wrong

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> On 10-11-21 12:49 PM, Uri Guttman wrote: a> my %hash = (); >> >> no need to initialize a lexical hash with (). SHC> Sorry but you should initialize all your variables. At one time SHC> mod_perl did not initialize the data space; it simply r

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "a" == addie writes: a> #!/usr/bin/ a> perl a> \ that is VERY strange line wrapping. please be careful how you paste code so it doesn't do that. readers can't then paste the code and run it without cleaning up the wrapped lines. a> use strict; a> use warnings; a> my %hash =

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Shawn H Corey
On 10-11-21 12:49 PM, Uri Guttman wrote: a> my %hash = (); no need to initialize a lexical hash with (). Sorry but you should initialize all your variables. At one time mod_perl did not initialize the data space; it simply re-used it. So your variables started with whatever was in them

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Shawn H Corey
On 10-11-21 04:56 AM, addie wrote: #!/usr/bin/ perl \ use strict; use warnings; my %hash = (); my $key = ''; open ACCESSIONS, "fix.txt" or die "Can't open fix.txt: $!\n"; while (my $locus_line =){ #This is supposed to populate %hash. %hash = split(/\s/, $locus_line); foreach my $k (ke

Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread addie
I have been fighting with this problem for over a week now he really aggravating thing is that I had it working for over a year without problem. have tried everything I can imagine. I've cut the code down to a toy version to isolate the problem and it is no help. For the sake of this issue let's s

Re: Please help to load script from secure server HTTPS in Safari and Opera

2010-01-04 Thread Steve Bertrand
Jeremiah Foster wrote: > On Jan 5, 2010, at 1:03, Steve Bertrand wrote: > >> Jeremiah Foster wrote: >>> On Jan 4, 2010, at 11:49, Simphiwe Mkhize wrote: >>> >>>> Good new year >>>> >>>> Can any one please help me to solve pr

Re: Please help to load script from secure server HTTPS in Safari and Opera

2010-01-04 Thread Jeremiah Foster
On Jan 5, 2010, at 1:03, Steve Bertrand wrote: > Jeremiah Foster wrote: >> On Jan 4, 2010, at 11:49, Simphiwe Mkhize wrote: >> >>> Good new year!!!! >>> >>> Can any one please help me to solve problem with Safari, Google Chrome and >>> Opera.

Re: Please help to load script from secure server HTTPS in Safari and Opera

2010-01-04 Thread Steve Bertrand
Jeremiah Foster wrote: > On Jan 4, 2010, at 11:49, Simphiwe Mkhize wrote: > >> Good new year >> >> Can any one please help me to solve problem with Safari, Google Chrome and >> Opera. my script has to load from secure server HTTPS for security reason. >&g

Re: Please help to load script from secure server HTTPS in Safari and Opera

2010-01-04 Thread Jeremiah Foster
On Jan 4, 2010, at 11:49, Simphiwe Mkhize wrote: > Good new year > > Can any one please help me to solve problem with Safari, Google Chrome and > Opera. my script has to load from secure server HTTPS for security reason. > It works fine from IE and Firefox. > > Here

Please help to load script from secure server HTTPS in Safari and Opera

2010-01-04 Thread Simphiwe Mkhize
Good new year Can any one please help me to solve problem with Safari, Google Chrome and Opera. my script has to load from secure server HTTPS for security reason. It works fine from IE and Firefox. Here are the errors I get 1. Opera Error! Could not connect to remote server You tried

Re: Please help me recover my Perl script.

2009-12-27 Thread Owen
>> >> What does it say in a hex editor? >> > > > # hexdump Test.pl > 000 > * > 0001090 > 0001094 I would take a guess and say don't waste anymore time on it. Put your energies in rewriting the program -- Owen -- To unsubscribe, e

Re: Please help me recover my Perl script.

2009-12-27 Thread Parag Kalra
> > What does it say in a hex editor? > # hexdump Test.pl 000 * 0001090 0001094 Cheers, Parag

Re: Please help me recover my Perl script.

2009-12-27 Thread Owen
>> >> I think it's from UTF-16 to UTF-8. >> >> > > That doesn't seem to work. > > When I try to view my roasted file through 'less' command I get > following > output: > > # less Test.pl > *"Test.pl" may be a binary file. See it anyway? * > > Is there a way I can convert this binary file to its i

Re: Please help me recover my Perl script.

2009-12-27 Thread Parag Kalra
> > I think it's from UTF-16 to UTF-8. > > That doesn't seem to work. When I try to view my roasted file through 'less' command I get following output: # less Test.pl *"Test.pl" may be a binary file. See it anyway? * Is there a way I can convert this binary file to its initial readable state.

Re: Please help me recover my Perl script.

2009-12-27 Thread Shlomi Fish
On Sunday 27 Dec 2009 12:19:48 Shlomi Fish wrote: > On Friday 25 Dec 2009 09:07:53 Parag Kalra wrote: > > Can anyone please let me know how to use 'iconv' command with Perl > > script. > > > > I mean what should be my input and output file format while using 'iconv' > > with a Perl script which wil

Re: Please help me recover my Perl script.

2009-12-27 Thread Shlomi Fish
> I was coding my Perl script in Notepad++ editor and it was on verge of > > completion. > > > > All of a sudden my machine rebooted. And after that I found all my data > > lost. It is containing series of 'NUL' characters. > > > > However size of the P

Re: Please help me recover my Perl script.

2009-12-25 Thread Randal L. Schwartz
> "Parag" == Parag Kalra writes: Parag> I was coding my Perl script in Notepad++ editor and it was on verge of Parag> completion. Parag> All of a sudden my machine rebooted. And after that I found all my data Parag> lost. It is containing series of 'NUL' characters. Welcome to Windows. Per

Re: Please help me recover my Perl script.

2009-12-24 Thread Parag Kalra
acters. > > However size of the Perl script is same as it was earlier. > > Please help me recover my Perl script. > > TIA > > Cheers, > Parag > > >

Please help me recover my Perl script.

2009-12-24 Thread Parag Kalra
Hello All, I was coding my Perl script in Notepad++ editor and it was on verge of completion. All of a sudden my machine rebooted. And after that I found all my data lost. It is containing series of 'NUL' characters. However size of the Perl script is same as it was earlier. Plea

Re: Can you please Help perl readdir multiple folders and files with pre same name

2009-12-18 Thread Robert Wohlfarth
On Fri, Dec 18, 2009 at 7:13 AM, Simphiwe Mkhize wrote: > Here is my solution thank you for help > > .. > > &my_read_dms_booking_folders('c:/bookings') ; > > sub my_read_dms_booking_folders{ > > my ($bookingspath) = @_ ; > > opendir(DIR, "$bookingspath") or die "cant open $bookingspath: $!\n";

Re: Can you please Help perl readdir multiple folders and files with pre same name

2009-12-18 Thread Shlomi Fish
On Friday 18 Dec 2009 15:13:24 Simphiwe Mkhize wrote: > Here is my solution thank you for help > What? Have you read what I wrote to you? You didn't reply. This code still contains many bad and ancient Perl paradigms that I've pointed to you. Please read what I've written and correct your new c

Re: Can you please Help perl readdir multiple folders and files with pre same name

2009-12-18 Thread Simphiwe Mkhize
an't lock $phonelog: $!"; while () { chomp; @linex = split(/\|/); &plfields; &build_days; } close (P1FILE); } . Simphiwe Mkhize wrote: Please Help I have multiple folders want to read trough each folder and search for certian file. I

Re: Can you please Help perl readdir multiple folders and files with pre same name

2009-12-17 Thread Shlomi Fish
On Thursday 17 Dec 2009 17:07:19 Simphiwe Mkhize wrote: > Please Help > > I have multiple folders want to read trough each folder and search for > certian file. I have code which is working fine but does not do what I > want. I dont want to hard code path as it read different fol

Can you please Help perl readdir multiple folders and files with pre same name

2009-12-17 Thread Simphiwe Mkhize
Please Help I have multiple folders want to read trough each folder and search for certian file. I have code which is working fine but does not do what I want. I dont want to hard code path as it read different folder within sub get_phone_log

答复: mkdir in the mounted partiti on£¬please help me£¬thanks

2009-11-17 Thread gaochong
/dev/sdd1 1.7T 639G 1004G 39% /data6 /dev/sdf1 1.7T 1.1T 578G 65% /data8 -邮件原件- 发件人: John W. Krahn [mailto:jwkr...@shaw.ca] 发送时间: 2009年11月18日 14:12 收件人: Perl Beginners 主题: Re: mkdir in the mounted partition£¬please help me£¬thanks gaochong wrote: > #!/us

Re: mkdir in the mounted partition£¬please help me£¬thanks

2009-11-17 Thread John W. Krahn
gaochong wrote: #!/usr/bin/perl -w #Auther:gaochong use strict; my @list = (3 .. 9); my @FA=("FA0001".."FA2000"); sub mk_fa { my ($f) = @_; foreach my $p (@list) { mkdir "/data$p/NRU/$f",0755 or warn "mkdir /data$p/NRU/$f err:$!"; symlink

答复: 答复: mkdir in the mounted par tition,please help me,thanks

2009-11-17 Thread gaochong
I did not receive err msg . -邮件原件- 发件人: Dermot [mailto:paik...@googlemail.com] 发送时间: 2009年11月17日 20:16 收件人: beginners@perl.org 主题: Re: 答复: mkdir in the mounted partition,please help me,thanks 2009/11/17 gaochong : > but I have uses perl -w。 > any other problem ? Did you recei

Re: 答复: mkdir in the mounted partition,please help me,thanks

2009-11-17 Thread Dermot
2009/11/17 gaochong : > but I have uses perl -w。 > any other problem ? Did you receive and error message? Dp. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

答复: mkdir in the mounted partiti on,please help me,thanks

2009-11-17 Thread gaochong
but I have uses perl -w。 any other problem ? -邮件原件- 发件人: Dermot [mailto:paik...@googlemail.com] 发送时间: 2009年11月17日 19:53 收件人: beginners@perl.org 主题: Re: mkdir in the mounted partition,please help me,thanks 2009/11/17 gaochong : > #!/usr/bin/perl -w > > > > #Auther:gaoch

Re: mkdir in the mounted partition,please help me ,thanks

2009-11-17 Thread Dermot
2009/11/17 gaochong : > #!/usr/bin/perl -w > > > > #Auther:gaochong > > > > use strict; > > > > my @list = (3 .. 9); > > my @FA=("FA0001".."FA2000"); > > sub mk_fa { > >        my ($f) = @_; > >        foreach my $p (@list) { > >                mkdir "/data$p/NRU/$f",0755 or warn "mkdir /da

Re: Please Help Me!

2009-07-25 Thread Chas. Owens
On Sat, Jul 25, 2009 at 05:48, Shawn H. Corey wrote: > Umar Draz wrote: >> >> As you can see its not works because there is no space after the word is >> So would you please help me how to solve this. >> > > Change the word boundary, \b, to a not-digit, \D. snip

Re: Please Help Me!

2009-07-25 Thread Shawn H. Corey
Umar Draz wrote: As you can see its not works because there is no space after the word is So would you please help me how to solve this. Change the word boundary, \b, to a not-digit, \D. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and

Re: Please Help me

2009-07-24 Thread Steve Bertrand
Mobile No. is " . $1 . "\n";       > } > As you can see its not works because there is no space after the word is > So would you please help me what kind of change is required in above > regular expression. #!/usr/bin/perl use warnings; use strict; my $str = "&quo

Please Help Me!

2009-07-24 Thread Umar Draz
  } Here is the output of while Your Mobile No. is 0300-4459899 Your Mobile No. is 0356-4094030 Your Mobile No. is 03226789871 its Work almost fine but one mobile no. is missed and that is  My Office Cell is0300-5009228 As you can see its not works because there is no space after the word i

Please Help me

2009-07-24 Thread Umar Draz
re is the output of while Your Mobile No. is 0300-4459899Your Mobile No. is 0356-4094030Your Mobile No. is 03226789871 its Work fine but one mobile no. is missed and that is  My Office Cell is0300-5009228 As you can see its not works because there is no space after the word is So would you please

HTML::Template, CGI::APP with the JSON + Jquery please help.

2009-06-26 Thread Scott
I cant seem to get this to work. I am trying to emulate this script http://www.shawngo.com/gafyd/index.html , checks the username with a database to see if its available. I have tried the JSON + Jquery but i cant seem to get it to send the current value of the text field. Here is what my HTM

Re: Please help me w/ my sub

2008-10-14 Thread Richard Lee
Chas. Owens wrote: On Tue, Oct 14, 2008 at 02:15, Richard Lee <[EMAIL PROTECTED]> wrote: below sub works fine except the line where key is default. Instead of printing out PCMU only once, it's printing it out 40 times randomly.. Trying to figure out what I did wrong. snip I found your

Re: Please help me w/ my sub

2008-10-14 Thread Richard Lee
Chas. Owens wrote: On Tue, Oct 14, 2008 at 02:15, Richard Lee <[EMAIL PROTECTED]> wrote: below sub works fine except the line where key is default. Instead of printing out PCMU only once, it's printing it out 40 times randomly.. Trying to figure out what I did wrong. snip I found your

Re: Please help me w/ my sub

2008-10-14 Thread Chas. Owens
On Tue, Oct 14, 2008 at 02:15, Richard Lee <[EMAIL PROTECTED]> wrote: > below sub works fine except the line where key is default. > Instead of printing out PCMU only once, it's printing it out 40 times > randomly.. > Trying to figure out what I did wrong. snip I found your code to be very odd. Y

Re: Please help me w/ my sub

2008-10-14 Thread Richard Lee
John, I think this is now fixed. Still looking to make sure its covering all basis.. sub codec_list { #my @codec_d = qw/0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # 28 29 30 31 32 33 34 35--71 72--76 77--95 96--127/; my @codec_d = qw

Re: Please help me w/ my sub

2008-10-14 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: below sub works fine except the line where key is default. Instead of printing out PCMU only once, it's printing it out 40 times randomly.. Trying to figure out what I did wrong. Please leave me a feedback. thank you. 156 time(s) Codec(s) : unassign

Re: Please help me w/ my sub

2008-10-14 Thread John W. Krahn
Richard Lee wrote: below sub works fine except the line where key is default. Instead of printing out PCMU only once, it's printing it out 40 times randomly.. Trying to figure out what I did wrong. Please leave me a feedback. thank you. 156 time(s) Codec(s) : unassigned_38 185 time(s) Cod

Please help me w/ my sub

2008-10-13 Thread Richard Lee
below sub works fine except the line where key is default. Instead of printing out PCMU only once, it's printing it out 40 times randomly.. Trying to figure out what I did wrong. Please leave me a feedback. thank you. 156 time(s) Codec(s) : unassigned_38 185 time(s) Codec(s) : G729

Re: what is wrong w/ this program? (getting undefined value.. but I don't understand) please help

2008-07-15 Thread Richard Lee
John W. Krahn wrote: Or you could do it like this: #!/usr/bin/perl use warnings; use strict; use diagnostics; print '---', join( ':', getpwnam 'root' ), "---\n", join( ':', getpwnam 'ellie' ), "\n"; __END__ John Thank you for through explanation John as always!! -- To unsubscribe, e-ma

Re: what is wrong w/ this program? (getting undefined value.. but I don't understand) please help

2008-07-15 Thread John W. Krahn
Richard Lee wrote: what is wrong w/ below program??? use warnings; use strict; use diagnostics; #open 'PASSWD', '<', '/etc/passwd' or die "cannot open: $!\n"; open (PASSWD1, "/etc/passwd") or die "cannot open: $!\n"; my $line; while ( chomp($line = ) ) { The problem is that you are using

Re: what is wrong w/ this program? (getting undefined value.. but I don't understand) please help

2008-07-15 Thread Richard Lee
Richard Lee wrote: what is wrong w/ below program??? use warnings; use strict; use diagnostics; #open 'PASSWD', '<', '/etc/passwd' or die "cannot open: $!\n"; open (PASSWD1, "/etc/passwd") or die "cannot open: $!\n"; my $line; while ( chomp($line = ) ) { print "---$line---\n" if $line

what is wrong w/ this program? (getting undefined value.. but I don't understand) please help

2008-07-15 Thread Richard Lee
what is wrong w/ below program??? use warnings; use strict; use diagnostics; #open 'PASSWD', '<', '/etc/passwd' or die "cannot open: $!\n"; open (PASSWD1, "/etc/passwd") or die "cannot open: $!\n"; my $line; while ( chomp($line = ) ) { print "---$line---\n" if $line =~ /root/; } seek(

Re: want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-13 Thread Rob Dixon
Richard Lee wrote: > > Rob Dixon wrote: >> >> while () { >> my ($file1,$file2,$file3,$file4,$file5,$file6,$file10,$f`ile25,$file27) = >> map $_||'default', (split /\|/)[3,4,6,7,12,40,41,42,43,46,56,64]; >> } > > Thank you everyone. > > I like this solution the best and thanks for poi

Re: want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-13 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: while () { my($file1,$file2,$file3,$file4,$file5,$file6,$file10,$file25,$file27) = (split( /\|/, $_))[3,4,6,7,12,40,41,42,43,46,56,64] } while doing above, what is the easiest way to make sure all the variable that's being given a value is t

Re: want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-13 Thread John W. Krahn
Jenda Krynicky wrote: From: Richard Lee <[EMAIL PROTECTED]> I was doing (after the while loop) $file |= 'default' $file2 |= 'default2' $file3 |= 'default3' but I stopped and thought this cannot be so repetitious so I didn't want to but tried( I didn't want to put them in array since I need

Re: want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-13 Thread Rob Dixon
Richard Lee wrote: > > while () { > my($file1,$file2,$file3,$file4,$file5,$file6,$file10,$file25,$file27) > = (split( /\|/, $_))[3,4,6,7,12,40,41,42,43,46,56,64] > } > > while doing above, what is the easiest way to make sure all the variable > that's being given a value is true an

Re: want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-12 Thread Jenda Krynicky
From: Richard Lee <[EMAIL PROTECTED]> > while () { > my($file1,$file2,$file3,$file4,$file5,$file6,$file10,$file25,$file27) > = (split( /\|/, $_))[3,4,6,7,12,40,41,42,43,46,56,64] > } > > while doing above, what is the easiest way to make sure all the variable > that's being given a

want to assign default value to variable I assign from split but want to know optimal way to get this done: please help!

2008-05-12 Thread Richard Lee
while () { my($file1,$file2,$file3,$file4,$file5,$file6,$file10,$file25,$file27) = (split( /\|/, $_))[3,4,6,7,12,40,41,42,43,46,56,64] } while doing above, what is the easiest way to make sure all the variable that's being given a value is true and if not assign something default

Re: Please help critcize and shorten my sub code

2008-05-11 Thread Rob Dixon
Jenda Krynicky wrote: > > Only the loops that need to be labeled should be labeled. I agree. Apart from your spelling of 'labelled' :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Please help critcize and shorten my sub code

2008-05-11 Thread Jenda Krynicky
From: Peter Scott <[EMAIL PROTECTED]> > On Sun, 11 May 2008 02:05:06 +0200, Jenda Krynicky wrote: > > You do not need the label unless you need to jump out of some other > > loop than the innermost. In this case there are no nested loops so it > > would probably be better to skip the label. > >

Re: Please help critcize and shorten my sub code

2008-05-11 Thread Peter Scott
On Sun, 11 May 2008 02:05:06 +0200, Jenda Krynicky wrote: > You do not need the label unless you need to jump out of some other > loop than the innermost. In this case there are no nested loops so it > would probably be better to skip the label. While I personally program the way you suggest, ta

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
Jenda Krynicky wrote: From: Richard Lee <[EMAIL PROTECTED]> Jenda Krynicky wrote: You may do something like this: for my $wanted ( [outsideroute_group_m => route_name => \$routename, route_group_id => \$routegroupid], [outsideroute_trunk_m => route_group_id => \$routeg

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Jenda Krynicky
From: Richard Lee <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > You may do something like this: > > > > for my $wanted ( > > [outsideroute_group_m => route_name => \$routename, > > route_group_id => \$routegroupid], > > [outsideroute_trunk_m => route_group_id => \$routegroupid,

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
Jenda Krynicky wrote: From: Richard Lee <[EMAIL PROTECTED]> I dont know how to go through the array over and over again pending on my previous search so I ended up writing it like below which works.. but looks really really inefficient.. sub dd_fact { my $routename

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Jenda Krynicky
From: Richard Lee <[EMAIL PROTECTED]> > I dont know how to go through the array over and over again pending on > my previous search so I ended up writing it like below which works.. but > looks really really > inefficient.. > > > sub dd_fact { > my $routename = shift; >

Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
I dont know how to go through the array over and over again pending on my previous search so I ended up writing it like below which works.. but looks really really inefficient.. sub dd_fact { my $routename = shift; my $routegroupid; my $trunkgroupid; my $carriername; my $ca

Re: Trying to figure the Regex Please Help

2007-10-24 Thread Chas. Owens
On 10/24/07, Andrew Curry <[EMAIL PROTECTED]> wrote: > ^([a-zA-Z0-9_\-\.]+ # any character repeated from the set memorized into $1 > )@ # followed by an @ > ([a-zA-Z0-9_\-\.]+) # any character repeated from the set memorized into $2 > \.([a-zA-Z]{2,5})$ # any alphabetic character in both cases 2 -

Re: Trying to figureout regex please help

2007-10-24 Thread Dr.Ruud
Andrew Curry schreef: > Or If you want to be really silly > http://ex-parrot.com/~pdw/Mail-RFC822-Address.html What is silly about that? It is not complete though. See also: http://search.cpan.org/~abigail/RFC_RFC822_Address/Address.pm http://search.cpan.org/~rjbs/Email-Valid/lib/Email/Valid.p

Re: Trying to figureout regex please help

2007-10-24 Thread yaron
lt;[EMAIL PROTECTED]>, "Omega -1911" <[EMAIL PROTECTED]>, "beginners perl" Sent: Wednesday, October 24, 2007 10:13:52 AM (GMT+0200) Asia/Jerusalem Subject: RE: Trying to figureout regex please help Or If you want to be really silly http://ex-parrot.com/~pdw/Mail-RFC82

RE: Trying to figureout regex please help

2007-10-24 Thread Andrew Curry
Or If you want to be really silly http://ex-parrot.com/~pdw/Mail-RFC822-Address.html -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: 24 October 2007 09:13 To: Omega -1911; beginners perl Subject: RE: Trying to figureout regex please help A better one for email

RE: Trying to figureout regex please help

2007-10-24 Thread Andrew Curry
A better one for email may be [EMAIL PROTECTED] \.]*[a-zA-Z]$ -Original Message- From: Omega -1911 [mailto:[EMAIL PROTECTED] Sent: 24 October 2007 08:48 To: beginners perl Subject: Re: Trying to figureout regex please help 1. ^([a-zA-Z0-9_\-\.]+)@ Can contain a group of letters (case

Re: Trying to figureout regex please help

2007-10-24 Thread Omega -1911
1. ^([a-zA-Z0-9_\-\.]+)@ Can contain a group of letters (case insensitive) or numbers (0-9), a period, underscore, hyphen and the @ sign is required. 2. ([a-zA-Z0-9_\-\.]+)\. Can contain a group of letters (case insensitive) or numbers (0-9), a period, hyphen, underscore and end with a period. 3.

Trying to figureout regex please help

2007-10-24 Thread newBee
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Trying to figure the Regex Please Help

2007-10-24 Thread Andrew Curry
address -Original Message- From: newBee [mailto:[EMAIL PROTECTED] Sent: 24 October 2007 01:07 To: beginners@perl.org Subject: Trying to figure the Regex Please Help ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Trying to figure the Regex Please Help

2007-10-24 Thread newBee
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: pattren maching and mail sending please help !

2007-10-23 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: I need a script which will read and send mail each time a message with the word IDS is generated under /var/log/messages. this is the script, which I know have lots of errors: #!/usr/local/bin/perl # # Program to check /var/log/messeges for alerts contining the word I

pattren maching and mail sending please help !

2007-10-23 Thread [EMAIL PROTECTED]
kage name at ./logcheck line 20. Global symbol "$mailer" requires explicit package name at ./logcheck line 20. syntax error at ./logcheck line 22, near "$message" Global symbol "$message" requires explicit package name at ./logcheck line 22. Execution of ./logcheck aborted due to compilation errors. can someone please help me a bit? I dont know how to fix all of this !! thanks a lot !! Juan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Please help with this code

2007-06-11 Thread Mr Ryerson
tegory=$form{'category '}&item=$file \" >$grabberpic $mytitle$my_verifiedmember_html"; print "$#bids$config{'currencytype'}$bid$timerem ai n\n"; } } What I need is a peice of code I can place on a particular page where there is nothing and if they are not verified a peice of text I can add that says this seller is not verified please help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Please help with convoluted script

2007-02-12 Thread Ken Foskey
On Sun, 2007-02-04 at 07:27 -0800, Tom Phoenix wrote: > On 2/3/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: > > > my @date = (localtime)[3..5]; > > my $day = sprintf '%02d', $date[0] - 1; > > my $month= sprintf '%02d', $date[1] + 1; > > You shouldn't have to do arithmetic on the date

Re: Please help with convoluted script

2007-02-11 Thread Dr.Ruud
Mathew Snyder schreef: > I need to make sure $day and $month are in 2-digit format Don't mix value and presentation. Variant-1: perl -wle' my $i = 0; my ($day, $month, $year) = map $_ + (0, 1, 1900)[$i++], (localtime)[3..5]; printf qq/%04d %02d %02d\n/, $year, $month, $day; '

Re: Please help with convoluted script

2007-02-11 Thread Mathew Snyder
Rob Dixon wrote: > Mathew Snyder wrote: >> Tom Phoenix wrote: >>> On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote: >>> I'm running this as a cron job 1 minute after midnight on Saturday nights (Sunday morning) so as to cover all of Saturday back through the previous Sunday. Does your su

Re: Please help with convoluted script

2007-02-11 Thread Owen
On Sun, 11 Feb 2007 03:51:17 -0500 Mathew Snyder <[EMAIL PROTECTED]> wrote: > Jeff Pang wrote: > >> #!/usr/bin/perl > >> > >> use warnings; > >> use strict; > >> > >> my @date = (localtime (time - (24*60*60)))[3..5]; > >> > >> foreach my $i (@date) { > >>print $i . "\n"; > >> } > >> >

  1   2   3   4   >