Date format again

2002-03-03 Thread Troy May
Hello, this guy finally emailed his script to me. The problem he is having is with "$year". Here's the dating part of the code: --- $date = `/bin/date`; chop($date); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $thisday = (Sun,Mon,Tue,We

Re: Book suggestion

2002-03-03 Thread Dave Cross
On Sat, 23 Feb 2002 01:02:49 +, Elaine -Hfb- Ashton wrote: > Anidil Rajendran-Raj [[EMAIL PROTECTED]] quoth: *>Hi team, *> > *>I am unix admin trying to learn perl. How is the book "LEARNING PERL > BY *>EXAMPLE" by Ellie Quigley > > http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq2/Perl_Bo

Re: help with first Perl application (repost w/ better subject line)

2002-03-03 Thread Tagore Smith
James Woods wrote: > Greetings all, > > The address of the page that I'm working on is > http://staff.washington.edu/guru/cards.cgi > > The page seems like it should be pretty simple... but I'm a total newbie to > perl. > > When you check various boxes in the "Play" column and click "Update" the >

Re: Date format again

2002-03-03 Thread Marcelo E. Magallon
[ Don't Cc: me, I read this mailing list, thank you ] >> Troy May <[EMAIL PROTECTED]> writes: > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; > $thisday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime) [6]]; > $s = (localtime)[0]; > $m = (localtime)[1]; > $m = ($m + 35) ;

Re: Date format again

2002-03-03 Thread Alfred Wheeler
$year is a number. Numbers do not retain leading zeros. "$year %= 100;" does not return the string "02"; it returns the number 2. Try something like this - $s_year = sprintf("%02u", $year); print "$s_year"; The sprintf function basically converts the number into a string. "sprintf returns a str

Re: How do I pass a hash to a sub, and get to it in the sub?

2002-03-03 Thread John Crockett
Thank you, Thank you, Thank you!!! JC "Wagner-David" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED].; > The simplest is to pass as reference: > my_subroutine( \%input_parm ) > Now in the subroutine: > my ( $input_parm ) = @_; > To work with you would can use this notation: > i

Re: How do I pass a hash to a sub, and get to it in the sub?

2002-03-03 Thread John Crockett
Thank you SO much...I love it that guys who know what they're doing are willing to help us newbies! JC "Chas Owens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED].; > On Sat, 2002-03-02 at 11:16, John Crockett wrote: > > I'm sure this is such a simple thing, most of you-all are

Sockets and NNTP

2002-03-03 Thread Hernan Freschi
Hello everyone, I have a little problem. I wrote a little script to get the newsgroup list from a newsserver. It opens a socket, connects to it, writes "LIST\n" and does while () 'till /^\./. The problem is that, it works only with some servers. On others, it just keeps waiting for input (looks l

Cookies, What's wrong with this?

2002-03-03 Thread Motherofperls
Could someone tell me why this doesn't retrieve my cookie? The cookie has already been set by another page and I just want to retrieve it. #!/usr/bin/perl use CGI param, header,cookie; print header(); print header(-cookie=>'MY_COOKIE');

Re: Cookies, What's wrong with this?

2002-03-03 Thread Johannes Franken
On Sun, Mar 03, 2002 at 07:20:35AM -0500, [EMAIL PROTECTED] wrote: > Could someone tell me why this doesn't retrieve my cookie? > use CGI param, header,cookie; > print header(); > print header(-cookie=>'MY_COOKIE'); header() is for generating an http header, not for reading from it. print cookie(

multidimensional hashes

2002-03-03 Thread Chris Garaffa
Hello all, I'm working on a site for a t-shirt company, and doing the order process in Perl. I've got everything working, and working fine, but I was wondering about different ways to go about doing this: $the_order = new CGI; $the_sleeve_type = $the_order->param('sleeve_type'); $the_previous_s

Re: multidimensional hashes

2002-03-03 Thread Chris Garaffa
On Sunday, March 3, 2002, at 11:17 AM, Chris Garaffa wrote: > but I'd like to be able to get rid of %product_description altogether > and make calls to a multidimensional hash > Any ideas? > Grr... got hashes on the brain... should be $product_description, not %product_description my apologies

Perl script for simple web pages

2002-03-03 Thread michael
Is writing a perl script for making simple HTML pages reinventing the wheel? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl script for simple web pages

2002-03-03 Thread jbajin
It depends. If you are writing them to create a simple page. Maybe, but using perl to decide something or take action is just a CGI script. So they turn out to be very useful.

Re: If (/start/ .. /end/) Flip Flop Mechanism

2002-03-03 Thread Todd A. Jacobs
On Sat, 2 Mar 2002, Steven M. Klass wrote: > if (/start/ .. /end/){ >s/^foo/bar/; > > } Just add an alternative match: if (/start/ .. /end/) { s/^foo/bar/ or s/^/bar/ ; } -- "The only thing that helps me maintain my slender grip on reality is the friendshi

RE: Missing modules

2002-03-03 Thread Shaun
> Hi from İstanbul, > > Anyone knows a free server that i can test my perl scripts? I've > already find some but the modules that i need aren't installed. I > prefer the one that all the perl modules are installed if it exists:) > > thanx Install Apache on your PC and the Perl modules that you ne

Re: Perl script for simple web pages

2002-03-03 Thread Michael Kelly
On 3/3/02 10:36 AM, michael <[EMAIL PROTECTED]> wrote: > Is writing a perl script for making simple HTML pages > reinventing the wheel? If you can find another script that does what you want (such as CGI.pm), yes. Otherwise, no. (I've written quite a few quickie scripts that I couldn't find anyw

Re: multidimensional hashes

2002-03-03 Thread Tagore Smith
Chris Garaffa wrote: > Hello all, > I'm working on a site for a t-shirt company, and doing the order process > in Perl. > I've got everything working, and working fine, but I was wondering about > different ways to go about doing this: > > $the_order = new CGI; > $the_sleeve_type = $the_order->pa

Re: If (/start/ .. /end/) Flip Flop Mechanism

2002-03-03 Thread Jeff 'japhy' Pinyan
On Mar 3, Todd A. Jacobs said: >On Sat, 2 Mar 2002, Steven M. Klass wrote: > >> if (/start/ .. /end/){ >>s/^foo/bar/; >> >> } > > s/^foo/bar/ or s/^/bar/ ; You can just say: s/^(foo)?/bar/; or, if you like, s/^(?:foo)?/bar/; or even omit the ^. -- Jeff "japhy" Pinyan

Re: Sockets and NNTP

2002-03-03 Thread Daniel Gardner
Sunday, March 03, 2002, 1:11:39 AM, Hernan Freschi wrote: > I wrote a little script to get the newsgroup list from a newsserver. It > opens a socket, connects to it, writes "LIST\n" and does while () > 'till /^\./. > The problem is that, it works only with some servers. On others, it just > keeps

Re: Sockets and NNTP

2002-03-03 Thread Hernan Freschi
I already did, but I dont understand it,... it uses objects and I don't know them. "Daniel Gardner" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED].; > > Sunday, March 03, 2002, 1:11:39 AM, Hernan Freschi wrote: > > I wrote a little script to get the newsgroup list from a newss

Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
Hey all, I need a Perl script to be able to have a user fill out an online form. Now this is easy enough but what I want is the user to check a couple of checkboxes and then have the script go and do something like a calculation. Can this be done using perl or do I have to use Java? Also I would

Re: Perl to work like Java

2002-03-03 Thread Leon
Yes it is possible. The forms will be sent to the script which then process the inputs. - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 03, 2002 5:44 PM Subject: Perl to work like Java Hey all, I need a Perl script to be ab

Newbie question

2002-03-03 Thread suraj rajendran
Hello beginners, Here is a very basic question: I am trying to print only the zip code of massachusets Even though this works, i am pretty sure there is a better way doing this. Any ideas? #!/usr/bin/perl while () { ($name, $phone, $address, $dob, $salary) = split(":", $_); ($add1, $city, $state

Re: multidimensional hashes

2002-03-03 Thread Randal L. Schwartz
> "Chris" == Chris Garaffa <[EMAIL PROTECTED]> writes: Chris> Hello all, Chris> I'm working on a site for a t-shirt company, and doing the order Chris> process in Perl. This is gonna wanna be in a database sooner or later, since you can't trivially squirrel away Perl references (to make comp

Re: Newbie question

2002-03-03 Thread Eric Beaudoin
At 21:15 2002.03.03, suraj rajendran wrote: >Here is a very basic question: >I am trying to print only the zip code of massachusets >Even though this works, i am pretty sure there is a >better way doing this. Any ideas? > >#!/usr/bin/perl >while () { >($name, $phone, $address, $dob, $salary) = spl

RE: Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
Leon, Yes that is easy enough but can I do this with out the page having to have to be refreshed? I would essentially like it to work exactly like Java does. Thx, Dan -Original Message- From: Leon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 5 March 2002 4:31 AM To: [EMAIL PROTECTED] Subj

Re: Perl to work like Java

2002-03-03 Thread Gabby Dizon
Hi Daniel, perhaps you mean javascript? to answer your quesrtion, no, because perl is a server-side script that needs to be submitted before it can be processed. client-side scripting (like javascript) is done from your local computer (ie client-side), so calculations can be done without being su

RE: Perl to work like Java

2002-03-03 Thread Daniel Falkenberg
Gabby, Yes, I think I already knew this but I just has to confirm it :) Dan == VINTEK CONSULTING PTY LTD (ACN 088 825 209) email: [EMAIL PROTECTED] web: Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312 Gawler S

Re: Newbie question

2002-03-03 Thread suraj rajendran
Thank you very much. this list is very helpful. Within minutes I got 3 replies. regs --- Eric Beaudoin <[EMAIL PROTECTED]> wrote: > At 21:15 2002.03.03, suraj rajendran wrote: > >Here is a very basic question: > >I am trying to print only the zip code of > massachusets > >Even though this works,

Re: Newbie question

2002-03-03 Thread John W. Krahn
Suraj Rajendran wrote: > > Hello beginners, > > Here is a very basic question: > I am trying to print only the zip code of massachusets > Even though this works, i am pretty sure there is a > better way doing this. Any ideas? > > #!/usr/bin/perl > while () { > ($name, $phone, $address, $dob, $s

Re: cygwin/activestate/linux

2002-03-03 Thread Dave K
I have found ActiveState to be the 'easiest' in most cases but when I want to do something fun or interesting I often find the module that I need is not available for the ActiveState distribution. Cygwin is fun, but CPAN is sometimes frustrating though it is sometime the only place to get a requir

Re: Perl to work like Java

2002-03-03 Thread Michael Kelly
On 3/3/02 6:36 PM, Daniel Falkenberg <[EMAIL PROTECTED]> wrote: > Leon, > > Yes that is easy enough but can I do this with out the page having to > have to be refreshed? I would essentially like it to work exactly like > Java does. > Thx, > > Dan Nope. (That is, assuming that by "java" you me

RE: cygwin/activestate/linux

2002-03-03 Thread Timothy Johnson
Why wouldn't you just download the module from CPAN and then install it in your ActiveState Perl directory? Are there modules out there that don't work at all with ActiveState? -Original Message- From: Dave K To: [EMAIL PROTECTED] Sent: 3/3/02 11:55 PM Subject: Re: cygwin/activestate/l

perl, remsh, and remote files

2002-03-03 Thread Randy Brown
Here's a perl question for you. I am trying to write a few lines that will run one one machine, and check if a file exists on other machines. Here is what I am thinking: $pcommand="remsh $remote_machine -l $myaccount -n if ( -e a_file);"; if ( system ($pcomma

Running a command Remotely on another Host

2002-03-03 Thread norishaam
Hi, I've been trying to figure out the above, maybe someone has some experience...Below is the scenario:- 1. I have an executable, update.exe, that can run locally to update the service pack. 2. I am trying to write a perl script to have this update.exe to run on multiple remote machines,