RE: Calling a subroutine - strict very strict

2005-05-06 Thread Tielman Koekemoer \(TNE\)
Maybe I should tell you what fixed it: The "param" was a string so enclosed it in single quotes. Thanks! -Original Message- From: Tielman Koekemoer (TNE) [mailto:[EMAIL PROTECTED] Sent: 06 May 2005 02:33 PM To: [EMAIL PROTECTED]; beginners@perl.org Subject: RE: Calling a

RE: Calling a subroutine - strict very strict

2005-05-06 Thread Tielman Koekemoer \(TNE\)
Thanks Prasanna, that fixed it. -Original Message- From: Prasanna Kothari [mailto:[EMAIL PROTECTED] Sent: 06 May 2005 02:26 PM To: beginners@perl.org Cc: Tielman Koekemoer (TNE) Subject: Re: Calling a subroutine - strict very strict what is "param".? If it's a variable, a

Re: Calling a subroutine - strict very strict

2005-05-06 Thread Prasanna Kothari
what is "param".? If it's a variable, and not declared, qualify it using "my or local". Else, if it's a string that you want pass to the function, use single quotes. -Prasanna Tielman Koekemoer (TNE) wrote: Hi All, I apologise for the newbie question straight off - I don't have my Camel book with

Re: calling a subroutine as an element of a hash table...

2003-02-10 Thread Peter_Farrar
Oops, hit send by mistake. This problem all seems to be about mistakes... Thanks to all who replied. > You have three different hashes in use. Look: I did indeed have 3 hash tables... Duh (Must have been Friday afternoon). The central problem was calling '&{${$date_format{$format}}{now}}()' i

Re: calling a subroutine as an element of a hash table...

2003-02-10 Thread Peter_Farrar
| PM | | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | |

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Dave K
Peter, #!/usr/bin/perl -w use strict; my %date_formats = ( ccyymmdd => { now => sub { my @arr = localtime(); print 'Year ', 1900 + $arr[5] . ' Month '. sprintf("%02d",$arr[4] + 1) . ' Day ' . sprintf("%02d",$arr[3]); } } ); & { $date_formats{ccyymmdd}{now} }; Same output as previous

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Dave K
Peter I saw Jenda's note and I suggest the code needs simplification. > P.S. you can see where I comment out the ccyymmdd_now function. That > approach works, but is not what I'm shooting for. > > %date_formats = ( > # "ccyymmdd" => {now => \ccyymmdd_now()}, > "ccyymmdd" => {now => s

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Rob Dixon
Peter Farrar wrote: > Hi All, > > I swear I've called subroutines this way before, but I can't find any > examples. > In this case, I'm looking to build some time/date functions. > Regardless of what the actual code is supposed to do, the calling of > subroutines as elements of a hash is causing me

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > Peter Farrar wrote: > > I swear I've called subroutines this way before, but I can't find > > any examples. In this case, I'm looking to build some time/date > > functions. Regardless of what the actual code is supposed to do, > > the calling of subrouti

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread John W. Krahn
Peter Farrar wrote: > > Hi All, > > I swear I've called subroutines this way before, but I can't find any > examples. > In this case, I'm looking to build some time/date functions. Regardless of > what the actual code is supposed to do, the calling of subroutines as > elements of a hash is causi

Re: Calling a subroutine

2001-12-19 Thread Curtis Poe
--- Chris Zampese <[EMAIL PROTECTED]> wrote: > How do I call a subroutine in a cgi script. I thought that it was just > > subroutine_name(); > > but that does not seem to be working for me? > > You guys are great. Thanks for your help (both from answering my questions, and >from ans