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
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>=
subroutine call is made I get the following compilation error:
Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
I understand lexical scope, but am having a hard time figuring
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
ow when this subroutine call is made I get the following compilation error:
>
> Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
> Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
>
> I understand lexical scope
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 explic
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 name at ./evdo.pl line 279.
Global sym
Yes! It was exactly what I was trying to do. I wasn't so wrong after all.
Thanks you, Dani, your code helps me a lot :D
2006/12/2, D. Bolliger <[EMAIL PROTECTED]>:
Sergio Escalada am Samstag, 2. Dezember 2006 15:41:
> Thanks for replies.
>
> The purpouse of this mini-script is to list the rows
Sergio Escalada am Samstag, 2. Dezember 2006 15:41:
> Thanks for replies.
>
> The purpouse of this mini-script is to list the rows from a database loaded
> in memory ($ref_db is the reference to hashtable that cotains the DB). So I
> want to order the fields by different sort rules, and make the pr
#
# hashref? Why in the WORLD is the database being kept in a hashref?
#
Oh, it's an exercise for class, and I must keep data in a hashtable, it's
not my fault ^_^
Thanks for your code :)
#
# if you have a small number of columns you want to sort by, build a
# simple subroutine to sort by
On 12/02/2006 06:22 AM, Sergio Escalada wrote:
Hi all! I would like to know if it's possible to make an array sorting with
a subroutine call.
Usually, a sort is made as, for example:
sort {$a <=> $b} @array;
But my intention is something like:
sort subroutine_call @array;
sub
> The purpouse of this mini-script is to list the rows from a database loaded
> in memory ($ref_db is the reference to hashtable that cotains the DB). So I
> want to order the fields by different sort rules, and make the proccess as
> abstract as it's possible with a subrutine (sub cmpRule). This s
On 12/2/06, Sergio Escalada <[EMAIL PROTECTED]> wrote:
The purpouse of this mini-script is to list the rows from a database loaded
in memory ($ref_db is the reference to hashtable
Another idea -
sub sortrows {
my $sorted = @_;
$sorted = -(($a->{ahash} eq 'x') <=> ($b->{ahash} eq 'x')) if $
Thanks for replies.
The purpouse of this mini-script is to list the rows from a database loaded
in memory ($ref_db is the reference to hashtable that cotains the DB). So I
want to order the fields by different sort rules, and make the proccess as
abstract as it's possible with a subrutine (sub cm
Sergio Escalada wrote:
Hi all! I would like to know if it's possible to make an array sorting with
a subroutine call.
Usually, a sort is made as, for example:
sort {$a <=> $b} @array;
But my intention is something like:
sort subroutine_call @array;
sub subroutine
{
$a <
Sergio Escalada wrote:
Hi all! I would like to know if it's possible to make an array sorting with
a subroutine call.
Usually, a sort is made as, for example:
sort {$a <=> $b} @array;
But my intention is something like:
sort subroutine_call @array;
sub subroutine
{
$a <
> Hi all! I would like to know if it's possible to make an array sorting with
> a subroutine call.
>
> Usually, a sort is made as, for example:
>
>
> sort {$a <=> $b} @array;
>
>
> But my intention is something like:
>
>
> sort subroutin
Sergio Escalada wrote:
Hi all! I would like to know if it's possible to make an array sorting with
a subroutine call.
Usually, a sort is made as, for example:
sort {$a <=> $b} @array;
But my intention is something like:
sort subroutine_call @array;
If you really want to c
Hi all! I would like to know if it's possible to make an array sorting with
a subroutine call.
Usually, a sort is made as, for example:
sort {$a <=> $b} @array;
But my intention is something like:
sort subroutine_call @array;
sub subroutine
{
$a <=> $b;
}
How could
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
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
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
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
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
builds a zone file. However, I'v
[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
"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
> : {
> : }
> :
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
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
Hi All,
I have a querry if the following can be possible.
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 passed to the script.
i.e.
"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
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
g a separate
> > issue from prototypes? It seems there are some hoops one has to jump
> > through to make sure that the prototype is 'known' for any given subroutine
> > call, but I'm not real clear as to just what those hoops are ...
>
> You're now asking a quest
; > longer check this and make sure I'm seeing this right?
> >
> > I've got some code that implements a constant as a subroutine call (to
> > keep
> > the constant from being modified). When I use that subroutine in an
> > arithmetic expression, it is consum
oject::ModuleName::MySub;
>
> without importing any symbols from the module, in the case when the module
> does not export any names by default? Or is importing/exporting a separate
> issue from prototypes? It seems there are some hoops one has to jump
> through to make sure that
e when the module
does not export any names by default? Or is importing/exporting a separate
issue from prototypes? It seems there are some hoops one has to jump
through to make sure that the prototype is 'known' for any given subroutine
call, but I'm not real clear as to just what
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
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 unexpect
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 c
> 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.
plements a constant as a subroutine call (to
keep
the constant from being modified). When I use that subroutine in an
arithmetic expression, it is consuming everything to the right of it
as its
argument list.
Obviously, you can always use parens to make statements unambiguous, as
you've d
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 constant as a subroutine call (to keep
th
41 matches
Mail list logo