Re: newbie bash questions

2002-11-17 Thread Christopher Solomon
On 17 Nov 2002, Steve wrote: Hi everyone, for some reason I can't seem to do basic math in this bash script I'm creating for a class I'm taking. Here's my code #!/bin/bash isec=`date +%s` thisec=$isec*$isec-$isec I'm just getting the date in seconds, then trying to get a sort of random

Re: Write hash of hashes to disk?

2002-11-15 Thread Christopher Solomon
On 15 Nov 2002, Matt Simonsen wrote: I've tried using DB_File open a hash and write a hash of hashes to disk, but this failed. I read in Perl Cookbook to just use it as a regular hash but from what I can tell this is not possible when speaking of complex structures like a hash of hashes.

Re: How to download WebPage source??

2002-11-02 Thread Christopher Solomon
On Sat, 2 Nov 2002, montana wrote: I know this is simple and I'm probably overlooking something in the tutorial. How do I get perl to download the source code of a webpage so that I can do some parsing and other things to the text? Try: use LWP::Simple; my $contents =

Re: it works but is this right

2002-06-11 Thread Christopher Solomon
On Tue, 11 Jun 2002, A Taylor wrote: snip $rank = $sth1-fetchrow_array(); Now, my question is this: is this the right way to retreive just 1 record, using fetchrow_array(); ??? or is there a more acceptable way. This does work, its just the 'array()' part is making me a little uneasy.

Re: Array question

2002-02-12 Thread Christopher Solomon
On Tue, 12 Feb 2002, Kevin Butters wrote: Beginner question: .. I have an array that I want to insert elements into. I want to insert elements at specific points in the array. Example: use strict: @week = (Monday, Wednesday, Friday); I want to expand the array to include

is Shell.pm deprecated?

2002-02-07 Thread Christopher Solomon
Whenever I've had to execute system or shell commands, I use the backtick operator, the system command, or filehandle half-pipes (or whatever they are called :). And I've always seen these recommended whenever someone asks how to do that. But recently, I saw the use of the Shell.pm module:

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Christopher Solomon
%ignore = map { $_ = 1 } @ignore; @diff = map { $a{$_} ne $b{$_} } grep { !$ignore{$_} } keys %a; @diff will end up with a list of key/value pairs of %a that are different from %b, excluding those of %ignore. note: this is untested. Chris On 7 Feb 2002, Chas Owens wrote: I have

Re: Not your average system() question...

2002-02-06 Thread Christopher Solomon
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: I understand how the system command works. I understand the difference between system() and backticks. My question is this: I want to make a call to an external program and I want the output printed to the command line as it is processing, BUT, I

Re: 'exists' error

2002-01-30 Thread Christopher Solomon
I'm not well versed on the versions of Perl, but I don't think that was a particularly bug-free version. I would recommend upgrading to at least 5.005_03 Chris On Wed, 30 Jan 2002, Nikola Janceski wrote: I have two versions of perl (5.004_04, and 5.6.1) it seems the older one doesn't

RE: array and hash assignment

2002-01-18 Thread Christopher Solomon
On Fri, 18 Jan 2002, [iso-8859-1] amrit kumar wrote: hi, what i want to proove is...supposer that i assign an array @a = (1,2); and then i define another array @b which is equal to @a.I have to proove that this is done by assigning a copy of array @a to @b rather than by reference.

Re: Greedy 'split' ???

2002-01-16 Thread Christopher Solomon
On Wed, 16 Jan 2002, Scott Lutz wrote: $DOM_NAME, my $TLD) = split(/\./, $domain); creates two variable out of an inputted domain name, until this comes along: domainname.org.uk which it interprets as : $DOM_NAME = domainname $TLD = org so is it possible to do a

Re: mail

2002-01-11 Thread Christopher Solomon
On Fri, 11 Jan 2002, Pieter Blaauw wrote: Hi guys How would I do the following. Platform is a Red Hat 7.2 Linux box with Pine 4.44 as my mail client. Now pine stores all your mail in the usual /var/spool/mail/username Can I use perl to extract all the mail from 2001 into another big file

Re: regex for shared object files

2002-01-10 Thread Christopher Solomon
On Thu, 10 Jan 2002, zentara wrote: Hi, I'm trying to find all .so.xxx files on my system. Eventually I want to do things with them, but for now I just want to identify them. I pretty much have it, except I'm lacking enough regex knowledge to separate out the so from the .so. files.

Re: regex for shared object files

2002-01-10 Thread Christopher Solomon
On Thu, 10 Jan 2002, Christopher Solomon wrote: On Thu, 10 Jan 2002, zentara wrote: Hi, I'm trying to find all .so.xxx files on my system. Eventually I want to do things with them, but for now I just want to identify them. I pretty much have it, except I'm lacking enough regex

Re: How to change perl form-processing script for Windows NT server?

2002-01-09 Thread Christopher Solomon
On Wed, 9 Jan 2002, Rohesia Hamilton wrote: Hello, I have recently finished my first perl script, which processes a form, returns an html thank you page to the submitter, sends them a confirmation email, sends the company (whose website the form is for) an email and appends the contents

Re: use or require?

2002-01-04 Thread Christopher Solomon
On Fri, 4 Jan 2002, Connie Chan wrote: I 've read some doc about the difference of require and use... but I don't know what exactly that all means ?... what is run time and what is compile time ? all I hope to know is. which one will be faster and cost the minium loading vs time to the

Re: Hello make tabled form

2002-01-03 Thread Christopher Solomon
On Thu, 3 Jan 2002, Naeemah Small wrote: I am creating a table form. The reason why, is because I want it to be neat. I am using CGI.pm This is my first time making a form in perl. How do I do it. read all about it with the command: perldoc CGI or search the web-

Re: Perl installation problem

2002-01-03 Thread Christopher Solomon
On Thu, 3 Jan 2002, ROry O'Connor wrote: I'm running perl 5.6.0 that was installed when i installed redhat 7.2. I tried to install a few extra modules with CPAN and it also tried to upgrade me to 5.6.1, but for some reason could not complete. I can't really tell what's going on, but some

Re: newbie question

2002-01-03 Thread Christopher Solomon
On Thu, 3 Jan 2002, Pam Derks wrote: I've been trying to understand program 6.21 in the Perl Cookbook, which changes URLs to html links here's a snippet: #!/usr/bin/perl $urls = '{http|telnet|gopher|file|wais|ftp'); $ltrs = '\w'; $gunk = '/#~:.?+=%!\-'; $punc = '.:?@\-'; $any =

Re: Perl installation problem

2002-01-03 Thread Christopher Solomon
On Thu, 3 Jan 2002, Christopher Solomon wrote: On Thu, 3 Jan 2002, ROry O'Connor wrote: I'm running perl 5.6.0 that was installed when i installed redhat 7.2. I tried to install a few extra modules with CPAN and it also tried to upgrade me to 5.6.1, but for some reason could

Re: Good CS Literature

2001-12-27 Thread Christopher Solomon
On 27 Dec 2001, Luke wrote: Hello people... Happy Holidays... This is my first post. Im a senior high school student and about to graduate this year(lets just hope hehhehe).. Im just wondering if any of you can recommend some good Computer Science books that most universities use...my

Perl-ish way to construct hash

2001-11-27 Thread Christopher Solomon
I am accepting some input values via a web form. I want to compare their values to values in the database and then update those that are different. I am using hashes to hold the values. Here's what we've got: #values sucked in from a form: $params = { report_1 = 'yes',

Re: how do tell a program to skip

2001-11-20 Thread Christopher Solomon
On Tue, 20 Nov 2001, shirley wrote: I've got a program running and extracting minimum values from the data base, but if there is no data available for the day on the data base, the value -999.9 is reflected. so how do I tell my program to skip the -999.9 and then select the minimum value

Re: New Coder

2001-11-19 Thread Christopher Solomon
On Mon, 19 Nov 2001, Etienne Marcotte wrote: I'll be the first to answer before 10 give you the same answer: Books www.oreilly.com - Learning Perl, Programming Perl, Perl Cookbook. On the net, there are many tutorials also, try google search perl tutorial Oreilly books are very good for

Re: Updating a hash using a refernece?

2001-11-13 Thread Christopher Solomon
On Tue, 13 Nov 2001, AMORE,JUAN (HP-Roseville,ex1) wrote: How do I update the value pointed to by key PAGER from more to pg. when using a reference only to the hash element for key PAGER. %Unix= (SHELL = /bin/csh, PAGER = more, DB = mysql); print Value: , $unix{PAGER};

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Christopher Solomon
On Fri, 9 Nov 2001, Etienne Marcotte wrote: By reading the messages everyday I can guess most of us are from United States right? And since there are not a lot of messages in (my) morning time, probably means most are from the west coast (different timezone). Am I right? I'm from

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Christopher Solomon
On 9 Nov 2001, Randal L. Schwartz wrote: Curtis == Curtis Poe [EMAIL PROTECTED] writes: Curtis I currently live in Portland, Oregon, USA. Recently moved Curtis back here from Amsterdam, the Netherlands and missing Europe Curtis more than I thought :( I own a home (two, actually) in

Re: vars as key/value in a hash

2001-11-08 Thread Christopher Solomon
On Thu, 8 Nov 2001, Tyler Cruickshank wrote: I would like to create a hash based on data contained in a file. Can I not use a variable as both the key and the value as shown below? When I print as shown I do not get a value however if I write the key as:alta_guard = $names[1]then I

Re: regexp: either = | ; and = ???

2001-11-08 Thread Christopher Solomon
On Thu, 8 Nov 2001, Louis-Philippe Dextraze wrote: hi, I found this example on a regexp guide (http://etext.lib.virginia.edu/helpsheets/regex.html) /(^To:|^From:)/ this matches either TO: or From: can I twist this in some way to make it match only when both

RE: ?? very odd messages....

2001-10-31 Thread Christopher Solomon
On Tue, 30 Oct 2001 [EMAIL PROTECTED] wrote: Chris Zubrzycki [EMAIL PROTECTED] wrote: prefixed by onion.perl.org (qpsmtpd/0.04) with SMTP; Tue Oct 30 16:22:25 2001 - Looks like there is a config error in ezmlm, this is exactly what I'm getting (and its really confusing

Re: either or

2001-10-23 Thread Christopher Solomon
On Wed, 24 Oct 2001, birgit kellner wrote: I'm sure this has been covered billion times: Until recently, I assumed that the binary operator || functions as either-or. Now I read that it evaluates the left side and, if it evaluates true, doesn't care about the right. So if I want to test

Re: Returning values from one perl module to another

2001-08-28 Thread Christopher Solomon
On Tue, 28 Aug 2001 [EMAIL PROTECTED] wrote: Ok. Now I can call a Perl program from another Perl program but I am having trouble returning values back to the calling Perl program. Return does not seem to work, Any suggestions?? Well... It totally depends one what you are doing. It

Re: Re[2]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sat, 25 Aug 2001, Maxim Berlin wrote: Hello Rory, snip p.s. does anyone know, why i can not write $a =~ s/$///g; ? You can. $a =~ s!$/!!g; Perl just gets confused with the /'s, you have to use alternate delimiters. Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Re[4]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: Hello Christopher, Saturday, August 25, 2001, Christopher Solomon [EMAIL PROTECTED] wrote: p.s. does anyone know, why i can not write $a =~ s/$///g; ? CS You can. CS $a =~ s!$/!!g; CS Perl just gets confused with the /'s, you have to use

Re: alternative to regex when checking for captitalization

2001-08-25 Thread Christopher Solomon
On Sat, 25 Aug 2001, Charles Lu wrote: Does anyone know if there is a built in function that allows you to check to see if all the characters in a string is capitalized or not? In other words is there a way to check to see if a string is capitalized without using regular expression?

Re: Re[6]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: Hello Christopher, Sunday, August 26, 2001, Christopher Solomon [EMAIL PROTECTED] wrote: p.s. does anyone know, why i can not write $a =~ s/$///g; ? CS You can. CS $a =~ s!$/!!g; CS Perl just gets confused with the /'s, you have

Re: Re[8]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: Hello Christopher, Sunday, August 26, 2001, Christopher Solomon [EMAIL PROTECTED] wrote: snip bunch of stuff CS or am I misunderstanding you? may be. example: $regex=STDIN; chomp $regex; $variable=STDIN; chomp $variable; $a =~ s!$variable

Re: The symbol in a variable

2001-08-24 Thread Christopher Solomon
On Thu, 23 Aug 2001, Buffy Press wrote: Hello, I am *very new* to Perl and to this list. I have a question I am hoping someone can answer. I am looking over an existing Perl script and came across this block of code: # Create the cmdfile my $runprog =

Re: Determining if a subroutine is defined...

2001-08-24 Thread Christopher Solomon
On Fri, 24 Aug 2001, Michael Dube wrote: Hi, I have a script that uses require to include additional perl scripts at runtime. I would like to call a function if and only if that function is defined in the required module. How would this be done? Would the define() function work?

Re: Determining if a subroutine is defined...

2001-08-24 Thread Christopher Solomon
On Fri, 24 Aug 2001, Christopher Solomon wrote: On Fri, 24 Aug 2001, Michael Dube wrote: Hi, I have a script that uses require to include additional perl scripts at runtime. I would like to call a function if and only if that function is defined in the required module. How would

Re: replacing text, excluding what's between tags.

2001-08-24 Thread Christopher Solomon
I'm not sure exactly what you want to do... Do you want to replace all of the marked a's: On Fri, 24 Aug 2001, Danial Magid wrote: a href='/index.html'This is a link to another place/a ^ ^ ^ or do you just want to replace the word 'a'? If