Help Required : Coding Standards

2002-03-26 Thread rajnish_aggarwal
Hi, Just need to know any good docs/web links for Coding Standards In PERL. Any pointers are welcome. Thanks, -Rajnish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: .csv file to .tab file?

2002-03-26 Thread Bud Rogers
Brian Volk wrote: > Is there a way to covert a .csv file to .tab file? I would do something like this. while (<>) { @fields = split(/,/, $_); $line = join("\t", @fields); print $line; } You could do all that on one line, but I prefer readability. -- Bud Rogers <[

Re: Perl Debug Question

2002-03-26 Thread Peter Scott
At 03:47 PM 3/26/02 -0500, Nikola Janceski wrote: >2 questions actually. > >1. Is there a way to make the debugger display the next N lines of code at >each prompt (instead of just one). You would probably prefer to just hit 'w' or 'l' whenever you want to see more than one line. But... you can

RE: .csv file to .tab file?

2002-03-26 Thread Timothy Johnson
I think the tab is \t. So try s/,/\t/g ? -Original Message- From: Brian Volk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 5:21 PM To: [EMAIL PROTECTED] Subject: .csv file to .tab file? Hi All, Is there a way to covert a .csv file to .tab file? I checked out the module

.csv file to .tab file?

2002-03-26 Thread Brian Volk
Hi All, Is there a way to covert a .csv file to .tab file? I checked out the module Text::CSV_XS but I didn't see too much that made sence to me... :-) I also looked into substitution, something like while<) { if(s/ , / tab or maybe 0x09 (tab)/ ) { # not sure how tab should be expressed?

Re: Large hash keys & hash performance

2002-03-26 Thread Jenda Krynicky
From: Mr Hash <[EMAIL PROTECTED]> > On 03/26, Jenda Krynicky said something like: > > From: "Jonathan E. Paton" <[EMAIL PROTECTED]> > > > > affect the performance of: > > > > key listings (things like grep /pattern/, keys %hash) > > > > > > Grep can be slow, especially with patterns

Re: Large hash keys & hash performance

2002-03-26 Thread Mr Hash
On 03/26, Jenda Krynicky said something like: > From: "Jonathan E. Paton" <[EMAIL PROTECTED]> > > > affect the performance of: > > > key listings (things like grep /pattern/, keys %hash) > > > > Grep can be slow, especially with patterns. Keys > > could be slow, especially if the d

simple grep/regexp question

2002-03-26 Thread Brian Warn
This is actually a straight-unix grep question. I want to look for values greater than one in a particular result. What is the recommended, etc. way to do this? -Brian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: delete blank lines from a file?

2002-03-26 Thread Brian Volk
Timothy, Thank you very much for the quick reply! It works great :-) Brian Timothy Johnson wrote: >Try this: > >open(INFILE,"myfile.txt"); >open(OUTFILE,"SSlines.txt"); >while(){ > unless($_ eq "\n"){ #blank lines probably have only a \n > print OUTFILE $_; > } >} > >-Orig

Re: MIME::Lite - - "No data in this part"?

2002-03-26 Thread Jenda Krynicky
From: "KEVIN ZEMBOWER" <[EMAIL PROTECTED]> > I hope it's okay to ask a question here regarding MIME::Lite. This is > a fairly well-used module, that even beginners might run up against. > Additionally, I suspect my problem doesn't have to do so much with > MIME::Lite, as it does

Re: Large hash keys & hash performance

2002-03-26 Thread Jenda Krynicky
From: "Jonathan E. Paton" <[EMAIL PROTECTED]> > > affect the performance of: > > key listings (things like grep /pattern/, keys %hash) > > Grep can be slow, especially with patterns. Keys > could be slow, especially if the dataset is large. Maybe you could try to use whil

Re: Large hash keys & hash performance

2002-03-26 Thread Jonathan E. Paton
> How do the following attribute of a hash key: > size (something like an alphanumeric > string about 70 chars wide) Longer strings take longer to hash, but 70 characters isn't massive. Hashing a string takes time proportional to the length of the string. > similarity (groups of abo

Re: Default Input Record Separator

2002-03-26 Thread Alfred Vahau
Hi, Period (.) is a metacharacter so will not work. Needs to be escaped. Like so: $/=~/\./; It would have been set elsewhere before testing. Having you looked up Splitting the String (Digest No. 752). There you'll find the following from one of the contributors $a = 'abcdef'; @arr = split (//,

Re: How to thread in Perl?

2002-03-26 Thread Chas Owens
I wrote some experimental code and it looks like you don't have to reap the children (maybe this is just a C thing). On Tue, 2002-03-26 at 15:56, Ahmed Moustafa wrote: > Chas, thanks a lot for your example. > > if the while loop is inside a main infinite loop (as if it was a > daemon), do I sti

MIME::Lite - - "No data in this part"?

2002-03-26 Thread KEVIN ZEMBOWER
I hope it's okay to ask a question here regarding MIME::Lite. This is a fairly well-used module, that even beginners might run up against. Additionally, I suspect my problem doesn't have to do so much with MIME::Lite, as it does with more general topics. I'm writing a CGI program to take input fr

RE: delete blank lines from a file?

2002-03-26 Thread Timothy Johnson
Try this: open(INFILE,"myfile.txt"); open(OUTFILE,"SSlines.txt"); while(){ unless($_ eq "\n"){ #blank lines probably have only a \n print OUTFILE $_; } } -Original Message- From: Brian Volk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 1:48 PM To: [EMAIL PROTECTE

delete blank lines from a file?

2002-03-26 Thread Brian Volk
Hi All, I'm new to perl, so this may seem really basic, so any hints or directions to help files would be greatly appreciated. :-) I written a script that fetches a file from my web server (LWP::Simple and Net::FTP::Common both work) and loads it into mysql. (DBI) That part works great!

Large hash keys & hash performance (sorry if duplicated)

2002-03-26 Thread Mr Hash
Right now my program is stomping my CPU... How do the following attribute of a hash key: size (something like an alphanumeric string about 70 chars wide) similarity (groups of about 30% of the keys are similar for the 1st n-10 characters affect the performance of: key listings (things l

RE: Regex sub moron problem

2002-03-26 Thread Nikola Janceski
err.. wrong.. I found it.. I am a moron. local $/ = ""; is wrong. should be: local $/; Thanx though... Don't mean to post but it stumped me for about a half hour (too long for me). > -Original Message- > From: David Gray [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 4:25 PM

RE: Regex sub moron problem

2002-03-26 Thread David Gray
> I have a file with some settings, and I want to change some > of them. But when I write the file, I lose everything after a > certain point. > > Can someone point out my moronic mistake? > Everything after "ROOT =" is lost but it changes "ROOT =" to > the correct value. > > # perl here >

Large hash keys & hash performance

2002-03-26 Thread Shawn
Right now my program is stomping my CPU... How do the following attribute of a hash key: size (something like an alphanumeric string about 70 chars wide) similarity (groups of about 30% of the keys are similar for the 1st n-10 characters affect the performance of: key listings (things l

Regex sub moron problem

2002-03-26 Thread Nikola Janceski
I have a file with some settings, and I want to change some of them. But when I write the file, I lose everything after a certain point. Can someone point out my moronic mistake? Everything after "ROOT =" is lost but it changes "ROOT =" to the correct value. # perl here $out = "";

Re: Perlcc -B

2002-03-26 Thread Paul Johnson
On Tue, Mar 26, 2002 at 02:20:50AM -, John Bennett wrote: > Hi All > > I have been looking into perlcc for a little while as I would like to > compile a program to make the source unreadable, and haven't had much > luck as it was compiling files of about 20MB which makes it a little > harder

Re: How to thread in Perl?

2002-03-26 Thread Ahmed Moustafa
Chas, thanks a lot for your example. if the while loop is inside a main infinite loop (as if it was a daemon), do I still need to have the waitpid function? and if yes, where should be located? Once again, thanks a lot! Chas Owens wrote: > On Tue, 2002-03-26 at 01:14, Ahmed Moustafa wrote: >

Perl Debug Question

2002-03-26 Thread Nikola Janceski
2 questions actually. 1. Is there a way to make the debugger display the next N lines of code at each prompt (instead of just one). 2. What is the best way to avoid the loops on one line? I use c but I was hoping for a simpler solution. (ie. foreach my $line (map { stuff } @array){ ) Thanx Ni

newbie question about subroutines

2002-03-26 Thread Richard Wood
I have this script that checks processes on aix box. My question is within the subroutine. If the process is not running the return code is 256. How do prevent it from sending multiple alerts to a pager? What I want it do is send 1 page at a time for multiple events. Piece of my script: $tel

Re: How to thread in Perl?

2002-03-26 Thread Chas Owens
To my knowledge the only limit is what your OS can handle. On Tue, 2002-03-26 at 14:53, perl wrote: > Is there a limit to the number of children in Perl? > > > "Ahmed Moustafa" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Tagore Smith wrote: > > > > >

Re: How to thread in Perl?

2002-03-26 Thread perl
Is there a limit to the number of children in Perl? "Ahmed Moustafa" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Tagore Smith wrote: > > > Ahmed Moustafa wrote: > > > > > >>So, how can a new different process by forked? Or, how a function be > >>called and

Maximum file descriptors on Solaris

2002-03-26 Thread perl
I know that under Solaris 2.6 that a process couldn't hold more than 256 file descriptors, but that restriction was lifted in Solaris 7 and Solaris 8. Using ulimit -n 1024 and the pfiles command, I can see that the process running this particular Perl script in question has a 1024 limit but the 2

RE:long path and short Path

2002-03-26 Thread Elias Assmann
On Tue, 26 Mar 2002, Jorge Goncalvez wrote: > Hi, I wonder if Perl under windows know short path like dos with tildes on it. > Thanks. Well, I'm not on a Windows PC, so I can't check, but I would think it should - AFAIK, all filenames in Windows (at least on the FAT fs - might be differnet on NTF

RE:long path and short Path

2002-03-26 Thread Jenda Krynicky
From: Jorge Goncalvez <[EMAIL PROTECTED]> > Hi, I wonder if Perl under windows know short path like dos with > tildes on it. Thanks. use Win32; print Win32::GetShortPathName( 'c:\program files'), "\n"; print Win32::GetLongPathName( 'c:\PROGRA~1'), "\n"; Jenda ==

RE:long path and short Path

2002-03-26 Thread Jorge Goncalvez
Hi, I wonder if Perl under windows know short path like dos with tildes on it. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Debug perl curses

2002-03-26 Thread Peter Scott
At 01:58 PM 3/26/02 -0300, Mauricio Amorim da Silva wrote: > Hi, > > My name is Mauricio. > I'm from Brazil. > > I send this email for you, because i search to an question in the > net, but didn't find. > > I'd like know if is possible debug an program in perl that uses > Curses

RE: question

2002-03-26 Thread Nikola Janceski
Your answer is probably what he needs... (I am thinking too hard). > -Original Message- > From: Wagner-David [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 12:23 PM > To: 'Brian Warn'; [EMAIL PROTECTED] > Subject: RE: question > > > If you enter only return and no inp

RE: question

2002-03-26 Thread Nikola Janceski
Yeah...what I do is while gathering the input. Look for 3 consecutive newlines. my $break; while(){ last if $break == 3; $break++, next if /^\n$/; ## do stuff to $_ here } > -Original Message- > From: Brian Warn [mailto:[EMAIL PROTECTED]] > Sen

RE: question

2002-03-26 Thread Wagner-David
If you enter only return and no input, then you could check on this: chomp(my $MyInput = ); last if ( $MyInput eq '' ); Obviously this won't work if blank lines are allowed, but if not then could try this way. Wags ;) -Original Message- From: Brian Warn

question

2002-03-26 Thread Brian Warn
Is there a way to have a script accept enter/return vs. ctrl+d to tell a program where I specify that input be obtained via that I'm done inputting data? -Brian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Debug perl curses

2002-03-26 Thread Mauricio Amorim da Silva
Hi, My name is Mauricio. I'm from Brazil. I send this email for you, because i search to an question in the net, but didn't find. I'd like know if is possible debug an program in perl that uses Curses, with perl -d. I did some tests, but the screen of debugger stay

Re: Help need fast

2002-03-26 Thread Brian Volk
Are you looking for a shell account to login to? Brian Jim Conner wrote: > At 14:43 03.26.2002 +1000, senrong wrote: > >> I am a student who is new to Perl.and that my assignment is due this >> following week... >> >> can anyone tell me where can I get a free server to run on my own >> P

RE: extraction of filenames in a string

2002-03-26 Thread David Gray
> > I have a string for example: > > > > "directory/subdirectory/subsubdirectory/filename.gz" > > > > How do I extract the filename.gz part for testing, > > the number of subdirectories is not fixed? > > use File::Basename; > > my $file = "directory/subdirectory/filename.gz"; > print basename($

RE: remove part of a string - unterminated tags

2002-03-26 Thread David Gray
> I understand that by using: > > $s=~s/<[^>]*(?!.*?>)// > > the negative character class ( [^>]* ) seems redundant... > > But, strange, If I remove it (then we go to the one I wrote > on my first > message): > > $s=~s/<(?!.*?>)// > > it only removes the last orphan "<" character without

Re: extraction of filenames in a string

2002-03-26 Thread Jonathan E. Paton
> I have a string for example: > > "directory/subdirectory/subsubdirectory/filename.gz" > > How do I extract the filename.gz part for testing, > the number of subdirectories is not fixed? use File::Basename; my $file = "directory/subdirectory/filename.gz"; print basename($file); Jonathan Paton

extraction of filenames in a string

2002-03-26 Thread stephen . redding
Hi i have a string for example "directory/subdirectory/subsubdirectory/filename.gz" how do i extract the filename.gz part for testing, the number of subdirectories is not fixed? Stephen Redding BT Ignite Solutions Telephone - 0113 237 3393 Fax - 0113 244 1413 Email - [EMAIL PROTECTED] British

Re: How to thread in Perl?

2002-03-26 Thread Chas Owens
On Tue, 2002-03-26 at 01:14, Ahmed Moustafa wrote: > Jim Conner wrote: > > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote: > > > >>> Jim Conner wrote: > >>> > I suck at this kind of topic but the only way I can think of doing > such a thing is this: > > Use IPC. > > >>>

Re: reg exp help!

2002-03-26 Thread Jenda Krynicky
From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]> > i got this line in an array allready, if i do a print off the array it > prints this line. > > Last accessed 08-mar-02.10:27:55 by fdefgre.Domain > [EMAIL PROTECTED] > > what i want to do now is only pick out the date that is the > "08-mar-0

RE: Batch creation of thumbnails

2002-03-26 Thread John Edwards
Try the GD module. Here is some code I have for creating thumbnails (untested as it's stripped down from a bigger script). Thumbnails have a _ prepended to them. They're not great thumbs, there is no anti aliasing done on them. For better image handling you'll need to look at the ImageMajick (sp??

SV: reg exp help!

2002-03-26 Thread Larsson Mikael (MLAH)
Hi, This should work. $_ = $your_string_array; $_ =~ /accessed (.*?)\./; $date = $1; print $date; Regards, Mikael Larsson -Ursprungligt meddelande- Från: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]] Skickat: den 26 mars 2002 11:53 Till: '[EMAIL PROTECTED]' Ämne: reg exp help! i

reg exp help!

2002-03-26 Thread David Samuelsson (PAC)
i got this line in an array allready, if i do a print off the array it prints this line. Last accessed 08-mar-02.10:27:55 by fdefgre.Domain [EMAIL PROTECTED] what i want to do now is only pick out the date that is the "08-mar-02" As it says in the manuals, one of the best with things with per

Batch creation of thumbnails

2002-03-26 Thread Gary Stainburn
Hi all, I need to be able to create thumbnails for a group of .jpg files overnight, and I was wondering if there were any perl modules that anyone could suggest for this one? I'm going to take a stroll over to CPAN, but I believe personal experiences always help. -- Gary Stainburn This em

RE: remove part of a string - unterminated tags

2002-03-26 Thread Gfoo
[EMAIL PROTECTED] (David Gray) wrote in 01c1d435$f2306e60$[EMAIL PROTECTED]:">news:01c1d435$f2306e60$[EMAIL PROTECTED]: >> >> I have strings like the following one: >> >> my $s="The Library of > >> >> >> I want to truncate the string, to become >> >> "The Library of ..." >> >> (that is

Re: How to eliminate ctrl character in a file ?

2002-03-26 Thread Franck FASANO
Thanks for your help. In fact, the files I work with are binary file which contains alphanumériques characters which I want to recuperate . The adequate solution to keep only the text editable is : perl -pi -e 's/[^[:graph:]\n\s]//g' Myfile Have a good day. Franck. -- To unsubscribe, e-mai

Re: How to thread in Perl?

2002-03-26 Thread Jim Conner
At 22:14 03.25.2002 -0800, Ahmed Moustafa wrote: >Content-Type: text/plain; charset=us-ascii; format=flowed >Content-Transfer-Encoding: 7bit >X-Posted-By: 209.178.174.150 > >Jim Conner wrote: > > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote: > > > >>> Jim Conner wrote: > >>> > I suck at th

RE: Help need fast

2002-03-26 Thread Michael Gargiullo
what type of server? are you looking for a web server? if so goto www.apache.org and download it. -Original Message- From: senrong [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 11:43 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Help need fast I am a student who is

Default Input Record Separator

2002-03-26 Thread Agustin Rivera
Is there anyway to change the Default Input Record Separator.. or $/ .. to allow me to read a character at a time? I tried $/=~ /./; but it doesn't work. Thanks, Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma