Re: subroutine call

2011-12-05 Thread Shlomi Fish
Hi Ganesh, On Mon, 5 Dec 2011 14:16:29 +0530 ganesh vignesh wrote: > stop mail to me The instructions at the bottom of every E-mail read: [QUOTE] To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ [/QUOTE] Ple

Re: subroutine call

2011-12-05 Thread Shlomi Fish
Hello, John. On Sun, 04 Dec 2011 12:46:40 -0800 "John W. Krahn" wrote: > > You should assign $marketInfo{$mkt} to a variable, or alternatively do: > > > > my ($start, $end) = @{$marketInfo{$mkt}}{qw(start end)}; > > > >> my $end = $marketInfo{$mkt}->{"end"}; > >> if( $cell>=

Re: subroutine call

2011-12-04 Thread John W. Krahn
Shlomi Fish wrote: in addition to the good advice that Uri gave you - some comments on your code. On Sun, 4 Dec 2011 07:40:09 -0600 Chris Stinemetz wrote: I have a program that I am working on improveing. The fist step I have taken is converting it in using the strict pragma. Now when this

Re: subroutine call

2011-12-04 Thread Dr.Ruud
On 2011-12-04 18:12, Shlomi Fish wrote: Chris wrote: my $cell = substr($market,0,index($market,"_")); print "$_ <", substr( $_, 0, index $_, "_" ), ">\n" for qw/ foo1 foo2_bar foo3_bar_baz /; foo1 foo2_bar foo3_bar_baz This can be more idiomatically (and more briefly) done us

Re: subroutine call

2011-12-04 Thread Shlomi Fish
Hi Chris, in addition to the good advice that Uri gave you - some comments on your code. On Sun, 4 Dec 2011 07:40:09 -0600 Chris Stinemetz wrote: > I have a program that I am working on improveing. The fist step I have > taken is converting it in using the strict pragma. > > Now when this subr

Re: subroutine call

2011-12-04 Thread Uri Guttman
On 12/04/2011 08:40 AM, Chris Stinemetz wrote: I have a program that I am working on improveing. The fist step I have taken is converting it in using the strict pragma. Now when this subroutine call is made I get the following compilation error: Global symbol "$cell" requires explicit package n

Re: subroutine call makes foreach exit?

2006-11-16 Thread John W. Krahn
Andy Greenwood wrote: > I'm writing a script for work that will dig for DNS records for a > given domain name and put the entries into an array. At the end of the > digging, it outputs the array elements to the screen, asks if > everything looks good, and if so, writes them out to the shell and > b

Re: subroutine call makes foreach exit?

2006-11-16 Thread Tom Phoenix
On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: if (/^$domain.+MX\s+(\d+)\s+(.+)/) { Because $domain is a string (and not a pattern), interpolating it into a pattern could cause troubles. First, any metacharacters it contains may affect the match. But also, is that pattern going

Re: subroutine call makes foreach exit?

2006-11-16 Thread Andy Greenwood
On 11/16/06, Jay Savage <[EMAIL PROTECTED]> wrote: On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: > I'm writing a script for work that will dig for DNS records for a > given domain name and put the entries into an array. At the end of the > digging, it outputs the array elements to the sc

Re: subroutine call makes foreach exit?

2006-11-16 Thread Jay Savage
On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: I'm writing a script for work that will dig for DNS records for a given domain name and put the entries into an array. At the end of the digging, it outputs the array elements to the screen, asks if everything looks good, and if so, writes th

Re: Subroutine call

2004-11-24 Thread Lawrence Statton N1GAK/XE2
[EMAIL PROTECTED] (TapasranjanMohapatra) writes: > Now I use this module in another script. I want to call the sub routines, as > suggested by the argument passed to the script. > i.e. > my_script q should call the sub routine zzzq, > my_script e should call the sub routine zzze, > ... > > whe

Re: Subroutine call

2004-11-24 Thread Todd W
"Charles K. Clarkson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > TapasranjanMohapatra <[EMAIL PROTECTED]> wrote: > > : Suppose I have many sub routines in a module abc.pm > : > : package abc; > : > : sub zzzq > : { > : } > : > : sub zzze > : { > : } > : sub zzzr > : { > : } > :

Re: Subroutine call

2004-11-24 Thread JupiterHost.Net
TapasranjanMohapatra wrote: Hi All, Hello, I have a querry if the following can be possible. Suppose I have many sub routines in a module abc.pm package abc; Your package should use strict and warnings :) sub zzzq { } sub zzze { } sub zzzr { } Now I use this module in another script. I want to cal

RE: Subroutine call

2004-11-24 Thread Charles K. Clarkson
TapasranjanMohapatra <[EMAIL PROTECTED]> wrote: : Suppose I have many sub routines in a module abc.pm : : package abc; : : sub zzzq : { : } : : sub zzze : { : } : sub zzzr : { : } : : Now I use this module in another script. I want to call the : sub routines, as suggested by the argument passe

Re: subroutine call weirdness

2004-02-28 Thread R. Joseph Newton
"Michael C. Davis" wrote: > At 08:54 PM 2/27/04 -0800, R. Joseph Newton wrote: > >I think it might also be good to refer the OP back to James' post, which > he seems > >to have overlooked. The caveat you provided earlier still makes sense. > > Thanks for the ideas. Are you referring to James' su

Re: subroutine call weirdness

2004-02-27 Thread Michael C. Davis
At 08:54 PM 2/27/04 -0800, R. Joseph Newton wrote: >I think it might also be good to refer the OP back to James' post, which he seems >to have overlooked. The caveat you provided earlier still makes sense. Thanks for the ideas. Are you referring to James' suggestion about always using parens on

Re: subroutine call weirdness

2004-02-27 Thread R. Joseph Newton
Rob Dixon wrote: > Michael C. Davis wrote: > > > > At 01:31 AM 2/28/04 +1100, David le Blanc wrote: > > >Now remember, a perl 'prototype' is not a prototype in the regular > > >sense, > > >but a method to override perl's natural greedy argument list collection, > > >and a method to create function

Re: subroutine call weirdness

2004-02-27 Thread R. Joseph Newton
James Edward Gray II wrote: > On Feb 27, 2004, at 6:55 AM, Michael C. Davis wrote: > > > Hi list, > > > > I just ran across some unexpected results in passing arguments to > > user-defined subroutines. Could someone who has been around Perl a > > while > > longer check this and make sure I'm seei

Re: subroutine call weirdness

2004-02-27 Thread Rob Dixon
Michael C. Davis wrote: > > At 01:31 AM 2/28/04 +1100, David le Blanc wrote: > >Now remember, a perl 'prototype' is not a prototype in the regular > >sense, > >but a method to override perl's natural greedy argument list collection, > >and a method to create functions which emulate perl's builtins

RE: subroutine call weirdness

2004-02-27 Thread Michael C. Davis
At 01:31 AM 2/28/04 +1100, David le Blanc wrote: >Now remember, a perl 'prototype' is not a prototype in the regular >sense, >but a method to override perl's natural greedy argument list collection, >and a method to create functions which emulate perl's builtins (ie, >provide >hints to the expected

Re: subroutine call weirdness

2004-02-27 Thread Michael C. Davis
At 02:32 PM 2/27/04 -, Rob Dixon wrote: >I haven't looked at this at all carefully, but my first guess would be >be that you need to call the subroutine as if it was one: > > print MyProject::CoreConstants::EarliestValidTimestampAsNumber() + 1, "\n"; Yes, this certainly solves the problem I'm

Re: subroutine call weirdness

2004-02-27 Thread Rob Dixon
David Le Blanc wrote: > > > From: Michael C. Davis [mailto:[EMAIL PROTECTED] > > Sent: Friday, 27 February 2004 11:55 PM > > To: [EMAIL PROTECTED] > > Subject: subroutine call weirdness > > > > Hi list, > > > > I just ran across some unexpected results in passing arguments to > > user-defined subro

Re: subroutine call weirdness

2004-02-27 Thread Rob Dixon
Michael C. Davis wrote: > > I just ran across some unexpected results in passing arguments to > user-defined subroutines. Could someone who has been around Perl a while > longer check this and make sure I'm seeing this right? > > I've got some code that implements a constant as a subroutine call (

RE: subroutine call weirdness

2004-02-27 Thread David le Blanc
> From: Michael C. Davis [mailto:[EMAIL PROTECTED] > Sent: Friday, 27 February 2004 11:55 PM > To: [EMAIL PROTECTED] > Subject: subroutine call weirdness > > Hi list, > > I just ran across some unexpected results in passing arguments to > user-defined subroutines. Could someone who has been aro

Re: subroutine call weirdness

2004-02-27 Thread James Edward Gray II
On Feb 27, 2004, at 6:55 AM, Michael C. Davis wrote: Hi list, I just ran across some unexpected results in passing arguments to user-defined subroutines. Could someone who has been around Perl a while longer check this and make sure I'm seeing this right? I've got some code that implements a c