Re: extracting numbers from a string

2003-03-22 Thread beau
On 21 Mar 2003 at 20:32, Matthew Stapleton wrote: > Hello, > > I am learning Perl and having some fun with it. In a script I am writing > I am wanting to read a line of a file and then extract a digit from the > beginning of the line. A typical line looks something like this: > > 100. text tex

Re: calculating length of a number

2003-03-22 Thread Steve Grazzini
Gufranul Haque <[EMAIL PROTECTED]> wrote: > > I am trying to split the each number into an array of charcters > and then calculating the length of the array > > my @digits = split(/\S/, @number[$i]) ^ > my @length = @digits ^ these should both be '$' > > but som

Re: extracting numbers from a string

2003-03-22 Thread Steve Grazzini
Matthew Stapleton <[EMAIL PROTECTED]> wrote: > [...] I am wanting to read a line of a file and then > extract a digit from the beginning of the line. A > typical line looks something like this: > > 100. text text text > > So I am using a file handle to open the file and read > the lines on by

Re: networking with perl

2003-03-22 Thread Soumyadeep nandi
Hi Wiggins, I wrote a simple script that is sending a request to localhost and receiving the response with LWP. As I am trying to run the script it is ending up with the error " 403 Forbidden ". I am sending the script along with this mail bellow. I've checked the file permission of file3.cgi and

RE: extracting numbers from a string

2003-03-22 Thread yargo
do you mean that you want the 100 in a variable? If so, here is one way: while { # Splitting the line by white spaces. my $Number = (split /\s+/, $_)[0]; # Deleting the dot at the end. $Number =~ [EMAIL PROTECTED]@@; print "$Number\n"; } HTH, Yargo. -

Re: PERL OSX --- reading a local text file

2003-03-22 Thread Scott R. Godin
Rob Dixon wrote: > Scott R. Godin wrote: >> John W. Krahn wrote: >> > >> > Yes, there is. :-) >> > >> > my %hash = do { local $/; =~ /[^\n,]+/g }; >> >> Holy Handgrenades, Batman! >> >> but where's the implicit split of key and value there? forgive me for >> asking, but I just don't see it. is t

Re: How can I check the size of a file

2003-03-22 Thread Scott R. Godin
Rob Dixon wrote: > Giarrocco, Camillo wrote: >> Hi, >> >> Can anybody tell me how can I check the size of a file? >> >> I know the "if (-s "file") function but never used and don't know the >> right syntax of it. > > Well it's just that really. But you can do more than just test it for > being n

Re: PERL OSX --- reading a local text file

2003-03-22 Thread Scott R. Godin
Randal L. Schwartz wrote: >> "Scott" == Scott R Godin <[EMAIL PROTECTED]> writes: > >>> my %hash = map {/\w+/g} >>> >>> :-) > > Scott> grin away. This shortcut deserves to be in the perldocs > Scott> somewhere. I wish I'd seen this before. > > The problem is that it is very intolerant of

Re: Linux Environment Variable

2003-03-22 Thread Scott R. Godin
Ankit Gupta wrote: > Hi, > > I want to print some linux environment variables that have already been > set. Could some one let me know which command I can use to get value of > environment variables. > > Regards, > Ankit perl -le 'print "$_ -> $ENV{$_}" for sort keys %ENV' -- To unsubscribe

Re: Sending attachements with perl through SMTP AUTH.

2003-03-22 Thread Jenda Krynicky
From: "Thomas Williams" <[EMAIL PROTECTED]> > Thank you all for your help, but it's my fault for forgetting a major > piece of information. > > Not only do I need to send a email with an attachment, through perl, > but it needs to be through a smtp server that required the username > and password

Re: Is there something like cscope for large Perl applications ?

2003-03-22 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Vinay T.S.) writes: >Hello, > >would like to know if there is a utility to build up a function dependancy >database, while handling large Perl applications just like cscope does for >C programs . Devel::Dprof (comes with Perl). Look for the -T o

Socket Problem

2003-03-22 Thread Stefan Johnson
Hi, I've googled for this information and not found much. Probably just haven't found the right combination of keywords. I have a project I'm doing to learn about IRC better. I'm writing a bot in perl (without using the Net::IRC or POE modules) and I can connect to the server, join the channel I

Using Print -strange behavior

2003-03-22 Thread Jose Luis Martinez
Hello All I installed Linux 8.0(kernel 2.4.18-14) and Perl V5.8.0 and when I try to run a Perl program with the line print "Hello World" it does not work, just perl executed it without an error. I checked it the script using perl -c script_name and it return OK Thanks -- To unsubscribe, e-

Re: Using Print -strange behavior

2003-03-22 Thread Ovid
--- Jose Luis Martinez <[EMAIL PROTECTED]> wrote: > Hello All > > I installed Linux 8.0(kernel 2.4.18-14) and Perl V5.8.0 and when I try to > run a Perl program with the line > print "Hello World" > it does not work, just perl executed it without an error. > > I checked it the script using > per

Creating Microsoft Access Database files

2003-03-22 Thread dan
Hi, Is there a way (or a module) which enables the creation of MS access files? Or, is tehre something that will convert an SQL database & all subtables into an MS access file for viewing? Thanks in advance. Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Re: Creating Microsoft Access Database files

2003-03-22 Thread R. Joseph Newton
dan wrote: > Hi, > > Is there a way (or a module) which enables the creation of MS access files? > Or, is tehre something that will convert an SQL database & all subtables > into an MS access file for viewing? > > Thanks in advance. > > Dan If you need Access for viewing, why not just import into

Re: Socket Problem

2003-03-22 Thread Randal L. Schwartz
> "Stefan" == Stefan Johnson <[EMAIL PROTECTED]> writes: Stefan> I've googled for this information and not found much. Stefan> Probably just haven't found the right combination of Stefan> keywords. I have a project I'm doing to learn about Stefan> IRC better. I'm writing a bot in perl (witho

Random wierdness with large outputs

2003-03-22 Thread R. Joseph Newton
Hi, I'm wondering if there is an issue with the random function in terms of scaling. I have been testing a merge sort, and I noticed that when my test, built by pushing rand(10) a given number of times into it, starts getting much higher than 10,000 items, the rnadom numbers start clumpin