RE: How to wrap a sentence?

2002-10-18 Thread Johnstone, Colin
Hi Chris, I had to do something similar I am producing a text newsletter I do not want my lines of text in each paragraph to exceed 75 characters. Basically you take your string of text and assign the full words to an array you can use the split function to do this. So now you've got your array

perl -pei *.txt > bigfile

2002-10-18 Thread chris
Can I use wildcard to create a bigfile? # cannot open file perl -pei *.txt > bigfile -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to wrap a sentence?

2002-10-18 Thread chris
Given a lengthy string of words, I need to limit the line length and wrap it into multiple lines by introducing line breaks. Do not care about sentence or paragraph format, just respect full words. How do I do this? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Re: file processing

2002-10-18 Thread david
Sean Sugrue wrote: > Can anyone help me, > > I am trying to pick up the text on the next line if the line before it has > a "description" tag. > > while( > { > if( /description/i ){ >@array = nextline in the file; > some processing here} > >} > > > ## >

Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread John W. Krahn
Bruno oliveira wrote: > > Hi! Hello, > Thanks for answer my question. The only reason why i > didn't want to use fork is that then i must by some > process (writing a file, opening a socket, ...), send > back the pid to the parent process, right ? fork returns the PID of the child in the parent

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread Michael Fowler
I doubt you expected commentary on your code, but hopefully this will be helpful to both you and anyone else reading. On Sat, Oct 19, 2002 at 12:54:18AM +0600, Rakhitha Malinda Karunarathne wrote: You forgot -w and use strict. > $|=1; #*** Set auto Flush This sets autoflush

Re: Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread Michael Fowler
On Fri, Oct 18, 2002 at 07:33:45PM -0300, Bruno Oliveira wrote: > The only reason why i didn't want to use fork is that then i must by some > process (writing a file, opening a socket, ...), send back the pid to the > parent process, right ? No, see perldoc -f fork and the examples helpfully provi

Re: Clarification on a previous e-mail.

2002-10-18 Thread John W. Krahn
Shawn Milochik wrote: > > Just a couple of questions about your corrections: (All snippets are taken > from the e-mail below.) > > > Shawn: > > sub parseFrom400 { > > my $value = @_[0]; > ^ > John: > You want a scalar here, not an array slice. > > my $value = $_[0

Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread John W. Krahn
"John W. Krahn" wrote: > > Bruno oliveira wrote: > > > > Hi! > > Hello, > > > I want to start a program in perl but i need to keep > > the pid to be able to kill it in the future. > > > > For exmple: > > > > system("top &"); > > > > this would start "top", but then i wouldn't be able to > > iden

Re: Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread Bruno Oliveira
Hi! Thanks for answer my question. The only reason why i didn't want to use fork is that then i must by some process (writing a file, opening a socket, ...), send back the pid to the parent process, right ? Thought that there was maybe an easier way to do this in perl. Thanks any way! Regards,

Re: Roman Numbers to ->Normal Numbers

2002-10-18 Thread John W. Krahn
Rakhitha Malinda Karunarathne wrote: > > Can Any Body Tel me a Logic which can convert a roman number to a normal number > > and another one to convert a normal number to a roman number http://search.cpan.org/author/OZAWA/Roman-1.1/ John -- use Perl; program fulfillment -- To unsubscribe,

Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread Michael Fowler
On Fri, Oct 18, 2002 at 02:31:26PM -0300, Bruno Oliveira wrote: > this would start "top", but then i wouldn't be able to > identify the process in order to kill it. Is there a > way to do this (other than using fork) ? There may be a module available on CPAN for running a program in the background

Re: Roman Numbers to ->Normal Numbers

2002-10-18 Thread Michael Fowler
On Sat, Oct 19, 2002 at 12:35:37AM +0600, Rakhitha Malinda Karunarathne wrote: > Can Any Body Tel me a Logic which can convert a roman number to a normal number > > and another one to convert a normal number to a roman number There's a module on CPAN for this: http://search.cpan.org/author/

Re: copywrite symbol

2002-10-18 Thread Michael Fowler
On Fri, Oct 18, 2002 at 12:32:29PM +1000, Johnstone, Colin wrote: > How do I print out the copywrite symbol to a text file please. You should realize that the copyright symbol will be different for different character sets, and it won't exist in all of them. For example, others suggested using ch

Re: Question: How do i start a program and get is pid ?

2002-10-18 Thread John W. Krahn
Bruno oliveira wrote: > > Hi! Hello, > I want to start a program in perl but i need to keep > the pid to be able to kill it in the future. > > For exmple: > > system("top &"); > > this would start "top", but then i wouldn't be able to > identify the process in order to kill it. Is there a > w

Re: How can I avoid the Undefined reference in a hash value error

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 18, Chris Benco said: >Script seems to work well. I can send it blank fields and it recovers >every time. Problem is when I leave it running it crashes with the now >infamous Can't use an undefined value as a hash reference At line 16. When >it does this there is nothing in the inbox to

another reg-ex question

2002-10-18 Thread David Mamanakis
these are common it seems... I have a routine that returns a listing of users and all their information in a list format in an array 1: (status): : : firstName : lastName : eMail@.com example: 1: 223344(IDLE): idiot : 1234567 : Iyam : Stupid : [EMAIL PROTECTED] This list can be long. The

RE: dereferencing a array element reference

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 18, HENRY,MARK (HP-Roseville,ex1) said: >Huh, so pointers with the purpose of modifying the original data are not >necessary in perl? > >Why then would you use references (apart from the performance of passing >large amounts of data by value)? > >For larger & more data structures? It's bet

How can I avoid the Undefined reference in a hash value error

2002-10-18 Thread Chris Benco
Script seems to work well. I can send it blank fields and it recovers every time. Problem is when I leave it running it crashes with the now infamous Can't use an undefined value as a hash reference At line 16. When it does this there is nothing in the inbox to process. I added 'or ()' to get a

RE: Nice

2002-10-18 Thread Kipp, James
man nice > -Original Message- > From: Jessee Parker [mailto:jparker@;presslaff.com] > Sent: Friday, October 18, 2002 3:22 PM > To: [EMAIL PROTECTED] > Subject: Nice > > > How do you monitor and change the "nice" value of your > program? I'm running RH Linux 7.3. Thanks! > > Jessee >

Re: Nice

2002-10-18 Thread Frank Wiles
.--[ Jessee Parker wrote (2002/10/18 at 12:21:30) ]-- | | How do you monitor and change the "nice" value of your program? | I'm running RH Linux 7.3. Thanks! | `- Well as for monitoring, the nice value will not change unless i

Nice

2002-10-18 Thread Jessee Parker
How do you monitor and change the "nice" value of your program? I'm running RH Linux 7.3. Thanks! Jessee

Re: Single Quote marks in a string

2002-10-18 Thread shawn_milochik
Here is something for a very similar case: I am reading in lines from a file, and writing them into a database. Before I do, I do these two lines: $_ =~ s/\'/\''/g; #Replace any single quotes with a pair of single quotes. $_ =~ s/\"/\'/g; #Replace any double quotes with single q

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread Rakhitha Malinda Karunarathne
try this full code $|=1; #*** Set auto Flush #*** Operning and Locking files if u use in non multiuser environment ignore flock commands open(FIRSTIN,"out01.ext"); open(SECOUT,">out02.ext"); flock(FIRSTOUT,LOCK_EX); flock(SECOUT,LOCK_EX); #**

Roman Numbers to ->Normal Numbers

2002-10-18 Thread Rakhitha Malinda Karunarathne
Can Any Body Tel me a Logic which can convert a roman number to a normal number and another one to convert a normal number to a roman number Thanks

Re: Single Quote marks in a string

2002-10-18 Thread Felix Geerinckx
on do, 17 okt 2002 08:01:07 GMT, Andrew Hubbard wrote: > I'm having problems with a text file I'm working on. I need to > get > the descriptions in from the text file and into a > string for use in an SQL statement however some of the descriptions > use a single quote mark in the descr

Re: image dimensions - module

2002-10-18 Thread Geoffrey F. Green
Both Image::Size and Image::Info will do what you want. Don't know about PerlMagick because I've never used it. - geoff On 10/18/02 1:50 PM, "Matthew C. Peterson" <[EMAIL PROTECTED]> wrote: > I am trying to find the dimensions of a graphic with perl. I have the > PerlMagick (Image::Magick) mod

image dimensions - module

2002-10-18 Thread Matthew C. Peterson
I am trying to find the dimensions of a graphic with perl. I have the PerlMagick (Image::Magick) module, but I'm not sure if that is what I need. My purpose is to find the dimensions of an image, then send the x and y through an algorithm that will determine the best size for a thumbnail. thanks a

Question: How do i start a program and get is pid ?

2002-10-18 Thread Bruno Oliveira
Hi! I want to start a program in perl but i need to keep the pid to be able to kill it in the future. For exmple: system("top &"); this would start "top", but then i wouldn't be able to identify the process in order to kill it. Is there a way to do this (other than using fork) ? Regards, Brun

RE: copywrite symbol

2002-10-18 Thread NYIMI Jose (BMB)
> If you're using notepad or wordpad, hold down alt and type > 0169 (on the > keypad) and you'll get the symbol as a literal. Put it in > quotes, and it'll work fine. I think, he wants to print out the copyright symbol to a file from a perl script. If that is question then the syntax below will

Re: copywrite symbol

2002-10-18 Thread Jim Thomason
Hi, If you're using notepad or wordpad, hold down alt and type 0169 (on the keypad) and you'll get the symbol as a literal. Put it in quotes, and it'll work fine. Jim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Clarification on a previous e-mail.

2002-10-18 Thread shawn_milochik
Just a couple of questions about your corrections: (All snippets are taken from the e-mail below.) Shawn: > sub parseFrom400 { >

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread shawn_milochik
In my case, both files had an equal number of lines. The both contained comma-separated values to be imported into database tables. One table needed two additional fields which were contained in the second table. I had intended on opening both and appending the two fields I wanted. In the end,

RegEx - Please Help

2002-10-18 Thread RTO RTO
Hello Friends, I am confused and hence coded a small RegEx statement. I am now having more questions. Would appreciate, if you can help: Here is my code: C:\>perl -e "$str = 'null knot'; $str=~m/(null(?!\s?not))/; print $+;" The Output is: null Question 1: Should I not expect the full string '

RE: dereferencing a array element reference

2002-10-18 Thread HENRY,MARK (HP-Roseville,ex1)
Jeff, Huh, so pointers with the purpose of modifying the original data are not necessary in perl? Why then would you use references (apart from the performance of passing large amounts of data by value)? For larger & more data structures? Thx for the info. Mark > -Original Message- >

RE: [Storing CR in variable

2002-10-18 Thread NYIMI Jose (BMB)
$var=~s/\%0D\%0A/\n/g José. > -Original Message- > From: Wim [mailto:wdh@;belbone.be] > Sent: Friday, October 18, 2002 3:57 PM > To: [EMAIL PROTECTED] > Subject: [Storing CR in variable > > > > > Hello, > > I have a memofield on a HTML page. I need to insert it in a > database. The

[Storing CR in variable

2002-10-18 Thread Wim
Hello, I have a memofield on a HTML page. I need to insert it in a database. The CGI-script replaces the CR's with %0D%0A. How to I replace %0D%0A into a CR within a variable? Cheers. Have a nice week-end Wim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: our($var) having a lexically scoped name

2002-10-18 Thread Jenda Krynicky
From: "George P." <[EMAIL PROTECTED]> > (taken frrom Programming Perl) > > __BEGIN__ > > The our declaration declares a lexically scoped name > for a global variable, which is not itself a lexical variable > > __END__ > > The part about the variable not being lexical variable

Local Time

2002-10-18 Thread Joseph Ruffino
Hi, I have a real quick question, I hope. Now, I know there is a variable called localtime, which has the current time and date in, all you have to do is assign it to the correct variable. My question is, what are the correct variable names for the time? My assumption is $hour and $minute

RE: Local Time

2002-10-18 Thread Beau E. Cox
Hi - It's not really a variable, its a function, in scalar context: $now = localtime (); -or, sometimes you must be more explicit- $now = scalar localtime (); It returns a formatted string, like; Thu Oct 17 05:34:07 2002 In list context, it returns a list of values in a specific order: @no

system() output redirection

2002-10-18 Thread Joe Mecklin
i'm trying to use system() to run ptal-pml to retrieve pml values from hp printers; my problem is how to redirect the system() output. the variations i've tried with backticks or qx// are not accomplishing anything useful - i get either a numeric value or an empty string. this is the command i'm

check for update

2002-10-18 Thread folschette
hi, i have written a program that indexes multiple websites(~50), to build a search-engine for each site. but now the problem: i want to check for updates every day, and if there was a chagne in one site, reindex my website, how is this possible, i have heard in previous messages about crontab,

Re: copywrite symbol

2002-10-18 Thread zentara
On Fri, 18 Oct 2002 12:32:29 +1000, [EMAIL PROTECTED] (Colin Johnstone) wrote: >Hi all, > >How do I print out the copywrite symbol to a text file please. print char(169); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: More Newbie OOP Questions ...

2002-10-18 Thread Paul Johnson
On Thu, Oct 17, 2002 at 01:49:50PM -0800, Michael Fowler wrote: > On Wed, Oct 16, 2002 at 11:52:44PM +0200, Paul Johnson wrote: > > The constructor, then blesses $name into the class "Horse", or more > > accurately, blesses a reference to $name. > > You were right the first time; bless blesses $na

Re: copywrite symbol

2002-10-18 Thread Paul Johnson
On Fri, Oct 18, 2002 at 12:49:38PM +1000, Toby Stuart wrote: > not sure you can in ascii > > a couple of brackets will do the trick > > (c) But has absolutely no legal meaning. If you can't get © (^V169 in Vim), use "Copyright", which does have a legal meaning. IANAL, and although our l

Re: Local Time

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Joseph Ruffino said: >I have a real quick question, I hope. Now, I know there is a variable >called localtime, which has the current time and date in, all you have >to do is assign it to the correct variable. My question is, what are >the correct variable names for the time? My ass

our($var) having a lexically scoped name

2002-10-18 Thread George P.
Hi, (taken frrom Programming Perl) __BEGIN__ The our declaration declares a lexically scoped name for a global variable, which is not itself a lexical variable __END__ The part about the variable not being lexical variable can be checked by printing $main::var. However, what do you mean by a

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, [EMAIL PROTECTED] said: >while (){ > #assume $otherData would be the $_ from > print FIRSTOUT "$_\n"; > print SECONDOUT "$otherData, $_\n"; > >} Like so: while () { my $otherData = ; print FIRSTOUT $_; print SECONDOUT $otherData, $_; } -- Jeff "japhy" Pi

Re: How can I open and read two files at once in a loop? -- Thanks, and also here's a snippet someone may fine useful...

2002-10-18 Thread John W. Krahn
Shawn Milochik wrote: > > I am working on a project which involves downloading files via FTP from an > AS/400, and I had to write a couple of functions because of the weird way > IBM does things. > > The first function takes a value, and dependent upon the final character, > does something to it.

AI in Perl

2002-10-18 Thread James Edward Gray II
Any good books out there covering AI logic concepts in Perl? Recommendations welcome. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Extended regexp help to fix a potential bug with DBI::Shell

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Robert Thompson said: >(?http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** what does y/// stand for? why, yansliterate of course. [ I'm lo

FW: Regex Help - removing HTML tags/script

2002-10-18 Thread Jon Shoberg
I need to remove HTML scripts from some pages. I have to replace <*script*>* with blanks. This includes all javascript/vbscript in between the tags I'm using the * as guidelines to show it must match several variations. Thoughts ? Ideas? Suggestions? Thanks ! Jon -- To unsub

SQL column copy

2002-10-18 Thread learn perl
Hi guys, I am not sure if this is relavent to perl. Maybe Perl::DBI is more appropriate. But is there a way to copy one column of a table to another table? Thanks Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

can you post from the newsgroup

2002-10-18 Thread Randy Perkins
hello i have started following this list thru the news server nntp.perl.org am i allowed to post ?? thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Getting A File Name

2002-10-18 Thread Ken Cole
Hi, I have a directory in which there are files such as: fred.1 fred.2 fred.3 The suffix increases and older files get deleted so there are always 3 fred.* files in the directory at any one time. I need to get the name of the file with the highest suffix so I can go and do some other stuff wi

Re: How can I open and read two files at once in a loop? -- Thanks, and also here's a snippet someone may fine useful...

2002-10-18 Thread shawn_milochik
Japhy: Thanks very much for the answer. Everybody: I am working on a project which involves downloading files via FTP from an AS/400, and I had to write a couple of functions because of the weird way IBM does things. The first function takes a value, and dependent upon the final character, doe

Weekly list FAQ posting

2002-10-18 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread John W. Krahn
Michael Fowler wrote: > > You did, but you don't mention what should happen when one of the input > filehandles reaches EOF before the other, or if that's possible. > > The solution I would use would go something like this: > > while (1) { > my $first_in = ; > last unless def

Re: Extended regexp help to fix a potential bug with DBI::Shell

2002-10-18 Thread Michael Fowler
On Thu, Oct 17, 2002 at 04:23:12PM +, Robert Thompson wrote: > I have been using DBI::Shell (via dbish) which provides a shell > prompt for interacting with a database and I think I have come > across a bug that I might be able to fix but am having trouble doing > so. I

perl SSI

2002-10-18 Thread Andres L. Figari
Never mind :) Found this: http://www.cpan.org/authors/id/J/JA/JAMES/CGI-SSI-0.53.readme Thanks anyways ... Andres -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: check for update

2002-10-18 Thread Rakhitha Malinda Karunarathne
if all web site in one server just put a program to scan all the sites and update the index if necessary then shedule it to run in once a day if the sites are in different servers put a program in each server to scan and update the search engines database once a day if u cant use a database use

Re: system() output redirection

2002-10-18 Thread John W. Krahn
Joe Mecklin wrote: > > i'm trying to use system() to run ptal-pml to retrieve pml values from > hp printers; my problem is how to redirect the system() output. the > variations i've tried with backticks or qx// are not accomplishing > anything useful - i get either a numeric value or an empty str

perl and SSI

2002-10-18 Thread Andres L. Figari
Hi, I am trying to do a 3 part form and all works well. However, I wanted to include SSI in my html and have the sever parse it. But alas, it's a .cgi not .shtml file Would any one be kind enough to tell me if what I want is possible (have youdone it?), and where a good way to read up how can be

Re: can you post from the newsgroup

2002-10-18 Thread Randal L. Schwartz
> "Randy" == Randy Perkins <[EMAIL PROTECTED]> writes: Randy> i have started following this list thru the news server nntp.perl.org Randy> am i allowed to post ?? If you see this, then yes. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]>

Re: macros

2002-10-18 Thread Randal L. Schwartz
> "Duarte" == Duarte Cordeiro <[EMAIL PROTECTED]> writes: Duarte> (the question being: how can I do macros within perl, and how can I pass "things" to the perl interpreter? ) -- Randal L. Schwartz - Stonehenge Consulting Services

Re: How to use a module located relative to the current script

2002-10-18 Thread david
Shlomo Reinstein wrote: > Hi, > From some perl script, say "some_path/lib/sos.pl", I would like to make > use of a perl module, which is located at "some_path/modules". I don't > know what "some_path" is inside "sos.pl", but I know that I can reach the > module using a relative path "../modules".

Re: Getting A File Name

2002-10-18 Thread Jean Padilla
Hi, try this : my $last = (glob("fred.*"))[-1]; --- - $last gets the last item in the array returned by glob() - glob() returns file names sorted alphabetically ;-) Regards. Ken Cole a écrit : > > Hi, > > I have a directory in which there are files such as: > > fred.1 > fred.2 > fred.3 > > T

RE: macros

2002-10-18 Thread Beau E. Cox
Hi - Yea, I just tried a c preprocessor, but, guess what? All perl comments (they start with # remember) gave 'invalif preprocessor directives... Oh, well... Aloha => Beau. PS: Duarte, have you searched CPAN for a "macros" mod? -Original Message- From: Paul Johnson [mailto:pjcj@;pjcj.n

Re: Join problem

2002-10-18 Thread John W. Krahn
Vincent Lee wrote: > > Hello All, Hello, > I've got a problem with the JOIN function > > I've got a list of columns that gets returned from the > database. > > I push the column values into an array and then join > them with a comma. The problem is that JOIN puts a > comma in the first value.

RE: Join problem

2002-10-18 Thread Beau E. Cox
Hi - it must be an undef in your array, your join should work as posted. You might try something like (untested): for (@array) { if ($_) { push @clean_array, $_ } } now join on @clean_array... Aloha => Beau. -Original Message- From: Vincent Lee [mailto:vjlee_us@;yahoo.com]

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread Michael Fowler
On Thu, Oct 17, 2002 at 11:27:43AM -0400, [EMAIL PROTECTED] wrote: > I have working code which opens two files (1 read, 1 write), then parses > the text from the file FIRSTIN to a particular format, then prints it to > the FIRSTOUT file. > > I need to add to this the capability to open SECONDIN li

file processing

2002-10-18 Thread Sugrue, Sean
Can anyone help me, I am trying to pick up the text on the next line if the line before it has a "description" tag. while( { if( /description/i ){ @array = nextline in the file; some processing here} } ## But it would even be better if ##

Re: macros

2002-10-18 Thread Paul Johnson
On Thu, Oct 17, 2002 at 01:29:59AM -1000, Beau E. Cox wrote: > Hi - > > I don't think so... > > Of course you can write a perl preprocessor in perl... > > or, what about some open source preprocessor? > > Aloha => Beau. If you want the C preprocessor, check out the -P option to Perl. But I'd

Re: Hierarchical Construction/Destruction

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, James Edward Gray II said: >sub new { > my $class = shift; > $class = ref $class if ref $class; > my %args = @_; > my $self = bless { }, $class; > > # needs hierarchical initialization here > > $self->initialize(%args); > return $self; >} >This

Re: regular expression

2002-10-18 Thread Mandar Rahurkar
thanks for your prompt reply...however this does not work.. program does not generate any output... -Mandar On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > On Oct 17, Mandar Rahurkar said: > > >Hi, > > I am trying to write a regular expresssion which reads as : > >from the list of following f

parsing help (hex conversion, perhaps?)

2002-10-18 Thread shawn_milochik
I have a file which contains some hex data. When I unpack it using "H", it gives me what I want, almost. Original file: rtrates.rtrates Perl Script: rtrates.pl Results: rtrates.out What the results are supposed to look like: rtrates.txt The problem I'm having is that although the first two fi

Re: Converting IO::Handle to filehandle

2002-10-18 Thread Michael Fowler
On Wed, Oct 16, 2002 at 10:15:12AM -0700, vishal mittal wrote: > my $child = new IO::Handle; > > When I try to redirect this handle to a filehandle > using > > open(MY_DESCRIPTOR, ">&$child"); $child is already a filehandle, you shouldn't need to redirect it to another. What is it you're tryin

Re: Join Problem

2002-10-18 Thread Alfred Vahau
>shift @columns if not defined $column[0]; ^ Thanks for the correction. It seemed almost like a natural extension of defined which I tried before posting. Alfred, Jeff 'japhy' Pinyan wrote: > On Oct 18, Alfred Vahau said: > > >> How do I get rid of the comm

Re: Getting Columns

2002-10-18 Thread Michael Fowler
On Wed, Oct 16, 2002 at 03:10:14PM -0600, Brady Fausett wrote: > I recently was reading a posting regarding getting table names and then > retrieving colmn names from another post. I have been trying to make a > perl program that I have written (with DBI) to be more object oriented. > To be able

Hierarchical Construction/Destruction

2002-10-18 Thread James Edward Gray II
Please, tell me hierarchical construction/destruction is on the Perl 6 checklist! I come from a Java background and Perl and I just don't see eye to eye here. Okay, my problem: I'm building a class hierarchy and the constuctors are getting the better of me. I think I've finally settled on a

How can I open and read two files at once in a loop?

2002-10-18 Thread shawn_milochik
I want to do something like this: open (FIRSTIN, "<$FIRSTINFile"); open (FIRSTOUT, ">$FIRSTOUTFile"); open (SECONDIN, "<$rtsalFIRSTIN"); open (SECONDOUT, ">$rtsalFIRSTOUT"); while (){ #assume $otherData would be the $_ from print FIRSTOUT "$_\n"; print SECONDOUT "$otherData,

Re: Join Problem

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 18, Alfred Vahau said: >> How do I get rid of the comma in the first value? >You could try shifting to the left like > >shift @columns if (undef $column[0]); undef() is not a test. undef() undefines things. shift @columns if not defined $column[0]; The simplest solution is: print j

RE: Microsoft Access Question

2002-10-18 Thread Beau E. Cox
Hi - My suggestion is to use ODBC in perl for MS Access access: 1> get latest DBI module from CPAN (if you don't already have it) 2> same with DBD::ODBC 3> I don't know Windows 98, but somewhere in control panel or admin tools there is an ODBC setup program. Go into this and create an ODB

Re: @INC

2002-10-18 Thread Jenda Krynicky
From: David Rainsford <[EMAIL PROTECTED]> > I am trying to run GreyMatter on my Mac OSX machine. However, I get > the following error: > > Can't locate gm-library.cgi in @INC (@INC contains: > /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin > /Library/Perl

Join problem

2002-10-18 Thread Vincent Lee
Hello All, I've got a problem with the JOIN function I've got a list of columns that gets returned from the database. I push the column values into an array and then join them with a comma. The problem is that JOIN puts a comma in the first value. How do I get rid of the comma in the first val

Re: Converting IO::Handle to filehandle

2002-10-18 Thread david
Vishal Mittal wrote: > Hi, > > I have something like this > > my $child = new IO::Handle; > > When I try to redirect this handle to a filehandle > using > > open(MY_DESCRIPTOR, ">&$child"); > > it gives me an error. What is it that I am doing wrong > ?? try this instead: $child = new IO::Ha

Re: regular expression

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Mandar Rahurkar said: >Hi, > I am trying to write a regular expresssion which reads as : >from the list of following files generate a list which does not start >with 150d in the beginning: >@new= grep {/[^{no}]/} @list; First, you've got a character class [^...]. You don't want that

Re: regular expression

2002-10-18 Thread Mandar Rahurkar
On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > On Oct 17, Mandar Rahurkar said: > > >> >> @new = grep { ! /^$no/ } @list; > >> >> @new = grep !/^\Q$no/, @list; > >> > > >> >thanks for your prompt reply...however this does not work.. > >> >program does not generate any output... > >> > >> W

Re: How to use a module located relative to the current script

2002-10-18 Thread Michael Fowler
On Wed, Oct 16, 2002 at 05:05:09PM +0200, Reinstein, Shlomo wrote: > Is there a way that I can say in "sos.pl" that I want to use the module > located in "../modules" relative to it? I've read through this thread and it sounds like you're trying to solve the wrong problem, or perhaps going at it t

FW: Single Quote marks in a string

2002-10-18 Thread Toby Stuart
see correction below > -Original Message- > From: Toby Stuart > Sent: Friday, October 18, 2002 11:31 AM > To: 'Andrew Hubbard' > Cc: '[EMAIL PROTECTED]' > Subject: RE: Single Quote marks in a string > > > been a long time since i done any SQL but i *think* you have > to quote single-

Re: Question about assigning a value to an array.

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Aaron Petry said: >I have 2 files. One is an error log created from an import procedure to >a database, the other is the text file that we were trying to import. >The error log gives me back the line number that the record was on. I >need to cross reference this. I'm thinking that th

time references

2002-10-18 Thread Greg Oliver
I am writing a program that will do a certain function every 5 seconds. Currently, I am testing the modulus of time() / 5 to do the function in a tight loop, but that seems pretty sloppy to me. Unfortunately, I do not know of any other ways. I have looked through all of the Time:: modules on

Re: How can I open and read two files at once in a loop?

2002-10-18 Thread Michael Fowler
On Thu, Oct 17, 2002 at 03:49:31PM -0700, John W. Krahn wrote: > Michael Fowler wrote: > > while (1) { > > my $first_in = ; > > last unless defined $first_in; > > > > my $second_in = ; > > last unless defined $second_in; > > > > print FIRSTOUT "$first_i

Re: Hierarchical Construction/Destruction

2002-10-18 Thread James Edward Gray II
Thanks all for the constructor suggestions, but I'm still having a few problems. See comments below: On Thursday, October 17, 2002, at 09:58 AM, NYIMI Jose (BMB) and Jeff 'japhy' Pinyan wrote: On Oct 17, James Edward Gray II said: sub new { my $class = shift; $class = ref $class if ref $c

Question about assigning a value to an array.

2002-10-18 Thread Aaron Petry
I have 2 files. One is an error log created from an import procedure to a database, the other is the text file that we were trying to import. The error log gives me back the line number that the record was on. I need to cross reference this. I'm thinking that this should be no big deal. I'l

Re: Join problem

2002-10-18 Thread Rob
As per my previous post, init your array with @columns = () instead of @columns = "" Cheers, Rob - Original Message - From: "Vincent Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 12:47 PM Subject: Join problem > Hello All, > > I've got a

Re: More Newbie OOP Questions ...

2002-10-18 Thread Michael Fowler
On Wed, Oct 16, 2002 at 11:52:44PM +0200, Paul Johnson wrote: > The constructor, then blesses $name into the class "Horse", or more > accurately, blesses a reference to $name. You were right the first time; bless blesses $name. You have to pass a reference so bless can modify the original variabl

Re: creating a string on the fly

2002-10-18 Thread Rob
Hmm. Not much wrong there, apart from initialising @columns = "", which will set up the array to have a null string as its single element. Use @columns = (). I'm suspicious about the bind_columns call, but since you're using a package I'm not familiar with I can't be sure. I'd suggest binding a f

Join Problem

2002-10-18 Thread Alfred Vahau
> How do I get rid of the comma in the first value? You could try shifting to the left like shift @columns if (undef $column[0]); then apply join as you have it. >Is the database returning a null field in the first >columns, is that why it's returning a comma? The answer to this question will a

Re: regular expression

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Mandar Rahurkar said: >> >> @new = grep { ! /^$no/ } @list; >> >> @new = grep !/^\Q$no/, @list; >> > >> >thanks for your prompt reply...however this does not work.. >> >program does not generate any output... >> >> What program? Please show us the code you're (now) using. > >$spkr=

  1   2   >