Re: Align Text

2003-12-24 Thread James Edward Gray II
On Dec 23, 2003, at 11:29 PM, Bill Jastram wrote: Yes, this helps tremendously. Actually, your suggestions helped me make, what for me is, a quantum leap in the use of Perl. Good news. Always happy to help. I am stuck, however, on the loop you suggested to output the processed @col arrays. I

Re: Why would I learn PERL ??

2003-12-24 Thread James Edward Gray II
On Dec 24, 2003, at 11:08 PM, Tone wrote: Hello, I'm interested in programming languages and am somehow new to this field.I am moving from Windows to Linux and am interested in engaging in the programming world. What I would like to ask is: why would I be interested in learning Perl ? All

Re: Align Text

2003-12-23 Thread James Edward Gray II
On Dec 23, 2003, at 12:17 AM, Bill Jastram wrote: After taking a look at your last suggested script I have a short question: At what point does this script read in information from the source file 'testing.txt'? Is it during the 'while ()' statement? If so what would the syntax be? Yes, you've

Re: Align Text

2003-12-22 Thread James Edward Gray II
On Dec 21, 2003, at 10:47 PM, Bill Jastram wrote: James: Thanks for the sample and I agree it does work. How can I create an array of just the first names for a file? This is what I have so far: Let's take a look at what you have first. You're missing two very important lines right here: use

Re: foreach

2003-12-19 Thread James Edward Gray II
On Dec 19, 2003, at 7:59 AM, Rob Dixon wrote: That's fair enough, as long as you have a consistent convention. I use for (EXPRESSION; EXPRESSION; EXPRESSION) and foreach (LIST) unless the list has only one element, when I use for (EXPRESSION) to alias $_ with the expression for the

Re: Align Text

2003-12-19 Thread James Edward Gray II
On Dec 19, 2003, at 8:29 AM, Bill Jastram wrote: James: A coupe of things. #1. Pardon my ignorance, but I'm not sure how to use the list where I found the reply button to e-mail you directly. I could not find a way to add to the already existing 'thread'. Your help would be appreciated. The

Re: Align Text

2003-12-19 Thread James Edward Gray II
On Dec 19, 2003, at 12:04 PM, Bill Jastram wrote: We're getting closer. But lets say the first name of the first field in the first row is 'Bill'. And the first name of the first field in the second row is 'Lanette'. This command will not compensate for the difference in the length of the two

Re: RegEx Troubles

2003-12-19 Thread James Edward Gray II
On Dec 19, 2003, at 12:47 PM, Jeremy Mann wrote: Given this in $_ pMost popular title searches:/pollia HREF=/title/tt0244365/Enterprise (2001)/a/li why would this regex not put digits in $1 ? $data2 =~ /popular title searches:\/pollia HREF=\\/title\/tt(\d*)\/\/ Because the regex targets the

Re: Align Text

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 12:03 AM, Bill Jastram wrote: James: I'm happy to help, but keep your replies on the list so we can all learn/help. Can printf set the value in spaces of tab (\t)? I need to do three column output with perl for mailing labels. You bet: perl -e 'printf %20s %20s %20s\n,

Re: alternating loop

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote: Hello, been trying to come up with a way, while going through a loop to alternate a table cell color td/td See if this gets you thinking along the right lines: my $odd = 1; while () { # some kind of loop... if ($odd) {

Re: foreach

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 5:57 PM, Eric Walker wrote: Hello all While traversing a loop across and array, how can I access array positions further down the array, like say if I am on a loop looking at position 23, how can I check the value of say position 24 or 32 while my loop counter is on position

Re: alternating loop

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 8:54 PM, Ricardo SIGNES wrote: * Mike Blezien [EMAIL PROTECTED] [2003-12-18T18:48:23] been trying to come up with a way, while going through a loop to alternate a table cell color td/td I always do something more like: my $i; while () { print tr class='r,

Re: Users executing perl scripts

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 8:10 AM, Hemond, Steve wrote: Hi people, I have finished some little perl scripts that gives basic infos to my users. I want to make these perl scripts available to all users (so I would probably put them in /usr/local/bin). However, my perl scripts has the .pl extension, and

Re: Regular expressions

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 9:59 AM, Hemond, Steve wrote: Hi again, I want to make a search on two words. If 'one two' is found, it is okay. If 'one' is found, it is incorrect. If 'two' is found, it is also incorrect. I want the search to return me occurences of 'one two' found together. I am

Re: RE : Regular expressions

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 10:09 AM, Hemond, Steve wrote: Actually, I have to test two conditions to get into a block, If the strings found are either one two or two three, go ahead. if ($text =~ /one two/ or /two three/) Now that is a mistake. ;) if ($text =~ /\bone two\b/ || $text =~ /\btwo

Re: get rid of whitespace around pipes??

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 10:26 AM, LoneWolf wrote: I am parsing a massive file line by line and cleaning it up. It has about 15 fields, all separated by | and I want to remove the white space from before and after the pipes so that as the information is parsed it gets rid of external white spaces

Re: RE : Regular expressions

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 10:29 AM, Hemond, Steve wrote: Okay, here`s the real problem, # ps -efA |grep dispatch cspenard 33958 45716 0 09:08:05 pts/8 0:00 /prog/gena/8.1.1/bin/dispatch genie -u /prog/gena/impress/gui/im msirois 37212 9842 0 08:41:17 pts/1 0:04 /prog/gena/8.1.1/bin/dispatch

Re: Term:ANSIColor and negative numbers

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 11:25 AM, Steve Massey wrote: Hi All using Term:ANSIColor - does anyone know if it's possible ( or maybe I mean practical) to print out negative numbers in say RED, at the same time ensuring the original value is retained. so if value is -16 the it should print 16 in RED

Re: Term:ANSIColor and negative numbers

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 11:42 AM, Steve Massey wrote: Nice one James - that does it ..!! Happy to help. something more to learn - abs perldoc -f abs many thanks.. Anytime. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Term:ANSIColor and negative numbers

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 11:41 AM, Wagner, David --- Senior Programmer Analyst --- WGO wrote: How do you get it to actually do the color? I use both std command( w2k) and older version os MKS Korn shell and all I get is numbers. Never understood how one actually gets the colors etc. What does

Re: Line by line

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 7:28 PM, PerlDiscuss - Perl Newsgroups and mailing lists wrote: Hi, I have a file extremely large in size and length. I want to read the file line by line and worry about matching up each line and running that line through a subroutine instead of opening the entire file

Re: Comparing Hashes with different keys. How ?

2003-12-16 Thread James Edward Gray II
On Dec 16, 2003, at 9:36 AM, John Hennessy wrote: Hi, I have two different hashes built from separate data and need to find the common then differing items. $HoA1{$custnum} = [ $uid, $firstname, $lastname ]; $HoA2{$uid} = [ $custnum, $firstname, $lastname ]; I have looked at examples for

Re: Out of memory error problem

2003-12-16 Thread James Edward Gray II
On Dec 16, 2003, at 1:15 PM, Perl wrote: I wrote a small script that uses message ID's as unique values and extracts recipient address info. The goal is to count 1019 events per message ID. It also gets the sum of recipients per message ID. The script works fine but when it runs against a very

Re: Align text

2003-12-16 Thread James Edward Gray II
\On Dec 16, 2003, at 1:39 PM, Hemond, Steve wrote: Hi again, Thanks for you help with my data structure problem, a hash of hashes problem did the job :-) I would like to know how to align text with the print command. I have four scalar variables to print but I want them to follow their header's

Get Terminal Width and Height, Pure Perl

2003-12-15 Thread James Edward Gray II
Okay, I have a terminal program I need to get the width and height for. I have a very good reason needing to do it with a base 5.8 Perl install, if at all possible. Unfortunately, that rules out the super easy Term::ReadKey CPAN module. (Side note: I do have Term::ReadKey installed and am

Re: Get Terminal Width and Height, Pure Perl

2003-12-15 Thread James Edward Gray II
On Dec 15, 2003, at 10:51 AM, Charles K. Clarkson wrote: James Edward Gray II [EMAIL PROTECTED] wrote: : : So my question is, is there a Pure Perl way to fetch : the terminal columns and rows? I took a look at the source of Term::ReadKey and it seemed to be pure perl. Are you sure it's

Re: Split question

2003-12-14 Thread James Edward Gray II
On Dec 14, 2003, at 6:42 PM, R. Joseph Newton wrote: The only problem I see with John's code is that it addumes that the print statement will print a newline, which it doesn't [at least on my installation of V5.8]. Na, John's smarter than you give him credit for here. Here was the code: On

Re: getting rid of whitespace at the beginning and end of a string

2003-12-12 Thread James Edward Gray II
On Dec 12, 2003, at 1:51 PM, Dan Anderson wrote: Is there a way to chomp all whitespace both at the beginning and end of a string? I was thinking of using a regexp like s[^\s*?][]sg and s[\s*?$][]sg; Is there a better way? (I'm thinking of PHP's trim function) I imagine so because I don't

Re: could use an audit

2003-12-12 Thread James Edward Gray II
On Dec 12, 2003, at 6:20 PM, Kenton Brede wrote: I've cobbled some code together that will allow me to parse a file snarfing 4 lines which consist of server name and Daily output of bandwith usage. I've pasted an example of what I have at the bottom of this mail. If anyone would like to take

Re: copying complex data structures

2003-12-11 Thread James Edward Gray II
On Dec 11, 2003, at 9:37 AM, West, William M wrote: the following will not work: $arrayref_one = $arrayreftwo; #it's just making a new name for the same #reference. the following works fine: foreach my $a (0..$what){ foreach my $b (0..$why){

Re: Help with manipulating a string.

2003-12-10 Thread James Edward Gray II
On Dec 10, 2003, at 1:39 AM, Mark Weisman wrote: I've got a multiline text box that will feed the ^M at the end of each line. I want to capture it into a single line (which is done), but how do I get it back? Not knowing how many lines there may be with the ^M between them. Currently, I use the

Re: How to print ... during download

2003-12-10 Thread James Edward Gray II
On Dec 10, 2003, at 8:25 AM, usef wrote: Thank you guys for quick answers, What if I want to print a ... and calculate the percentage and amount of currently downloaded size during the download process? (wget style), should I create another process to do that? or is there any other

Re: 1 doubt.

2003-12-10 Thread James Edward Gray II
On Dec 11, 2003, at 3:27 AM, Ajey Kulkarni wrote: perl t.pl Name main::FH used only once: possible typo at t.pl line 6. cat t.pl #!/usr/bin/perl use strict; use warnings; open FH, out.dat; Why am i getting this warning? When i remove the warnings,this goes off? Is there any problem if i not

Re: Match the first 3 characters of 2 words?

2003-12-10 Thread James Edward Gray II
On Dec 10, 2003, at 2:19 PM, Rod wrote: What is the easiest way to test the first 3 characters of two words for a match. IE: dasf test dasg to return positive. substr(dasf, 0, 3) eq substr(dasg, 0, 3) James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Problems forking -- fork DOSes my comp

2003-12-10 Thread James Edward Gray II
On Dec 10, 2003, at 3:52 PM, Dan Anderson wrote: I am learning about forks, so I tried the following code to make sure I had everything down: Still don't believe me about Network Programming with Perl, eh? Did I mention that it covers forking well? laughs Basic idea of fork: if ($pid =

Re: Problems installing modules on OS X Panther

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:37 AM, Stephan Hochhaus wrote: Hello list! I am starting to dig deeper into Perl, after having successfully written my first working script :-) I am trying to install modules on my Mac OS X 10.3 Server machine, but I usually end up getting errors like this for the GD

Re: This seems to ease

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 1:28 AM, [EMAIL PROTECTED] wrote: I didn't know List::Util, but I have something done by myself. Probably everyone that don't know this module has one. List::Util is a standard module now and worth a look. perldoc List::Util James -- To unsubscribe, e-mail: [EMAIL

Re: Recommendations?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 2:01 PM, Derek Brinson wrote: Where might I find reference (conceptual) stuff about how to launch a JAVA app via CGI (or vice versa)? Still working it out, but it appears that I may need to get some CGI variables into a JAVA App. Surely this is too difficult to be encapsulated

Re: Pattern Match

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 2:37 PM, Tom Kinzer wrote: Rob, can you explain the details of that replace? That's pretty slick. I see you're adding the hex value to get to the appropriate ASCII value, but didn't know you could do some of that gyration inside a regex. The big secret there is the /e

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so that 2 perl daemons can communicate with each other? How would I go about doing this and are there any

Re: How do I set up bidirectional pipes over a network connection ?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:49 PM, Dan Anderson wrote: You might look at the standard rdist(1) utility for this kind of thing. For crafting network daemons in Perl, Net::Daemon is a good place to start, IMO. What I am trying to do is too complex to successfully implement using a standard utility like

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:40 PM, Dan Anderson wrote: On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 4:12 PM, Dan Anderson wrote: Well, I was planning to implement the file transfers using Net::FTP or something similar to keep the problems down. But I want every node to be able to talk to other nodes, i.e. each node be able to send every other node a request to download a

Re: The True Path to Learning Perl Re: [OT] Education Level

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 9:08 PM, R. Joseph Newton wrote: UML? Isn't that the stuff the once-long-ago-knew-how-to-code professional sycophants use to make pretty pictures for execs, so that the execs can go to bed in the warm contented illusion that they actually understand something about the

Re: removing duplicate lines

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 8:33 PM, Andrew Gaffney wrote: John W. Krahn wrote: Andrew Gaffney wrote: I am writing a Perl script to automatically generate a netlogon.bat file for Samba whenever a user logs onto a domain. The only parameter that is passes to it is the username. My problem is that

Re: passing an array

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 8:49 PM, Mike Blezien wrote: Hello, what is the best way to pass an array to a sub routine, IE. my @fields = qw(one two three); send_array(@fields); sub send_array { my @ary = @_; # do stuff here } is this the most effective way to pass an array to sub routine or is

Re: Using Perl for English Grammar

2003-12-08 Thread James Edward Gray II
On Dec 8, 2003, at 3:33 AM, Jane Langley wrote: Hi there, I am interested in using Perl to generate proper English grammatical sentences from a set list of words and NOT from texts. I was wondering whether there was any Perl code around that I could have a look at, use and be able to manipulate.

Re: This seems to ease

2003-12-08 Thread James Edward Gray II
On Dec 8, 2003, at 9:05 AM, Wiggins d Anconia wrote: I did the 'in' function for seeing if one element is inside on list like. sub in { my $match = shift; foreach (@_) { return 1 if $match eq $_; } return 0; } so I'm calling the function like if(in($x = (1,2,3))) {

Re: Syntax a little funny ....

2003-12-08 Thread James Edward Gray II
On Dec 8, 2003, at 10:52 AM, [EMAIL PROTECTED] wrote: I've just started trying to pick up a little perl. I'm breezing through Learning Perl and reading the perl docs. Here is some syntax I found a little funny, and I was hoping somebody could explain this too me: opendir(DIR, $some_dir) || die

Re: Syntax a little funny ....

2003-12-08 Thread James Edward Gray II
On Dec 8, 2003, at 11:28 AM, Jeff Westman wrote: [EMAIL PROTECTED] wrote: Here is some syntax I found a little funny, and I was hoping somebody could explain this too me: opendir(DIR, $some_dir) || die can't opendir $some_dir: $!; @dots = grep { /^\./ -f $some_dir/$_ } readdir(DIR); closedir

Re: [OT] Education Level

2003-12-07 Thread James Edward Gray II
On Dec 7, 2003, at 11:34 AM, Charles K. Clarkson wrote: Hello, A recent job posting has left me curious. I would never take a full time job as a programmer or as anything else for that matter. I just don't make a good employee any more. Been there. Done that. The job posting demanded a

Re: breaking lines with perl

2003-12-02 Thread James Edward Gray II
On Dec 2, 2003, at 10:44 AM, David T-G wrote: Hi, all -- I have some database sql dumps that look like insert into table (f1,f2,f3) values (v1a,v2a,v3a),(v1b,v2b,v3b),... where of course the insert lines are whopping long. I would like to break these lines at the commas like insert into

Re: network programming?

2003-12-02 Thread James Edward Gray II
On Dec 2, 2003, at 3:22 PM, McMahon, Chris wrote: Hello... Howdy. [snip background] I'd be interested in any descriptions, stories, warnings, links, or snippets about Useful Perl Network Stuff. If it's too OT, feel free to email me off the list. Network Programming with Perl is the

Re: Command line Syntax

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 8:06 AM, Ramprasad A Padmanabhan wrote: There must be a better way but what comes to my mind is echo I am Manish | perl -e 'while(){ s/Manish/Jeff/g ; print $_}' echo I am Manish | perl -pe 's/Manish/Jeff/g' James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 2:02 PM, Kipp, James wrote: Hi I have simple client/server socket scripts that that send some data from the server to the client. It works fine, except the client can't seem to read more than 2920 bytes from the server using sysread(). So the data I am sending over gets cut

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 2:25 PM, Kipp, James wrote: Yes. Calling sysread() gets you what's ready to be read UP TO the amount of data you specify. The rest probably just wasn't available yet. There could be a lot of reasons for this: network lag, operating system buffers, etc. Thanks. I tried

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 2:25 PM, Kipp, James wrote: select(), I was afraid somebody would mention that :) The dreaded select() isn't as scary as it sounds, especially if you use the IO::Select module. If you like books, Network Programming with Perl is superb and covers all this well. Good luck.

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 2:31 PM, Kipp, James wrote: Thanks. I tried turning off buffering on both ends, that did not work. In your example, you only call sysread() once. Is that how you were doing it? If so, that's the mistake. The one call got you part of the data. Then you would loop, check and

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 2:36 PM, drieux wrote: one way simplistic way to try the sysread() approach would be go with something like my $message; my $bytes=1; while ($bytes) { $bytes = sysread(SOCK,$buf,4096); $message .= $buf; #

Re: Can' t read all bytes from Socket

2003-12-01 Thread James Edward Gray II
On Dec 1, 2003, at 3:29 PM, McMahon, Chris wrote: I happened to be working on a TCP/IP server when this hit my desk and having Programming Perl open to the correct page, thought I might as well quote the select... line from the client code... select ((select(Server), $| = 1)[0]; print Server

Re: scalars lists

2003-11-30 Thread James Edward Gray II
Keep your replies on the list and you won't have to wait for me to wake up again for an answer. ;) On Nov 30, 2003, at 4:33 AM, B. Rothstein wrote: thanks for the functions, but for some reason the sort does not seem to be coming out correctly, any idea why? By default, sort() works

Re: scalars lists

2003-11-30 Thread James Edward Gray II
On Nov 30, 2003, at 12:33 PM, B. Rothstein wrote: If I have a scalar variable that itslef is a list of names and numbers, for example $names = 'john 35, jack 18, albert 24, timmy 42'; is it possible, and if so how can it be done to separate the individual names and ages from the list in their

Re: problems with regular expressions

2003-11-29 Thread James Edward Gray II
On Nov 29, 2003, at 1:15 PM, Dan Anderson wrote: I have a regular expression that looks like: $foo =~ s[class.*?=.*?'.*?'][]sgi; We're just looking for spaces with most of those .*?s, right? Why don't we say that. And between quotes we're looking for non-quote characters, right?

Re: scalars lists

2003-11-29 Thread James Edward Gray II
On Nov 30, 2003, at 1:45 AM, B. Rothstein wrote: If I have a scalar variable that itslef is a list of names, for example $names = 'john, jack, albert, timmy; is it possible, and if so how can it be done to separate the individual names from the list in their scalar form in order to create a new

Re: factorial function

2003-11-25 Thread James Edward Gray II
On Nov 26, 2003, at 1:35 AM, B. Rothstein wrote: Does anyone have any suggestions on how to create an array to hold the value of 1000 factorial? I'm afraid I don't understand your question. An array holds multiple values, but 1,000 factorial is a single value. You want an array to hold all

Re: What is Inversion of Control (IoC)

2003-11-24 Thread James Edward Gray II
On Nov 24, 2003, at 5:08 AM, NYIMI Jose (BMB) wrote: Hi Rob, Indeed the question i had in mind while posting was should i care about IoC while developping in Perl ?. Your answer seems to be *no*. I think you're over generalizing here. First, this isn't a Perl issue, specifically, you could ask

Re: Creating uniqueness in complex data structures

2003-11-24 Thread James Edward Gray II
On Nov 23, 2003, at 6:36 PM, Paul Harwood wrote: The log files I am parsing have threads (a T followed by several alphanumeric numbers) associated with each line of text. I want to push each value of $2 (which is a server name) into an anonymous array. This works fine in the following code. if

Re: dereferencing a list from a class

2003-11-22 Thread James Edward Gray II
On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: I've a class (blessed, of course :)) that has variables like: $self-a = 1; $self-b = 2; $self-c = [ '1', '2', '3', '4' ]; I think/hope you meant: $self-{a} = '1';# any reason we're quoting integers? $self-{b} = '2'; $self-{c} = [

Re: perl undef

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 12:54 PM, but however wrote: Hi, there is a clause in perl program which assigns two variables with values from a file. my ($t, undef, $i)=/t: ((\d|\.)+)\s.*?i=((\d|\.)+)/; What does undef mean in the above clause? Using undef on the left side of the assignment like this

Re: perl undef

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 2:10 PM, but however wrote: Hi, James: Hello again. Please keep your replies on the list so we can all learn from and help each other. Thank you very much! Now, I am clear about the question. Do you mean the outmost parenthesis captures the value assigned to variable?

Re: perl plot using

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 2:05 PM, but however wrote: HI, I use the command plot in Perl to draw a graph: I'm not familiar with 'plot', so I'll leave that part of the question for others. But... I am not vey clear with the variables $1 and $2. I did not define them in my file, what are they? $1, $2

Re: Strange characters

2003-11-19 Thread James Edward Gray II
On Nov 19, 2003, at 1:19 AM, [EMAIL PROTECTED] wrote: BTW what does HTH stand for? I see it used in this group a lot! It stands for Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: pagination of dbi results on html browser

2003-11-19 Thread James Edward Gray II
On Nov 18, 2003, at 6:12 AM, A L wrote: ###My background... Well, I had my first encounter with Perl in the Fall of 2000. It was not pretty. Ironically, this was pretty much how my first experience with Perl went, years ago now. I swore I would never touch that crazy rules for the

Re: Printing ASCII to Hex

2003-11-18 Thread James Edward Gray II
On Nov 18, 2003, at 10:33 AM, Jeff Westman wrote: There must be an easier way to convert a basic ascii string to hex. I tried using ord/chr/unpack/sprintf(%x) combinations and just dug my hole deeper. I'm not interested in using any additional modules, just straight, basic perl. This works,

Re: matching query.

2003-11-18 Thread James Edward Gray II
On Nov 18, 2003, at 3:22 PM, Steve Massey wrote: Hi all Howdy. I know this should be easy, but I'm at a loss I want to match Help Help ## match this Helps## not match this I am using syntax below, but it's not working $help = Help; if ($source =~ /^$help/) if ($source eq $help) ...

Re: how do I create self aware functions

2003-11-18 Thread James Edward Gray II
On Nov 18, 2003, at 4:23 PM, Dan Anderson wrote: Is it possible to create self aware functions (possibly using a magic variable)? I.e. functions that know their own name. Sort of the oppossite of bless. You're looking for ref(), but first let me give you the This is often a bad idea warning.

Re: beginners oops module

2003-11-17 Thread James Edward Gray II
On Nov 17, 2003, at 7:47 AM, NYIMI Jose (BMB) wrote: ch3 of Object Oriented Perl book by Conway is free at http://www.manning.com/getpage.html? project=conwayfilename=Chapters.html Great reads ! The rest of the book is excellent as well. I recommend it. James -- To unsubscribe, e-mail:

Re: Perl Equavlent

2003-11-17 Thread James Edward Gray II
On Nov 17, 2003, at 1:24 AM, R. Joseph Newton wrote: Mike Blezien wrote: So if I use the int() this will provide the same results as this ceil() function does... ?? Nope. Same as floor(). If you want to round, use: my $rounded = int ($float_value + 0.5); Please read the rest of the thread

Re: text replacement+

2003-11-17 Thread James Edward Gray II
On Nov 16, 2003, at 10:22 PM, R. Joseph Newton wrote: Kiko Uehara wrote: If my question doesn't have enough information, please let me know. Sure doesn't. The most important information concerning any program is what real-world purpose [even if simulated] it serves. The coding comes later.

Re: matching

2003-11-17 Thread James Edward Gray II
On Nov 17, 2003, at 4:18 PM, Eric Walker wrote: I have the following code to find a quote in a string and replace it with a slashquote. ie goes to \ How do I get it to do more than one substitution in the string. The /g modifier, for global. $_ = $$Rules{$yes}{rule_desc}; s//\\/;

Re: Getting last element of anonymous array

2003-11-15 Thread James Edward Gray II
On Nov 14, 2003, at 12:25 PM, Paul Harwood wrote: $last = ${$server{TED0}}[$#]; Replace $# with -1. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: text replacement+

2003-11-14 Thread James Edward Gray II
On Nov 14, 2003, at 3:57 PM, Kiko Uehara wrote: Hi everyone, Howdy. I have a following data to analyze : - BlockA color 0 0 0 rcolor 1 1 1 dcolor 2 2 2 BloackB color 0 0 0 rcolor 1 1 1 dcolor 2 2 2 (...and so on) - With ya so

Re: text replacement+

2003-11-14 Thread James Edward Gray II
On Nov 14, 2003, at 4:13 PM, James Edward Gray II wrote: my $block; while (IN) { if (/^(Block[A-Z]+)/) { $block = $1; } elsif (/^\s+([rd]?color)/) { my $color = $1; s/\d+ \d+ \d+$/$changes{${block}_$color}/ if exists

Re: writing excel files

2003-11-14 Thread James Edward Gray II
On Nov 14, 2003, at 8:37 PM, Andrew Gaffney wrote: I need to be able to create Microsoft Excel files from a perl script. I want to know which module for doing this that people recommend. I don't need anything too fancy. There will be very little formatting. What formatting I need to do will be

Re: invoking external programs

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 5:26 AM, [EMAIL PROTECTED] wrote: [snip - problem description] If the server successfully performed the command, ctlinnd will exit with a status of zero and print the reply on standard input. If the server could not perform the command (for example, it was told to remove a

Re: Perl Equavlent

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in

Re: Perl Equavlent

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 10:01 AM, Jeff 'japhy' Pinyan wrote: No, int() is neither exactly like ceil() or floor(). All int() does is truncate the number to an integer. If you have 2.3, you get 2. If you have 2.9, you get 2. If you have -2.3, you get -2. If you have -2.9, you get -2. If you were

Re: Perl Equavlent

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 10:17 AM, Mike Blezien wrote: So if I use the int() this will provide the same results as this ceil() function does... ?? No, it's not the same. See the chart earlier in this thread. Sorry for confusing the issue. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Perl Equavlent

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 10:38 AM, Mike Blezien wrote: Hi, so I guess my question is, if I want to accomplish the same results as this ceil how would that be accomplished in Perl ?? Does this one-liner get you started? perl -e 'use POSIX qw(ceil); print ceil(2.3), \n;' James -- To unsubscribe,

Re: Please help!

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 1:14 PM, [EMAIL PROTECTED] wrote: Hi- I'm an absolute beginner to Perl. I need to write a script that will take tables from a SQL server database, somehow get them into HTML format, and automatically generate an email to a list of users containing the info I just

Re: trying again....

2003-11-13 Thread James Edward Gray II
On Nov 13, 2003, at 1:23 PM, [EMAIL PROTECTED] wrote: I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? Perl can definitely do anything you

Re: Accesing hash of hashes

2003-11-12 Thread James Edward Gray II
On Nov 12, 2003, at 11:52 AM, Ravi Malghan wrote: Hello: I am trying to create and access a multidimensional hash. For example the following works == $route {$routeDest} = $cost ; print $routeDest, Cost: $route{$routeDest}\n = But the following does not print the $route{$NODE}{$routeDest}

Re: how do I create a image

2003-11-11 Thread James Edward Gray II
On Nov 11, 2003, at 8:23 AM, Ramprasad A Padmanabhan wrote: Thanks for the info Is there an utility which can do this I am not bothered if it is a very heavy code , I am not going to use it on the fly at run time , I am just going to keep some pregenerated images If you just want to

Re: print values out of a hash

2003-11-11 Thread James Edward Gray II
On Nov 11, 2003, at 1:47 PM, Christiane Nerz wrote: Hi! If I want to print out every value of a hash, what's wrong with doing it like that: foreach (keys %hash) { print $hash{$_}; print \n;} Why do I only get one value??? I don't seen anything wrong with your code. I believe there is

Re: print values out of a hash

2003-11-11 Thread James Edward Gray II
On Nov 11, 2003, at 2:08 PM, Christiane Nerz wrote: Nope - 'cause if I print out the values key for key, I get all four: my $array = keys %hash; print $hash{$array[0]}; print\n; print $hash{$array[1]}; print\n; print $hash{$array[2]}; print\n; print $hash{$array[3]}; With the code foreach (keys

Re: print values out of a hash

2003-11-11 Thread James Edward Gray II
If you would like to post more of your code, I would be happy to take a look at it. James On Nov 11, 2003, at 2:27 PM, Christiane Nerz wrote: jepp - all four are there.. I really don't understand it. thx so far - I have to finish for today - my little baby-son is crying :-( Jane ... As

Re: Died on open command

2003-11-10 Thread James Edward Gray II
On Nov 10, 2003, at 12:39 PM, Guay Jean-Sébastien wrote: It has nothing to do with what ActiveState did or didn't do. The DOS/Windows command interpreter (command.com/cmd.exe) uses '\' as the path separator however the operating system itself is able to use '/' as the path separator. Sorry, I

Re: Died on open command

2003-11-10 Thread James Edward Gray II
On Nov 10, 2003, at 4:19 PM, R. Joseph Newton wrote: Nope. Not at all. System transparency means not having to concern yourself with the system or its quirks, which is what Perl provides in re file access. Not because the '/' separator is 'nix, but because it is more standard for file systems

Re: Died on open command

2003-11-10 Thread James Edward Gray II
On Nov 10, 2003, at 4:47 PM, R. Joseph Newton wrote: Look down the thread, and you will find correction from others, also. I can tell you that I have generated tousands of files in folders reached by relative paths, and all I have had to offer Perl was '/'s. It has been working for some time,

Re: Perl interface

2003-11-09 Thread James Edward Gray II
On Nov 9, 2003, at 11:14 AM, yomna el-tawil wrote: Hi all, i'm a new user for PERL, i even didn't start using it since i'ven't got the editor yet... Any text editor will work. I can't think of a modern OS that doesn't come with one. I wanted to ask if it's possible to make a user friendly

<    1   2   3   4   5   6   7   8   >