Re: Regexp question

2001-06-25 Thread Me
> On Tue, 26 Jun 2001, Tim Wood wrote: > > > Drats - just when I got the regexp worked out too... > > $_=~ m/()/ > > Until you get to the one that is like > > > a bunch of stuff > And of course, when you fix that simple exception, the next slightly more complicated exception comes along.

Re: Regexp question

2001-06-25 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Tim Wood wrote: > Drats - just when I got the regexp worked out too... > $_=~ m/()/ Until you get to the one that is like a bunch of stuff Which is why the parser module is a good idea -- it can handle non-idiomatic cases like this. -- Brett

Re: Regexp question

2001-06-25 Thread Me
> Drats - just when I got the regexp worked out too... > $_=~ m/()/ Kudos for working out the regex that works given your assumptions. If the web pages you will be parsing are known to be constrained to the assumptions you've established, then you're done. But be aware that your regex will fail

Re: Regexp question

2001-06-25 Thread Tim Wood
Drats - just when I got the regexp worked out too... $_=~ m/()/ > > [matching web page links] > > [using regexes] > > Don't use regexes. They aren't the right tools for the task. > > Use one of the cpan modules for parsing web pages. > Some are written specifically for pulling out links. > > htt

Re: Regexp question

2001-06-25 Thread Me
> [matching web page links] > [using regexes] Don't use regexes. They aren't the right tools for the task. Use one of the cpan modules for parsing web pages. Some are written specifically for pulling out links. http://search.cpan.org/

Re: removing ASCII characters from array

2001-06-25 Thread Me
> s/.*?=//g;# remove leading junk should of course be > s/.*?=//;# remove leading junk Ok, ok, I accept another -10 points. :< ;>

Re: Large File Sort

2001-06-25 Thread Rajeev Rumale
Greetings ! I can't say if I got the problem write. Looking at the probem I feel that their are too many multiple entries in the File B. I think it would not difficult if we simple remove the duplicate lines from the File B first. If this reduces the file size to something around 1 to 20 MB, t

Re: removing ASCII characters from array

2001-06-25 Thread Me
> But that wasnt the question man =) > you print '230107312001,32,192,239' > > but the question was to just have: '32,192,239' > > -10 cookie points! ;-) Oops, being careless. You could throw away .*?= first: $_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; s/.*?=//g;#

Re: a problem

2001-06-25 Thread Xun_Dog
Send us some code Ying, Thanks... SunDog At 06:04 PM 6/25/01 +0800, you wrote: > >What shall I do when I get the foloowing message? >"Can't call method "getColumns" without a package or object reference at >getColumns.pl line 3" > >Best regards > >Peter Zhou

Regexp question

2001-06-25 Thread Tim Wood
Hi I'm new to perl and have a question about regexps that hopefully one of you can help with. I'm trying to parse out links from web pages, so essentially I have a string of the form: So what I want to do is find an expression to match against that. Secondly, if there is an easy way to put

Re: Conecting my web server to informix.

2001-06-25 Thread Bruce Ferrell
Chas Owens wrote: > > On 24 Jun 2001 08:24:53 -0700, Bruce Ferrell wrote: > > Joe, > > > > You'll need to install perl DBI and DBD Informix. Use the CPAN Client > > to download and install the as follows: > > > > perl -MCPAN -e chell > > I think you mean > > perl -MCPAN -e shell Insert red fa

Re: removing ASCII characters from array

2001-06-25 Thread Jos I. Boumans
But that wasnt the question man =) you print '230107312001,32,192,239' but the question was to just have: '32,192,239' and you're clobbering the original values which isnt always nice -10 cookie points! ;-) - Original Message - From: "Me" <[EMAIL PROTECTED]> To: "Jos Boumans" <[EMAIL P

Re: removing ASCII characters from array

2001-06-25 Thread Me
> > $data = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; > > > > @array = $data =~ /=(\d*)/g; > > > > print "$array[0], $array[1], $array[2]\n"; > and for esthetics: > > print join ',' @array; > > timtowtdi =) Or $_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239";

Re: My mis-understanding of if/else?

2001-06-25 Thread Tom Yarrish
Okay, just for clarification. The line from the log file was word wrapped. It does show on one line in the actual file. Second, the pattern I am trying to match is exactly how it is in the m// statement. So it is all caps, and it's those three words I'm trying to match. Also, I should have said

RE: Head and Tail

2001-06-25 Thread Paul
--- "Kipp, James" <[EMAIL PROTECTED]> wrote: > > scalar > > > > puts the filehandle access into a scalar context so that it will > > only return one record each time. =o) > > without slurping the whole file !! , great thanks No problem. =o) Context is something you really have to grasp in P

RE: Head and Tail

2001-06-25 Thread Kipp, James
> --- "Kipp, James" <[EMAIL PROTECTED]> wrote: > > Why 'scalar ' ?? > > If I may? =o) of couse :-) > >push @head, ; > > would put the filehandle access into a list context, and would try to > append the entire file to @head. ahhh..OK. > > scalar > > puts the filehandle access i

RE: Head and Tail

2001-06-25 Thread Paul
--- "Kipp, James" <[EMAIL PROTECTED]> wrote: > Why 'scalar ' ?? If I may? =o) > > open HEAD, "< $file" or die "can't read $file: $!"; This makes HEAD a filehandle to the file. push @head, ; would put the filehandle access into a list context, and would try to append the entire file to

RE: Is there a sendmail for windows-ME ?

2001-06-25 Thread Stephen Neu
I've used the Mail::Sendmail module, with good results on NT and Linux. Never tried it on ME, though. :-Original Message- :From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] :Sent: Saturday, June 09, 2001 9:45 PM :To: [EMAIL PROTECTED] :Subject: Is there a sendmail for windows-ME ? : : :I

RE: Head and Tail

2001-06-25 Thread Kipp, James
Japhy Thanks again. This worked fine and was a singnigicant performance increase from slurping the whole file into the array. One information question I have for you. Why 'scalar ' ?? It worked real well, I just want to know why ?? Thanks JIm > open HEAD, "< $file" or die "can't read $file: $!"

Is there a sendmail for windows-ME ?

2001-06-25 Thread a
Is there a program that emulates sendmail for use with perl running in windows? Or MIME:Lite for windows or How do i send an email with perl running under windows-ME ? Thanks

Re: Exceptions ( catching and handeling).

2001-06-25 Thread Me
> On Mon, Jun 25, 2001 at 12:12:19AM -0500, Me wrote: > > > $done="false"; > > > > > > while( $done eq "false ") { > > > eval { > > > .. > > > . > > > read form files. > > > process info... > > > write back to files > > > > > > }; > > >

Re: My mis-understanding of if/else?

2001-06-25 Thread Chas Owens
On 25 Jun 2001 14:13:22 -0500, Tom Yarrish wrote: > Hey all, > Okay, I'm still working on my little Net::Telnet project, but a different > section of the code is giving me a problem. I thought I had an > understanding of regex an if/else, but apparently not. > Here's the code snippet: > > > >

Re: My mis-understanding of if/else?

2001-06-25 Thread Jos I. Boumans
Ok, here are a few things you need to concider: you are matching in caps and literally that... if it's on multiple lines or if it's lower case or... anyway, try this: /SERVICE NOT AVAILABLE/i; #that will ignore case double check that that is REALLY what you want to match... try a print out or so

Re: Sort+print hashes of hashes

2001-06-25 Thread Michael Fowler
On Fri, Jun 22, 2001 at 05:25:13PM +0200, Remko Lems wrote: > for $File (reverse (sort {$All_Scores{$a}{Trimmed} cmp > $All_Scores{$b}{Trimmed}} keys %All_Scores)) { > InsertSortedEntries ($File, $All_Scores); > } [snip] > > > no > 11 > 10 > 01 > 00 > > > > That's not exact

Re: use strict

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Silvio Luis Leite Santana said: >Ok, japhy, thanks. > >So you're telling me Perl wouldn't allow >any spaces "inside" keywords? > >What about when $_ be evaluated? The spaces >of the line > >$CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ > >will still be there, won't they? S

Re: use strict

2001-06-25 Thread Peter Scott
At 04:12 PM 6/25/01 -0300, Silvio Luis Leite Santana wrote: >So you're telling me Perl wouldn't allow >any spaces "inside" keywords? > >What about when $_ be evaluated? The spaces >of the line > > $CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ > >will still be there, won't they? You k

My mis-understanding of if/else?

2001-06-25 Thread Tom Yarrish
Hey all, Okay, I'm still working on my little Net::Telnet project, but a different section of the code is giving me a problem. I thought I had an understanding of regex an if/else, but apparently not. Here's the code snippet: open(TAIL, "tail $glmiss_log|") or die "Can't tail on $glmiss_log: $

Re: use strict

2001-06-25 Thread Silvio Luis Leite Santana
Ok, japhy, thanks. So you're telling me Perl wouldn't allow any spaces "inside" keywords? What about when $_ be evaluated? The spaces of the line $CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ will still be there, won't they? Thanks Silvio Jeff 'japhy' Pinyan wrote: > > On Jun 2

Re: Large File Sort

2001-06-25 Thread Peter Scott
At 02:49 PM 6/25/01 -0400, Bill Pierson wrote: >Greetings all. I'm new to the list, and this is my first post, please >excuse my ignorance if I ask a question that has already been addressed. > >I need some help finding a program or script that will merge/sort a 250+MB >file as quickly as possib

Re: use strict

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Silvio Luis Leite Santana said: >I'd like to know how can a program like >the 'camel program' be compiled and run, >because there are spaces spliting keywords! The secret is on line 2. >0 use strict; >1 >2 $_='ev See, the main source of this

use strict

2001-06-25 Thread Silvio Luis Leite Santana
Hi all Please I'd like to know how can a program like the 'camel program' be compiled and run, because there are spaces spliting keywords! It seems it's because of the 'use strict', but I don't see any relation between them. The camel book, doesn't tell anything about spaces inside keywords eit

Re: Large File Sort

2001-06-25 Thread Paul
--- Bill Pierson <[EMAIL PROTECTED]> wrote: > Greetings all. I'm new to the list, and this is my first post, please > excuse my ignorance if I ask a question that has already been > addressed. > > I need some help finding a program or script that will merge/sort a > 250+MB file as quickly as pos

Large File Sort

2001-06-25 Thread Bill Pierson
Greetings all. I'm new to the list, and this is my first post, please excuse my ignorance if I ask a question that has already been addressed. I need some help finding a program or script that will merge/sort a 250+MB file as quickly as possible. For example - I have 2 files. File A, and File

Re: libgd

2001-06-25 Thread Jos I. Boumans
http://devresource.hp.com/OpenSource/Tools/libgd/libgd.html thanks to google it's 1.8.4 if you dont like that, grab a src on the redhat site or something, they usually keep archives - Original Message - From: "[Rajib Mukherjee]" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday,

Re: escaping v$session

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 02:24:21PM -0400, Chas Owens wrote: > Let me see if I have this straight: > > Perl was ignoring $session because of the \ and then passing the output > to the shell (stripping the \). Yes. > The shell saw $session so it tried to replace it with the enviromental > varia

RE: libgd

2001-06-25 Thread Paul Burkett
check out http://www.gtkperl.org/download.html if you have trouble finding software try www.freshmeat.net -Original Message- From: [Rajib Mukherjee] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 25, 2001 11:33 AM To: [EMAIL PROTECTED] Subject: libgd hi all, somebody help me find a libg

Re: Pooling of objects and session data

2001-06-25 Thread Jos I. Boumans
You're right, i should describe this more as 'switching between processes' kind of threading... basicly it takes over functionality kernel's normally do... basicly one should call it a 'timesliced application kernel that simulates threads'... it defines it's own 'threads' as 'states' between which

libgd

2001-06-25 Thread [Rajib Mukherjee]
hi all, somebody help me find a libgd-1.8.3.tar.gz file looked everywhere - google yahoo etc any help ?? rajib _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Re: Pooling of objects and session data

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 07:59:51PM +0200, Jos I. Boumans wrote: > poe-test.pl is the most basic one, simple starting a few threads You keep mentioning threads with relation to POE. I hope no one is under the mistaken impression that POE supports threads as in POSIX threads, or seperate threads o

Re: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 10:14:57 -0800, Michael Fowler wrote: > On Mon, Jun 25, 2001 at 02:09:59PM -0400, Chas Owens wrote: > > @active = qx( > > sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-! > > select count(distinct(process)) ACTIVE from v\\\$session > > where last_call_et < 60 and > > process in (s

Re: escaping v$session

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 02:09:59PM -0400, Chas Owens wrote: > @active = qx( > sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-! > select count(distinct(process)) ACTIVE from v\\\$session > where last_call_et < 60 and > process in (select ltrim(rtrim(to_char(process_id) )) from > session_list); >

Re: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 09:47:08 -0800, Michael Fowler wrote: > On Mon, Jun 25, 2001 at 01:09:51PM -0400, Chas Owens wrote: > > On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote: > > > > select count(distinct(process)) ACTIVE from " . 'v$session' . " > > > > > select count(distinct(process)) ACTIVE fr

Re: Pooling of objects and session data

2001-06-25 Thread Jos I. Boumans
Ok, here's the sample programs i promissed. poe-test.pl is the most basic one, simple starting a few threads, randomly picking one and letting it count... run it and you'll see =) pt.pl essentially does the same, but it's written in a more abstract way... feel free to tinker with it a bit a

RE: ? embed scalars in the sql

2001-06-25 Thread Canavan, John
We have Perl substitute like this on many of our web queries into our Oracle db. -Original Message- From: Greg Jetter [mailto:[EMAIL PROTECTED]] Sent: Monday, June 25, 2001 11:31 To: Francesco Scaglioni; [EMAIL PROTECTED] Subject: Re: ? embed scalars in the sql On Monday 25 June 2001 06

Re: escaping v$session

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 01:09:51PM -0400, Chas Owens wrote: > On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote: > > > select count(distinct(process)) ACTIVE from " . 'v$session' . " > > > select count(distinct(process)) ACTIVE from " . 'v\$session' . " > > What version of Perl are you using

GD package compiling prob

2001-06-25 Thread [Rajib Mukherjee]
hi all, when i run make after perl Makefile.PL i get a bunch of lines saying GD.c ; line 1168; cannot dereference non pointer types GD.c ; line 1168 ; warning improper pinter/integer combination: arg#1 any clues on what shld i try now ! rajib

RE: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote: > This one was really close :) > I had to change > > select count(distinct(process)) ACTIVE from " . 'v$session' . " > > to > > select count(distinct(process)) ACTIVE from " . 'v\$session' . " > > and it worked! > > Thanxs everyone! > > Ro

RE: escaping v$session

2001-06-25 Thread Yacketta, Ronald
This one was really close :) I had to change > select count(distinct(process)) ACTIVE from " . 'v$session' . " to > select count(distinct(process)) ACTIVE from " . 'v\$session' . " and it worked! Thanxs everyone! Ron

RE: escaping v$session

2001-06-25 Thread Stephen Neu
:@active = qx( :sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-! :select count(distinct(process)) ACTIVE from ---> v$session <--- :where last_call_et < 60 and :process in (select ltrim(rtrim(to_char(process_id) )) from :session_list); :quit :! :); Oh... Didn't see the other variables you were

Re: using fetchrow_hashref()

2001-06-25 Thread C.J. Collier
You might consider Apache::DBI. I hear it does what you're interested in doing, but I haven't done much research on it. Good luck! Check out search.cpan.org :) C.J. cpan> i Apache::DBI Module id = Apache::DBI DESCRIPTION Persistent DBI connection mgmt. CPAN_USERID MERGL (Edmund Merg

RE: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 12:15:15 -0400, Yacketta, Ronald wrote: > this is what I am trying todo > > @active = qx( > sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-! > select count(distinct(process)) ACTIVE from ---> v$session <--- > where last_call_et < 60 and > process in (select ltrim(rtrim(to_char(p

Re: :Graph

2001-06-25 Thread Michael D . Risser
On Sunday 24 June 2001 11:28 am, [EMAIL PROTECTED] wrote: > I tried your code below but had problems: > First, apache didn't like creating the image in the cgi-bin dir, so I > changed the reference to apache/icons instead of current directory. Perhaps > this is unimportant for your setup. I haven

RE: escaping v$session

2001-06-25 Thread Stephen Neu
:@active = qx( :sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-! :select count(distinct(process)) ACTIVE from ---> v$session <--- :where last_call_et < 60 and :process in (select ltrim(rtrim(to_char(process_id) )) from :session_list); :quit :! :); Ok, so you're using qx(foo), which is the same

Re: removing ASCII characters from array

2001-06-25 Thread Jos Boumans
and for esthetics: print join ',' @array; timtowtdi =) John Edwards wrote: > $data = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; > > @array = $data =~ /=(\d*)/g; > > print "$array[0], $array[1], $array[2]\n"; > > -Original Message- > From: Alex Nelson [mailto:[EMAIL PROTECT

RE: removing ASCII characters from array

2001-06-25 Thread John Edwards
$data = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; @array = $data =~ /=(\d*)/g; print "$array[0], $array[1], $array[2]\n"; -Original Message- From: Alex Nelson [mailto:[EMAIL PROTECTED]] Sent: 25 June 2001 17:07 To: [EMAIL PROTECTED] Subject: removing ASCII characters from

RE: escaping v$session

2001-06-25 Thread Yacketta, Ronald
> -Original Message- > From: Stephen Neu [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 25, 2001 12:04 PM > To: Perl Beginners (E-mail) > Subject: RE: escaping v$session > > > Try 'v$session' instead of "v$session" > The single quote doesn't interpolate variables like the double-quote

removing ASCII characters from array

2001-06-25 Thread Alex Nelson
I wrote a simple Perl script that removes a line from a file then writes it to another file. The result that is printed to the other file is: Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239 The last three elements are written from an array. What I would like to do is only print the numbers

RE: escaping v$session

2001-06-25 Thread Stephen Neu
Try 'v$session' instead of "v$session" The single quote doesn't interpolate variables like the double-quote. >From perldoc perlop Customary Interpolates '' no "" yes `` yes qw{}no // yes :-Original Message- :Fro

using fetchrow_hashref()

2001-06-25 Thread Marcus Willemsen
Hi I'm new to Perl and programming in general, I wrote (with the help of Learning Perl) the following cgi-scripte to get headlines out of a database called Message. And it works okay. The next step would be to enable a user to click on the headline that interest him and to display the rest of

escaping v$session

2001-06-25 Thread Yacketta, Ronald
Folks, I am trying to get some stats from a oracle DB (cant use DBI, dont ask why) I need to escape out v$session, but cant seem to find the right magic :( I have tried v\$session and get the ugly so such table or view Ron

Re: Reading Code

2001-06-25 Thread Jos Boumans
Try www.sharemation.com/~perl/tut those are some beginners tutorials i wrote that should explain most of your questions hth, Jos Boumans [EMAIL PROTECTED] wrote: > I am totally new to Perl and I have no training in perl at all and I was > asked to look at tons of code and basically translate t

HTML::PARSER

2001-06-25 Thread Prachi Shroff
Hi, Can somebody please explain me wha exactly does the HTML::PARSER module do? like if I use the parse() methoddoes it return me all text after extracting all the HTML tags? I could not find a proper expalnation to it in any book or documentation online. thanks, Prachi __

Re: to copy a file (with perl)

2001-06-25 Thread Stéphane JEAN BAPTISTE
This is my code : /^valeur=/ && do { $val=$_; $val=~s/valeur=//; }; open(IN,"actualite.txt"); open(OUT,">>tamp.tmp"); $i=1; while ( $line = ) { if ( $i != $valeur ) { print OUT $line; }; $i++; } close IN; close OUT;

RE: to copy a file (with perl)

2001-06-25 Thread Paul Jasa
Paul, Yeah, some elucidation please!! YOu mean to tell me this " while defined ($line=) " stands for: $line = ; while ($line) { print OUT "$line"; $line = ; } if so, is that due to the DEFINED command?? Just curious about this new way of doing these very c

Re: Reading Code

2001-06-25 Thread Chas Owens
perldoc perlvar will tell you almost everything you need to know about the punctuation type variables. For example @_ is @_ Within a subroutine the array @_ contains the parameters passed to that subroutine. See the perlsub manpage. On 25 Jun 2001 16

RE: Reading Code

2001-06-25 Thread John Edwards
OK. Ignore all the lines starting with a # sign. They are commented out. If you don't know what that means, stop reading now and learn some basic programming... local(@acc_fields) = @_; create an array called acc_fields which exists only within the subroutine called accum_cycle_count. Populate t

Re: to copy a file (with perl)

2001-06-25 Thread Paul
--- Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > On Jun 25, Aaron Craig said: > > >In the spirit of TMTOWTDI - > > > >At 07:20 25.06.2001 -0700, Paul wrote: > >>the brute force approach: =o) > >> > >> open IN, $fileor die $!; > >> open OUT, ">$new" or die $!; > >> print OUT $li

Re: Reading Code

2001-06-25 Thread EDonnelly
I am totally new to Perl and I have no training in perl at all and I was asked to look at tons of code and basically translate to english.I have an idea what this code does but it small bits like @_; that I havn't a clue about and their doesn't seem to be any really good sites for total begin

Re: Reading Code

2001-06-25 Thread Aaron Craig
At 15:59 25.06.2001 +0100, [EMAIL PROTECTED] wrote: >Can anyone tell me how to read this bit of code in english ? Basically it takes an array, checks certain values and returns an error if it doesn't like the value. If it likes all the values that it checks, it returns the return value of yet

Re: Reading Code

2001-06-25 Thread Jos Boumans
This wouldnt, by chance, be your homework now would it? [EMAIL PROTECTED] wrote: > Can anyone tell me how to read this bit of code in english ? > > > sub accum_cycle_count > > { > > # @acc_fields are: > > #0 - Cycle Counting Order > > #1 - Warehouse > > #2 - Loca

Re: to copy a file (with perl)

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Aaron Craig said: >In the spirit of TMTOWTDI - > >At 07:20 25.06.2001 -0700, Paul wrote: >>the brute force approach: =o) >> >> open IN, $fileor die $!; >> open OUT, ">$new" or die $!; >> print OUT $line while defined($line=); >> close OUT; >> close IN; > >print OUT $_

Re: to copy a file (with perl)

2001-06-25 Thread Aaron Craig
In the spirit of TMTOWTDI - At 07:20 25.06.2001 -0700, Paul wrote: >the brute force approach: =o) > > open IN, $fileor die $!; > open OUT, ">$new" or die $!; > print OUT $line while defined($line=); > close OUT; > close IN; print OUT $_ while (); Aaron Craig Programming iSoftit

Re: types of datas

2001-06-25 Thread Aaron Craig
Unlike strongly typed languages, Perl doesn't distinguish between types of scalar data, or rather, it massages it into the proper data depending on the context you're in. Meaning if I do this: my $sum = 1 + 1; now, $sum contains a number: 2; if I know say: print "$sum\n"; Perl automatically

Reading Code

2001-06-25 Thread EDonnelly
Can anyone tell me how to read this bit of code in english ? > sub accum_cycle_count > { > # @acc_fields are: > #0 - Cycle Counting Order > #1 - Warehouse > #2 - Location > #3 - Item Code > #4 - Container > # 5 - Lot Code > #

Re: $select

2001-06-25 Thread Paul
--- [EMAIL PROTECTED] wrote: > Can you tell me why there is a $ at the start and end of each value ? > > $select = > "SQL$;ITMLOCCCORDER$;${company}$;N$;$;${corder}$;${item}$; There isn't. o) >From perlvar: $; The subscript separator for multidimensional array emulation. If you refer

Re: $select

2001-06-25 Thread Brett W. McCoy
On Mon, 25 Jun 2001 [EMAIL PROTECTED] wrote: > Can you tell me why there is a $ at the start and end of each value ? > > $select = > "SQL$;ITMLOCCCORDER$;${company}$;N$;$;${corder}$;${item}$; Hard to day without seeing more relevant code, but could it be that they are using $; to create fake mul

$select

2001-06-25 Thread EDonnelly
Can you tell me why there is a $ at the start and end of each value ? $select = "SQL$;ITMLOCCCORDER$;${company}$;N$;$;${corder}$;${item}$;

Re: to copy a file (with perl)

2001-06-25 Thread Paul
--- Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]> wrote: > Hw could I copy a file in Perl the brute force approach: =o) open IN, $fileor die $!; open OUT, ">$new" or die $!; print OUT $line while defined($line=); close OUT; close IN; There are better ways, but this is a good one

Re: Use perl to "mv" dir?

2001-06-25 Thread Nigel Wetters
Sorry Tim, you chose a problem that looks simple, but isn't. Here's the code to move an arbitrary file or directory: http://language.perl.com/ppt/src/mv/mv.plx >>> Tim Musson <[EMAIL PROTECTED]> 06/25/01 02:00pm >>> Hey Perlers, I asked this before, but I am still stuck, and never got a work

runing a command with HEREDOC

2001-06-25 Thread Yacketta, Ronald
Folks, can you toss me some ideas how to wrap this within perl? timex sqlplus $RTDUSER/$RTDPASS@$RTD_ORACLE_SID <<-! 1>/dev/null 2> $oracleTMPFILE quit ! would this work? it looks funky $oratime = qx( (timex sqlplus $RTDUSER/$RTDPASS@$RTD_ORACLE_SID <<-! 1>/dev/null quit !); Ron

RE: environment-Variable from korn-schell to perl

2001-06-25 Thread Yacketta, Ronald
You could "read" in the .cfg file with a normal open( FN, "filename.cfg" ) then while ( ) { my ($key, $value) = split ( /=/ ); #might be off on this one... the split that is my $myenv{$key} = $value; } that _should_ generate a hash with the env variables you have in the file, th

Re: types of datas

2001-06-25 Thread Jos Boumans
I think you're going to need to send us a bit of code to go with this, because i'm really not sure what it is you're trying to do... "I have a loop (while) with a value which have different values." i can guess for a few explenations but code is probably easier =) Jos Boumans Stéphane JEAN BAP

RE: environment-Variable from korn-schell to perl

2001-06-25 Thread Peter . Schopen
> >I have to source a KORN-Shell Script, so that the environment-Variables > >created by > >KORN-Shell is available in my PERL-Script. Ho do I that > > > The hash %ENV stores the environment variables. > > if ( $ENV{HOME} =~ /dave/ ) > { > print "Good morning Dave."; > } > > http:

Re: environment-Variable from korn-schell to perl

2001-06-25 Thread Paul Johnson
On Mon, Jun 25, 2001 at 08:42:11AM -0400, Craig Moynes/Markham/IBM wrote: > >I have to source a KORN-Shell Script, so that the environment-Variables > >created by > >KORN-Shell is available in my PERL-Script. Ho do I that > > The hash %ENV stores the environment variables. > > if ( $ENV{HOM

Re[2]: /g

2001-06-25 Thread Tim Musson
Hey Sally, Do you have "Learning Perl"? Chapter 7. Regular Expressions 7.5 Substitutions "If you want the replacement to operate on all possible matches instead of just the first match, append a g to the substitution" Monday, June 25, 2001, 6:21:08 AM, you wrote: S> Cheers, that's all a book ha

types of datas

2001-06-25 Thread Stéphane JEAN BAPTISTE
Hi! I get a value from a URL and I put it into a variable. I have a loop (while) with a value which have different values. The problem is that when I compare the first and the second value: If they're really equals, the program say they are'nt. Is ther a function to convert a value into an inte

RE: newbie prob/different flavor

2001-06-25 Thread John Edwards
Try changing the name of the script to cyclonic.cgi. Apache may already be configured to run cgi scripts, if they have the extension .cgi. You may also need to place the file in the cgi-bin directory, depending on your Apache config. Currently your server is processing the file as the default (te

Use perl to "mv" dir?

2001-06-25 Thread Tim Musson
Hey Perlers, I asked this before, but I am still stuck, and never got a workable solution. Is there a way in perl to move a directory? Similar to unix "mv" command where you move a dir to another location (I am not crossing boundaries). I am on M$ Win2k, but the unix "mv" command is

newbie prob/different flavor

2001-06-25 Thread KeN ClarK
I am using cyclonic webmail . apache is set to serve the directory. You get index listing @ http://www.quantifier.org/cyclonic/ and when I type quantifier.org/cyclonic/cyclonic.pl I get the text of the script itself. Now I would think Something needs to invoke the script. But what? This is how I i

Re: environment-Variable from korn-schell to perl

2001-06-25 Thread Craig Moynes/Markham/IBM
>I have to source a KORN-Shell Script, so that the environment-Variables >created by >KORN-Shell is available in my PERL-Script. Ho do I that The hash %ENV stores the environment variables. if ( $ENV{HOME} =~ /dave/ ) { print "Good morning Dave."; } http://www.perldoc.com/perl5.6/pod

Re: /g

2001-06-25 Thread Rajeev Rumale
Oh well! its a quite intersting using /g I am sure all the beginners will love these neat way of coding.:-) Thanks Rajeev Rumale ~~~ Rajeev Rumale MyAngel.Net Pte Ltd.,Phone : (65)8831530 (o

Re: I need some help ...

2001-06-25 Thread Aaron Craig
At 11:43 25.06.2001 +0200, [EMAIL PROTECTED] wrote: >En réponse à Aaron Craig <[EMAIL PROTECTED]>: > > > foreach my $fichier (@fichiers) > > { > > my $result = (-e $fichier)? "$fichier fait (stat $fichier)[7] > > octets\n" : > > "$fichier inexistant \n"; > >

Re: /g

2001-06-25 Thread Aaron Craig
>On Jun 25, Sally said: > > >when evaluating strings what exactly does /g do at the end of a lot of > >evaluation expressions eg: > > > >$string =~ /(.)/g my $string = "abcd a bcd ab cd"; $string =~ /a/; # finds the first "a" - the a in 'abcd' $string =~ /a/g; # finds all "a"'s in the string T

Re: /g

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Sally said: >when evaluating strings what exactly does /g do at the end of a lot of >evaluation expressions eg: > >$string =~ /(.)/g The /g modifier is for regexes only (not strings in general). It is documented in 'perlre' and probably 'perlop' as well. It tells Perl that the regex

Re: creating ,interacting with a process on a remote machin

2001-06-25 Thread Gary Stainburn
Hi Raju, I'm not totally sure what you mean by interact with remote sockets. If you mean that you want to connect from your box to a server listening on a socket on a remote machine, then I suggest you look at Net::Telnet. Although it's designed to let a perl script pretend to be a user telnet

environment-Variable from korn-schell to perl

2001-06-25 Thread Peter . Schopen
Hi, I have to source a KORN-Shell Script, so that the environment-Variables created by KORN-Shell is available in my PERL-Script. Ho do I that It is vorbidden for me to manipulate / modify the KORN-Shell Sripts. Thank's Peter Schopen RZF NRW - Sachgebiet 215 Postfach 30 08 64, 40408 Düsseldo

Re: /g

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 11:21:08AM +0100, Sally wrote: > Cheers, that's all a book had to say (and I've got loads). I'm not sure what books you have, but this is documented in the following places: 1) perlop (perldoc perlop from the command-line, or go to perldoc.com) 2) perlre (perldoc

Re: Conecting my web server to informix.

2001-06-25 Thread Chas Owens
On 24 Jun 2001 08:24:53 -0700, Bruce Ferrell wrote: > Joe, > > You'll need to install perl DBI and DBD Informix. Use the CPAN Client > to download and install the as follows: > > perl -MCPAN -e chell I think you mean perl -MCPAN -e shell > > The above starts up the CPAN client in interactiv

list filters (was: Please)

2001-06-25 Thread Ask Bjoern Hansen
On Fri, 22 Jun 2001, Porter, Chris wrote: > UNSUBSCRIBE. FWIW, I've made the listfilters look slightly harder after various variations over requests for being removed from the lists. (They get rejected with a message telling them the right address and such) If they're rejecting too much or too

RE: /g

2001-06-25 Thread Chas Owens
It is an option. There are others as well (c, i, m, o, s, and x). It modifies the way the regexp is interpreted (in this case: match all occurances of pattern instead of the default: match first occurance). Was this the information you were looking for are do you want a more detailed discussion

  1   2   >