Re: (OS=winxp) system cmd dies but performs the command

2004-04-18 Thread R. Joseph Newton
Harry Putnam wrote: > I'm not used to writing perl scripts on windows. I'm having a > problem where a system call dies but still performs the command. > I don't think I understand how exit status is checked. > > my $target = "E:/some_dir/another_dir"; > system("mkdir $target") or die "Can't mkdi

Re: Questions about game design in perl

2004-04-07 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > Morbus Iff wrote: > > > >I am trying to build a game in perl. I have questions. > > >This is a story book game... here is the story, make a choice > > >next page..here is the story, make a choice > > > > I&

Re: Questions about game design in perl

2004-04-07 Thread R. Joseph Newton
Morbus Iff wrote: > >I am trying to build a game in perl. I have questions. > >This is a story book game... here is the story, make a choice > >next page..here is the story, make a choice > > I'd love to see what you come up with. > Games and Perl is close to my heart. WTF does this have t

Re: determining size of array through reference

2004-04-07 Thread R. Joseph Newton
Andrew Gaffney wrote: > david wrote: > > Andrew Gaffney wrote: > > > > > >>I've got an array reference and I'm trying to figure out how many elements > >>are in it. I've tried '$#arrayref', '[EMAIL PROTECTED]', '$(@($arrayref))', and > >>probably a few others that I've forgotten. What is the corre

Re: Regular expression question: non-greedy matches

2004-04-05 Thread R. Joseph Newton
Boris Shor wrote: > Thanks for writing. Hi Boris, Please don't top-post. It makes it very difficult to get the context of your message. Istead, post following the material to which you are responding. > Your code works for this example but doesn't get exactly > what I need. It's important to

Re: Hash ref's of hash's

2004-04-04 Thread R. Joseph Newton
Mark Goland wrote: > John, > this code didn't work for me. Although I did have to change to > ; What code? I see nothing above this to indicate what you are referring to. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regular expression question: non-greedy matches

2004-04-04 Thread R. Joseph Newton
Boris Shor wrote: > Hello, > > Perl beginner here. I am having difficulty with a regular expression > that uses non-greedy matches. Here is a sample code snippet: > > $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; > while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) You have your non-capturing

Re: using strict

2004-04-04 Thread R. Joseph Newton
Paul Johnson wrote: > On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote: > > > Guay Jean-Sébastien wrote: > > > > > > my $errors = 0; > > > open (CRITICALSERVERS, "$crout") || $errors += 2; > > > > > &g

Re: Passing file handles into modules

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Unfourtunately, the code is on an isolated PC. Post again from the machine your script is on, or use some transfer machine to move it to the machine you post from. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: nested parens

2004-04-04 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > JupiterHost.Net <[EMAIL PROTECTED]> wrote: > : > : [EMAIL PROTECTED] wrote: > : > Is there a module out there that I can use to parse > : > a text line and return the pieces that are enclosed > : > in paren's? > : > : You don't need a module for that just use regex's

Re: Using $_ in a function if no argument is passed

2004-04-04 Thread R. Joseph Newton
Paul Johnson wrote: > On Sat, Apr 03, 2004 at 11:53:59AM -0800, R. Joseph Newton wrote: > > > Paul Johnson wrote: > > > > > $_ = "Leave me alone!"; > > > $s = "0"; > > > > Better yet: > > $lower_or-mixed_case_string = &#x

Re: Help with pattern matching

2004-04-04 Thread R. Joseph Newton
A Lukaszewski wrote: > Greetings all, > > I have a comma-delimited lexical file with four fields: line number, the > first part of a word, the second part of a word, and the word combined. > The first and fourth fields are only for reference. The program I am > developing is very simple. If fi

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: > > There is no problem syntactically. But there is a problem with the > precdence. If you ever have another operation on either the left or right > side of the || operator, the || operator will bind tighter than the other > operation. So for example, if you do: > > my $

Re: using strict

2004-04-04 Thread R. Joseph Newton
david wrote: > Guay Jean-Sébastien wrote: > > > >> open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!"; > > > > As I said, you should replace || by or in the above line. See the > > precedence rules in "perldoc perlop" for details. > > > > why do you think so? is there any problem in

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: > Hello Derek, > > > Guay, > > Err, my first name is Jean-Sebastien. Hi Jean-Sebastien, > My last name is Guay. French-language > people have a bad habit to put the last name first, as in "Guay, > Jean-Sebastien"... So I understand why this is a bit confusing. Thanks

Re: using strict

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Yet another great explanation.. What explanation? I see niothing above this. Please do not top-post when posting to this list. Instead, follow the material to which you are directly responding with your response, then trim any extraneous material. Most of us keep re

Re: New to Perl

2004-04-03 Thread R. Joseph Newton
Oliver Schnarchendorf wrote: > On Fri, 2 Apr 2004 12:19:32 -0800 , Bajaria, Praful wrote: > > However, when I print > > print "content $request->content \n"; I get "content > > HTTP::Request=HASH(0x8546b3c)->content" > > and print "$response->message \n"; give me "message > > HTTP::Response=HASH(0

Re: New to Perl

2004-04-03 Thread R. Joseph Newton
"John W. Krahn" wrote: > > 1 or greater > > -1 or less A pox on both your houses: ;-o) Greetings! E:\d_drive\perlStuff>perl -w my $test = .1; print (($test ? $test : 'false'), "\n"); ^Z 1e-005 Greetings! E:\d_drive\perlStuff>perl -w my $test = -.1; print (($test ? $test : 'false'), "\n

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread R. Joseph Newton
Paul Johnson wrote: > > $_ = "Leave me alone!"; > $s = "0"; Better yet: $lower_or-mixed_case_string = 'o'; > to_upper $lower_or-mixed_case_string; With intelligent use of the editing facilities available, extra characters do not cost much. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread R. Joseph Newton
"JupiterHost.Net" wrote: > Hello List, > > It just occurred to me that many Perl functions use $_ if not other > value is supplied. chomp for instance..., which is very handy... Yes. Like the peaceful feeling that comes the first time one shoots up junk. > If one wanted to write a function that

Re: Basic question

2004-04-03 Thread R. Joseph Newton
"Kumar, Praveen (cahoot)" wrote: > Hello, Hi Praveen.K [Is that what your friends call you in conversation?] > >I am completely new to perl, and i am trying to write a small > script, which based on the input given displays the value in an array. But > when i try to execute the scri

Re: Is this possible? (file handles)

2004-04-02 Thread R. Joseph Newton
Jeff Westman wrote: > This doesn't answer my question. Okay > I wanted to know if it is > possible to remove a file using the FH name, not the variable name > referencing it. No. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Timezone conversion

2004-04-02 Thread R. Joseph Newton
Distribution Lists wrote: > can someone give me ideas of how I could covert this date and time stamp > that is in GMT to Central time ? > > 2004-04-01-19:15:15.525+00:00 > > Thanks Yes. You can. Look at a map of time zones, or check the offest on any message that is dataed by central time, and

Re: Sorting Problems

2004-03-30 Thread R. Joseph Newton
Nigel Peck - MIS Web Design wrote: > Hi all, > > I'm sure I'm just being stupid here but I can't see where: > > I have an array of hash references that I'm trying to sort by one of the > key/value pairs in the hashes (see code below). > > I get various errors, the current one being: > > Can't coer

Re: What is happening here

2004-03-30 Thread R. Joseph Newton
Jeff 'japhy' Pinyan wrote: > On Mar 30, WC -Sx- Jones said: > > >my $count; > > > >while(1) { > > (++$count) ? $count += $count-- : $count += $count++; > > > > print "$count\n"; exit if $count > 60_000; > > sleep 1; > >} > > The main problem is the PRECEDENCE. Your ? : line is run like so:

Re: What is happening here

2004-03-30 Thread R. Joseph Newton
WC -Sx- Jones wrote: > WC -Sx- Jones wrote: > > What is happening here - > > while(1) { > > (++$count) ? $count += $count-- : $count += $count++; > > > > :) May I ask a different way? > > #! /usr/bin/perl > use strict; > use warnings; > > my $count; > my $str; > > while(1) { >(++$count) ? $c

Re: Execute include and return variables

2004-03-30 Thread R. Joseph Newton
Tomas Corral wrote: > Hi all: Hi Tomas, Please start a new message to the group when you have a new subject. Your message was lost in a thread concerning Network Shiffer Modules. > > > I cannot include a file so it can return all the variables I assigned. > > #FILE1.pl > $var1= "tom"; > > #FIL

Re: Execute include and return variables

2004-03-30 Thread R. Joseph Newton
Alok Bhatt wrote: > > Hi all: > Hi Tomas, > > I cannot include a file so it can return all the > > variables I assigned. > > #FILE1.pl > > $var1= "tom"; > > #FILE2.pl > > do FILE1.pl > > #open $prog,'FILE1.pl' or die $!, > > #use 'FILE1.pl' > > #import 'FILE1.pl' > > In FIle2: > do "FILE1.pl" (us

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
Tim Johnson wrote: > Apparently (++$count) evaluates to 0, but I can't figure out why. Nope. Always true. It just doesn'yt matter. Bill sorta threw us a red herring here. Seeing the conditiional operator distracts your attention to thinking about the product of the conditional, which is not

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > Andrew Gaffney wrote: > > > WC -Sx- Jones wrote: > > > What is happening here - > > That is a damn good question. I'm not sure what results I was expecting when I ran > > it, but > > it sure wasn't this:

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
Andrew Gaffney wrote: > WC -Sx- Jones wrote: > > What is happening here - > > > > #! /usr/bin/perl > > use strict; > > use warnings; > > > > my $count; > > > > while(1) { > > (++$count) ? $count += $count-- : $count += $count++; > > > > print "$count\n"; exit if $count > 60_000; > > sleep 1;

Re: Incrementing count

2004-03-29 Thread R. Joseph Newton
Smoot Carl-Mitchell wrote: Hi Carl-Mitchell, Please stay on the list. I will address that. > I'll take this offline, since I do not think it should be on the list I disagree. With all due respect, you and I have not developed a personal correspondence. There are some very good reasons for th

Re: File content question

2004-03-29 Thread R. Joseph Newton
"Sagar, Sanjeev" wrote: > Big Thanks ! > > My log file looks like below Would be better with multiple sections, and only a few representative line per... > 2004-03-26 @ 00:00:01 [EMAIL PROTECTED] -- 10881 10864 hyb01 > :INFORMATIONAL > ... > Script/function sql_instance_ping_final started at F

Re: `next LABEL' usage

2004-03-29 Thread R. Joseph Newton
Harry Putnam wrote: > "Charles K. Clarkson" <[EMAIL PROTECTED]> writes: > > > HTH, > > Definitely and thanks for the examples. I think I was making this > more complicated that it needed to be. It's slowly sinking in what > all a `return' can do. Hi Harry, Glad Charles got you squared away. I

Re: Incrementing count

2004-03-29 Thread R. Joseph Newton
Smoot Carl-Mitchell wrote: > This is not what the poster asked. Actually, yes it is, at least part of it. He said "would I increment by 20?... $counter would increment 1 time for every twenty lines of the file?" > This will increment the counter by 20 > for every line of the file. Read without

Re: Incrementing count

2004-03-29 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > I'm sorry, the previous subject should have been changed. My apologies. > > while () { >$counter++; > } > > I know this is probably simple, but how would I increment by 20? In other > words, $counter would increment 1 time for every twenty lines of the file? Any >

Re: date math

2004-03-28 Thread R. Joseph Newton
Andrew Gaffney wrote: > > My code ended up looking like: use strict; use warnings; use constant PAY_PERIOD_DAYS => 14; > > > my @payperiods; Underscores are both permissible and advisable in variable names: my @pay_periods; > > my @finalpayperiods; > my $lastperiodend = Date::Simple->new('2004

Re: warn ?!

2004-03-28 Thread R. Joseph Newton
"Randy W. Sims" wrote: > #!/usr/bin/perl > > package NumStr; This makes sense to me. As a package, it makes sense to have overloaded operations. This is why I was asking if the value was really stored as a number. > use strict; > ... > printf("as number = '%d', as string = '%s'\n", $ns, $ns);

Re: Passing file name /filehandle as argument to a subroutine...

2004-03-27 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > Better not to use the newline at the end. You get more information if you just: > > open(MIBFH,$file) or die "Error opening the $file$!"; Should be: open(MIBFH,$file) or die "Error opening the $file: $!"; Sorry, Jose

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Harry Putnam wrote: > > Its going very steady... That is, I've never used a reference... : ) What can I say? You've got to take the step, if you want to get there. You will have plenty of help. Until you get these basic structuring skills down you are severely limited in the scope of tasks

Re: warn ?!

2004-03-27 Thread R. Joseph Newton
"Randy W. Sims" wrote: > James Edward Gray II wrote: > > > Fact: This has nothing to do with ANY variables, it is the way warn() > > is designed. > > Trivia: > > Did you know that $! does NOT contain an error string. It contains the > error *number*. The only reason you see a error sting is that

Re: Passing file name /filehandle as argument to a subroutine...

2004-03-27 Thread R. Joseph Newton
urvashi mishra wrote: > hi; > > i am trying to take input from multiple files > Various I/P files are specified at command line... What is an I/P file? Do you mean an input file? > Can anyone tell me how to pass the file name to a > routine that opens it for parsing > > the same functi

Re: warn ?!

2004-03-27 Thread R. Joseph Newton
James Edward Gray II wrote: > On Mar 27, 2004, at 1:32 PM, R. Joseph Newton wrote: > > > It seems pretty clear to me, that although modular in their function, > > these Perl > > built-in variables were precisely designed to work with the warn and > > die >

Re: HOW-TO of the Month Club (end Of MARCH Edition)

2004-03-27 Thread R. Joseph Newton
WC -Sx- Jones wrote: > James Edward Gray II wrote: > > 1. You show a means of variable declaration that you say replaces my() > > when in fact it's equivalent to our(). > > > > 2. Your use of local() is scary at best. It looks like a step > > backwards in Perl history to me. local() is pretty

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Smoot Carl-Mitchell wrote: > > Actually, I'm pretty sure it is only the Received header that would > > ever show more than once in the main header of a message. > > Read the relevant RFCs for mail message standards. I'd start with > RFC2822 and work forward from there. This is definitely a good i

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Harry Putnam wrote: > Yes, I see now. > > I think I may not have understood the meaning of `global'. I > understood it to mean these variables could theoretically be exported > as in the case of `do "./this_script"; from another script. > > I was under the impression that a `my($var);' at the beg

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > Ooops > ... At a time when I had 13, 038 message in a > given mailbox, should be ... At a time when I had 13, 1398 message in a given mailbox, Which makes the following more meaningful: > these were the only header items to appear in exactl

Re: sorting AoA [was the subject]

2004-03-27 Thread R. Joseph Newton
WC -Sx- Jones wrote: > John W. Krahn wrote: > >>replying) so James can take ownership of those parts of > >>this thread. > > > > > > Not under most country's copyright laws he can't. :-( > > LOL :) > > I'd like to see that erroneous verbage - as words, > expressed as thoughts and ideas in the di

Re: sorting AoA

2004-03-27 Thread R. Joseph Newton
"N, Guruguhan (GEAE, Foreign National, EACOE)" wrote: > [Implementation stuff snipped] > > Can some one tell me how do I this? Well, if you tellus what you want as output, we could maybe start. Hint--if you really have production code with variable names like @array1, @array2, etc., the best

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Harry Putnam wrote: > ... I'm having trouble seeing what is shorter or > better about this. > > : sub test_hdr_good { I count 13 characters in test_hdr_good header_is_good { has 15 characters. For the price of two characters, you can => indicate the type of information [boolean] returned. If

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Harry Putnam wrote: > > I think Joseph was implying the 'chomp'. This is > > still shorter and IMO clearer than using $_. > > > > while ( my $line = ) { > > chomp $line; > > I hope it doesn't sound like I'm being a hard head... because at my > stage of skill I'm not likely to st

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > Harry Putnam <[EMAIL PROTECTED]> wrote: > : > : "R. Joseph Newton" <[EMAIL PROTECTED]> writes: > : > : > > Something like: > : > > [...] snipped getopts and other unrelated stuff > : >

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
Harry Putnam wrote: > >> Something like: > >> [...] snipped getopts and other unrelated stuff > >> while(){ > >> chomp; > >> my $line = $_; > > > > Why here. Since you are doing this with each line, you could write in the loop > > control: > > while (my $line = ) { > >

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread R. Joseph Newton
"Randy W. Sims" wrote: > On 3/27/2004 2:23 AM, R. Joseph Newton wrote: > > These lines should probably be going into a hash, > > keyed to the portion of the line before the colon. > > Don't forget that some header fields can appear more than once. > > Re

Re: warn ?!

2004-03-27 Thread R. Joseph Newton
James Edward Gray II wrote: > On Mar 27, 2004, at 12:10 AM, R. Joseph Newton wrote: > > > Not exactly. It is not the newline "\n" that would give the full > > output of the > > warn function, but the $! variable, which contains the most recent > > warning

Re: Home made mail news search tool, and folded header lines

2004-03-26 Thread R. Joseph Newton
Harry Putnam wrote: > I'm writing a home boy mail/news search tool and wondered if there is > a cononical way to handle folded or indented header lines. > > An example would be that I wanted to run a series of regex against each > line of input (While in headers) grabing the matches into an array

Re: warn ?!

2004-03-26 Thread R. Joseph Newton
Alok Bhatt wrote: > > Hi Jai, Hi Alok, Please don't top-post. Instead, follow the material you are responding to, and trim extraneous matter. > > > But the waring message output line 37 is > > different(just behaves as print) from same kind of > > message at line 57. Any suggestions pleas

Re: Playing with Unicode

2004-03-25 Thread R. Joseph Newton
James Edward Gray II wrote: > Why when I run this one-liner: > > perl -e 'print "\x{2660}\n"' > > do I see this: > > Wide character in print at -e line 1. Makes sense. 2660 would overflow a one-byte character. > > > I'm assuming that's a warning, since I still get the expected output, > but why

Re: Hash Help Needed !

2004-03-25 Thread R. Joseph Newton
"Normandin, Jason" wrote: > Hi > > I am scoping the %response_values hash at the top. I dont understand why it > would need to be temporary as I am referancing that hash outside of the loop > when I iterate through. > > I changed the syntax to referance the oids rather then the hash name and I >

Re: Hash Help Needed !

2004-03-25 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > foreach my $response ($record->{keys %response_values} ) What is this? It looks like you are trying to use a list as a hash key. I don't think that is going to work. A hash element should take a scalar as its key, not a list: Greetings! C:\Documen

Re: $dbh->do('\@proc')

2004-03-23 Thread R. Joseph Newton
Jayakumar Rajagopal wrote: > Hi all, >I have to use PERL to run ".sql" files No you don't. When I was in Oracle class, nobody even knew what Perl was, and we ran scripts directly at the prompt. I think you are getting your interfaces mixed up here. Perl is called from a shell of the

Re: problem conencting to oracle after upgrading to oracle 9i

2004-03-23 Thread R. Joseph Newton
"Nilay Puri, Noida" wrote: > Hi All, > > On sparc m/c SUN OS 5.8 , I have recently upgraded from Oracle 8i to Oracle > 9i. > > ANd I had DBD:Oracle 1.12 installed on it. > > Now the perl files give error : > DBI->connect(hemdadev) failed: ERROR OCIEnvInit at test.pl line 18 > > And at line 17 I ha

Re: returning hashes, and arrays

2004-03-22 Thread R. Joseph Newton
Stuart White wrote: > I'm trying to decide if I want to take a break from > this specific task and get into the examples of > subroutines and references in my book. On the one > hand, that should give me a much better grip on them, > but on the other, that's time spent that I could be > using to

Re: returning hashes, and arrays

2004-03-22 Thread R. Joseph Newton
Stuart White wrote: > > > You might want to depend on the documentation that comes with > > perl more than the book you are using. 'perlfunc' has a listing of > > almost all the the functions you'll see here. Perldoc.com has > > handy html documentation for the major versions of perl. 'Perlsub

Re: returning hashes, and arrays

2004-03-22 Thread R. Joseph Newton
Stuart White wrote: > I've tried this the only way I know how, which is to > declare the subs with the number of arguments they are > to take, and I believe the type of argument they are > to output (like you might see in a C program), and > then created my variables within the sub. Two things

Re: returning hashes, and arrays

2004-03-22 Thread R. Joseph Newton
Stuart White wrote: > Here's 25 lines of sample input: > -- > Spurs 94, Suns 82 > 4/29/2003 SBC Center, San Antonio, TX > Officials: #16 Ted Bernhardt , #33 Sean Corbin , #15 > Bennett Salvatore > 1st Period ... > (11:23) [SAN 2-0] Bowen Jump Shot: Made (2 PTS) > Assist: Parker

Re: returning hashes, and arrays

2004-03-21 Thread R. Joseph Newton
Stuart White wrote: > I'm having trouble returning a hash from a subroutine, > and an array from a different subroutine. "Beginning > Perl" said I could return a list, I can't get it to > work. Must the hash and array really be a reference > to the hash and array in order to return them? In bri

Re: FW: Installing module.

2004-03-21 Thread R. Joseph Newton
"Nilay Puri, Noida" wrote: > I am installing on sun os. > perl versions is 5.8 > > While installing GD 1.19 module. > I got error on running "make test" : > > make[1]: Leaving directory `/nilay/tars/GD-1.19/libgd' > PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harne

Re: extracting data from table embedded in Word document

2004-03-21 Thread R. Joseph Newton
Andrew Gaffney wrote: > > The above code won't work because it splits on a comma. A lot of the fields contain a > comma somewhere within the actual data. If it was easy as that, I would have had > this done > long ago ;) > > -- > Andrew Gaffney Hi Andrew, Don't count on it not being that easy.

Re: extracting data from table embedded in Word document

2004-03-20 Thread R. Joseph Newton
Andrew Gaffney wrote: > I'm writing a web-based client information system for a lawyer. [OT} Eek!! Be very, very careful about security, please. I trust your employer has taken "duty of care" isuues into account. [/OT] > His current client list is > in a 137 page Word document with an embedde

Re: Brain stuck on forming a hash

2004-03-19 Thread R. Joseph Newton
Chris Zimmerman wrote: > Obviously I am a beginner, so bear with me: > > I have an array, @customers, that has a list of names. For each > customer I need to read in a config file, $cust.morestuff.cfg which is > formatted: > > Filename-mask Upload Name Hostname > X-Type

Re: not getting the syntax

2004-03-14 Thread R. Joseph Newton
James Edward Gray II wrote: > On Mar 13, 2004, at 12:36 AM, R. Joseph Newton wrote: > > > Charlotte Hee wrote: > > > >> $byname{ Owen }{ PHONE } = '999-'; > > > > Should be: > > $byname{ Owen }->{ PHONE } = '999-'; >

Re: Improving performance when working with large text files

2004-03-14 Thread R. Joseph Newton
James Edward Gray II wrote: > On Mar 13, 2004, at 1:09 PM, R. Joseph Newton wrote: > > > "West, William M" wrote: > > > > > >> by slurping the WHOLE file into memory at once (do you have room to > >> but a 45 > >> megabyte file into

Re: help with a regex and greediness

2004-03-13 Thread R. Joseph Newton
Stuart White wrote: > the file format is not sloppy at all. I was just > confused as to why I couldn't use split on the first > space score comma and space, and then the next space > score. <-Perhaps I just answered my question right > there, seeing that in the second iteration, there is > no c

Re: help with a regex and greediness

2004-03-13 Thread R. Joseph Newton
Stuart White wrote: > $line = > "merlyn::118:10:Randal:/home/merlyn?/usr/bin/perl"; > @fields = s;oit(/:/,$line); > #now @fields is ("merlyn:, > "","118","10","Randal","/home/merlyn","/usr/bin/perl") I don't think so: Greetings! E:\d_drive\perlStuff>perl -w $line = "merlyn::118:10:Randal:/ho

Re: Read from tape device

2004-03-13 Thread R. Joseph Newton
Jakob Kofoed wrote: > Hi again, Hi, > Sorry for the delayed answer. Tha's okay, but please don't top-post. Instead trim out anything to which you are noit directly replying, and follow comments with your specific responses, then add anything new in a block following. It helps to keep the flo

Re: Improving performance when working with large text files

2004-03-13 Thread R. Joseph Newton
"West, William M" wrote: > by slurping the WHOLE file into memory at once (do you have room to but a 45 > megabyte file into memory?) the speed of the processing went up- Highly unlikely. There is no real speed advantage with Perl in slurping a file. The only good reason I can think of is if

Re: second-level string interpolation

2004-03-13 Thread R. Joseph Newton
"Michael C. Davis" wrote: > Hi, Apologies if I'm bringing up a repeated topic. I searched the list > archive and the web and nothing specific has turned up so far. > > Is there a way to defer evaluation of the contents of a here-doc-defined > value such that one can embed variables in the here-d

Re: FW: Win32::AdminMisc

2004-03-12 Thread R. Joseph Newton
"Meneses, Alden" wrote: > Was able to download from www.roth.net Please don't top-post. Better to PPM for it. That tool is built into the ActiveState distribution. You might wish to add a couple sites to the repository: rep add Jenda http://Jenda.Krynicky.cz/perl rep add Roth http://www.roth.n

Re: not getting the syntax

2004-03-12 Thread R. Joseph Newton
Charlotte Hee wrote: > > For a single record I can see how that works but let's say I have > 4 or 5 employees and I have the employee information for each one > (assumed). Now I want to build a record for each employee in a loop like > this: > > @names = ('Jason','Aria','Samir','Owen'); > > fo

Re: help with a regex and greediness

2004-03-12 Thread R. Joseph Newton
Stuart White wrote: > Wow, yeah that helps a lot. > Here's a question: If if had: > $line = 'Spurs 94, Suns 82, Heat 99, Magic 74' > and then did a split on comma and comma's surrounding > spaces: > @result = split (/\s*,\s*/, $line); result? How specific is "result" to the issue at hand? Woul

Re: can somebody tell me what this means

2004-03-12 Thread R. Joseph Newton
sam lehman wrote: > so would: > something ? dosomething : somethingelse ? dosomethingelse : killyourself > be the same as Let's not go there--at least not yet. NOt that I object to suicide particularly, y'know "dff'runt strokes fer diff'runt folks" an' all, but nesting conditionals before you h

Re: Reading text file in reverse order

2004-03-12 Thread R. Joseph Newton
"John W. Krahn" wrote: > [EMAIL PROTECTED] wrote: > > > > I have a text file with 5 or more lines as in: > > > > My name is this and that > > I live in Denver Colorado > > I live in washington > > I live in Denver Virginia > > > > I am trying to read this file and print each line and each word in

Re: Reading text file in reverse order

2004-03-12 Thread R. Joseph Newton
Mame Mbodji wrote: > This is a hwk, but I never asked for a complete answer 1. The term "homework" refers to something fluid, rather than discrete, and therefore does not take an article ['a' or 'the'] 2. Please do not abbreviate words, unless the abbreviation is a very standard one. I wasted

Re: Some java some perl

2004-03-11 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > I'm doing one interface in java that will call some perl scripts. I need to > catch the output and I don't know how to do it. > > If I execute the 'ls' command my java program finnish if I call the perl my > program don't finnish. What am I missing? What are you expecti

Re: backreferences

2004-03-10 Thread R. Joseph Newton
Stuart White wrote: > Geez, I can't recall them covering (?: ) in my > books...D'oh! The part about it grouping and > capturing things makes sense, as it's the "cousin" of > ( ). The part about being able to include the |'s > doesn't. I found out, without knowing at the time, > that the parent

Re: sorting hash list for CGI Form

2004-03-09 Thread R. Joseph Newton
Scott Taylor wrote: > Hello all, > > When I populate this hash (%SrcIDs) from "SELECT id, desc, from myTable > order by desc" it What does "it" refer to here? If you mean the SQL engine, which does care about the content of order clauses, you are mistaken. Your data set is returned in the prope

Re: Read from tape device

2004-03-09 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Hi All, > > I am trying to read some data from af unix tape device. The have several files with > "end of file markers". Can I read from tape devices at all? > > I tried "open" on the device and this one reads all files on the tape into the first > file and then hangs.

Re: Install Storable - ActiveState 5.6 Bld 623

2004-03-09 Thread R. Joseph Newton
Clinton James wrote: > Hi > ActiveState's documentation says Storable is in the Core. It's not in mine. Are you sure? Have you tried: Your_prompt> perldoc Storable at the command line? If the documentation is there, the functionality probably is also. You can also make at least a quick and di

Re: Browser-specific perl error (taint mode)

2004-03-08 Thread R. Joseph Newton
Erik Rieselbach wrote: > Hi, > > Can anyone explain to me why I would get a perl error in one web browser but > not in any others? This depends on on alot of factors, few of which you are sharing.Generally, perl errors should not come through to the browser. IIS does pass error messages through

Re: how big is my data structure

2004-03-08 Thread R. Joseph Newton
"Michael C. Davis" wrote: > Hi, is there a good way to tell how much memory a given data structure is > consuming? I realize that there are issues in using this number to > determine runtime memory requirements (like the fact that, in some > circumstances, a running Perl process does not give bac

Re: how big is my data structure

2004-03-08 Thread R. Joseph Newton
WC -Sx- Jones wrote: > Michael C. Davis wrote: > > Hi, is there a good way to tell how much memory a given data structure is > > consuming? I realize that there are issues in using this number to > > determine runtime memory requirements (like the fact that, in some > > circumstances, a running P

Re: comparing a string to elements of an array

2004-03-08 Thread R. Joseph Newton
Stuart White wrote: > > > In the end, I want @SAN to have all the unique > > names > > > within the file. Any ideas? > > You just described a Hash. Use %hash and then > > either uppercase or lowercase the the incoming key. > > YOu could then add a count to the Hash so you know > > you are l

Re: HERE DOCUMENTS and teachable moments

2004-03-08 Thread R. Joseph Newton
WC -Sx- Jones wrote: > Serguei Krivov wrote: > > Bill, > > > > Would it not be better to post (copy) this message and the following postings to > > perl.tips oriented for beginners (like me) > > > > http://www.nntp.perl.org/group/perl.tips > > > > Later it is going to be much easier to search per

Re: listing prime numbers in a range (Beginning Perl exercise)

2004-03-07 Thread R. Joseph Newton
Stuart White wrote: > This was my first chance at testing this, and it did > work. How, I'm not sure though. > Specifically: > > What do you call the "PRIMES:" and "__END___" syntax? The two are not directly related. The way PRIMES is used here makes it a label. This allows rapid, uncomplicate

Re: Passing array as First argument

2004-03-07 Thread R. Joseph Newton
zsdc wrote: > Mallik wrote: > > > Dear Friends, > > > > I need to pass 3 parameters to a subroutine, in which the > > first parameter is an array and the last two parameters > > are strings. > > > > @abc = qw(1 2 3); > > $x = 4; > > $y = 5; > > > > testsub(@abc, $x, $y); > > Hello Mallik, > > I've

Re: Passing array as First argument

2004-03-06 Thread R. Joseph Newton
William Gunther wrote: > > If a beginner can understand the concept > of prototyping and referencing, I think they can gather an array > reference is being passed. Actually no. I have not seen this in the last year of reading this list. The vast majority of newbie traffic that i have seen amo

Re: Reading File & grep according item 5 and sorting

2004-03-06 Thread R. Joseph Newton
Bjorn Van Blanckenberg wrote: > On 3-mrt-04, at 09:56, R. Joseph Newton wrote: > > > I understand how the code works > > It reads the file end split every line according to the tabs and then > sorts everything. > For returning the info it looks at colomn 5 (1-based indexi

Re: Checking filenames? [:: ?Kinda Solved? ::]

2004-03-06 Thread R. Joseph Newton
WC -Sx- Jones wrote: > Hmmm, I get 3 Indians in only the first variable anyways =/ Doesn't surprise me. The x is a concatentation multiplierfor strings. Why not just say what you want: $_ = 'Litttle' for my ($onelittle, $twolittle, $threelittle, ) ; print "1 $onelittl

Re: Passing array as First argument

2004-03-05 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > In a message dated 3/3/2004 5:15:57 AM Eastern Standard Time, > [EMAIL PROTECTED] writes: > >testsub(@abc, $x, $y); > > > >sub testsub(@$$) > >{ > >(@abc, $x, $y) = @_; > >print "Array @abc\n"; > >print "x $x\n"; > >print "y $y\n"; > >} > > sub testsub ([

  1   2   3   4   5   6   7   8   9   10   >