Re: File::Find question?

2005-03-29 Thread Steven Schubiger
print "$File::Find::name\n" if ( m/txt/ ); print $File::Find::name, "\n" unless /\.txt^/; -- Steven Schubiger <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Net::Printer

2005-03-29 Thread Steven Schubiger
ers. CUPS users will need to set up B to provide legacy access. ( See L ) -- Steven Schubiger <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Regex against a scalar

2005-03-28 Thread Steven Schubiger
On 28 Mar, Marcos Rebelo wrote: > I want another scalar, $regex to hold the output of a regular > expression lookup against $test. my ($match) = $regexp =~ /.*\s+(so.*?)\s+.*/; $match holds "some". Steven -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Create unexistent directories by FTP

2005-03-28 Thread Steven Schubiger
> On 28 Mar, marcos rebelo wrote: > I have a program that is supposed to send files throw FTP. And I'm > using the Net::FTP. I have a destiny path and I need to create the > directories if they don't exist. Locally or remotely? > How do I check if a Directory exist? -e $dir for local purpo

Re: When does a process become defunct

2005-03-28 Thread Steven Schubiger
On 28 Mar, Ramprasad A Padmanabhan wrote: > I am writing a daemon in perl , where the parent just forks on some > requests and the children take over. But I found many child processes > becoming defunct. > wait(); perldoc -f waitpid -- The trouble with having an open mind, of course, is that

Re: How can I get Inline::C to deal with big number?

2005-03-28 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: > What could be the problem? > Is there a way to solve it I assume, the typedef doesn't value the "hooked" malloc, thus, I recommend: long double *big_double; big_double = (long double *) malloc(2*sizeof(long double)); -- The trouble with having an open mind, of

Re: Arguments in a program

2005-03-26 Thread Steven Schubiger
On 26 Mar, Carlos Mantero wrote: > However, today I need a program that accepts many > arguments but I've tryied to make for myself but it's impossible. Global arguments usually reside in @ARGV; parsing @ARGV "manually" is unnecessary and awkward in most cases. Instead, you may consider using Ge

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: > Sorry my C is barely Novice. > Where can I put this snippet in my C subroutine? It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suffer. If you ever should get bored, read the Perl Sources. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> printf("%i\n", sizeof(long double)); > > It gives: > 12 Fine, it was even 2 Bytes bigger than excepted. typedef (malloc(2*sizeof(long double))) Big_Double; Big_Double var; var should measure 24 bytes in size, which should suffice; if not, increment the factor

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
> On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 Another solution would be, dynamically allocating memory: long double var; var = (long double *) malloc(2*sizeof(long double)

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 What does printf("%i\n", sizeof(long double)); tell you? The byte sizes of variable types can vary from platform to platform. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Change every occurence of the word "float" , in your script, >> to "double". > > It worked, but still limited. It overflowed when N>500. > Most of the value of N, I use are around 1000-2000. > > Any other possibility? Try "long double" instead, which gives you

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
> chomp($line); It's superfluous in this peculiar case, by the way. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
On 26 Mar, Brett Williams wrote: > What i would like is for the output to look like > > 1: 1002.00 > 2: 125.00 > 3: 61864.35 > 4: 890876.99 > 5: 9.99 > > but perl doesn't like my code. #! /usr/bin/perl use strict; use warnings; my $lnum = 1; while (my $line = ) { next unless $line =~ /\d+

Re: Another optionmenu callback problem

2005-03-25 Thread Steven Schubiger
On 25 Mar, BJ wrote: > The error I get is "Tk::Error: Can't set -options to > `ARRAY(0x2eee778)' for Tk::Optionmenu=HASH(0x2ef4e78) This implicates, that an array reference is not being dereferenced properly. > [EMAIL PROTECTED]; [EMAIL PROTECTED] is a reference to an array. Are you sure

Re: lwp beginner question

2005-03-22 Thread Steven Schubiger
On 22 Mar, "José J. Cintrón" wrote: > The script works fine as long as I'm not behind a proxy. As soon as I > get the script behind the proxy where it will reside it ends with a 500 > Exit code. Anyone can provide me any info on how to get the script > working behind a proxy? You may conside

Re: Needs some guidance to start

2005-03-22 Thread Steven Schubiger
On 22 Mar, Chandrakant Reddy wrote: > I wanted to develop an application using which an administrator Eww, could you please rephrase this sentence; frankly, I don't grasp the contextual meaning of "using" here. > can know what are the software installed on the machines on his LAN Something s

Re: Mail 2 sms module

2005-03-14 Thread Steven Schubiger
On 14 Mar, Ramprasad A Padmanabhan wrote: > Hi all, > > Is there any module that can help me convert text or html mail to text > that can be sms-ed > I looked at the email2sms utility, but that does not provide any > includable module and doesnt work well with text & html mails. > > Thanks > R

Re: reading an file

2005-03-08 Thread Steven Schubiger
> # trim right space away. I'm shure there is a shorter > # and more elegant solution > # > @parts= map { do {$_=~s/\s*$//; $_ } } @parts; Regular expressions have a tendency to be slower, than functions that achieve aquivalent results; but, chop() cannot be considered being used in above stateme

Re: reading an file

2005-03-08 Thread Steven Schubiger
On 8 Mar, E.Horn wrote: > Hello! > I want to read this file into an array. > How can i just get 4, 5, 6,7,8 into an array? > And later, how can i get the contents out of this array? > 1)2)3) 4) 5)6) > 7)8) 9)10)