> "MM" == Mike McClain writes:
MM> On Thu, Apr 28, 2011 at 01:16:25PM -0400, Uri Guttman wrote:
>> > "zs" == z sway writes:
MM>
>>
zs> sub grow {
zs> my $expr = $_[0];
>>
>> this is better:
>> my ( $expr ) = @_ ;
MM> Better how?
* it doesn't require indexing so
On Thu, Apr 28, 2011 at 01:16:25PM -0400, Uri Guttman wrote:
> > "zs" == z sway writes:
>
> zs> sub grow {
> zs> my $expr = $_[0];
>
> this is better:
> my ( $expr ) = @_ ;
Better how?
Thanks,
Mike
--
Satisfied user of Linux since 1997.
O< ascii ribbon campaign - stop html ma
On 29/04/2011 13:17, C.DeRykus wrote:
This happened in 5.10 ... at least after 5.8.
From: http://rt.perl.org/rt3/Ticket/Display.html?id=89024
Just like the argument list of sub calls, The list over which
foreach
iterates is evaluated in lvalue context as required by foreach's
al
On Apr 29, 2:39 am, u...@stemsystems.com ("Uri Guttman") wrote:
> > "RD" == Rob Dixon writes:
>
> RD> On 29/04/2011 10:27, Uri Guttman wrote:
>
> RD> Good call Brian. It's not at all obvious that all the elements of a hash
> RD> slice will be created if they don't exist :)
> >>
> >>
On 29/04/2011 11:13, z sway wrote:
>
> Hi, grow($part) returns an array, I don't know how to create a ref to array
> in one step.
>
> @$part = grow($part) doesn't work here.To my knowledge, it is used for
> changing the array $part refers to, but $part is not a ref , it‘s a string,
> it can't refe
Hi Agnello,
On Friday 29 Apr 2011 13:26:29 Agnello George wrote:
> HI
>
> I have as hash within my script.pl file which look like this
>
> ### code follows
>
>
>
>
>
> But it obviously looks too messy to add it all in one script.pl , as
> i am going to add new keys and values to the hash ,
HI
I have as hash within my script.pl file which look like this
my %verticals = ( 'auto_v1' => {
'tempdir' => '/var/www/html/temp/auto' ,
'svnurl' => 'http://svn.int.com/repos/a.com/branch/auto',
'excludes' =>
'uploaded_images|includes/config.php|admin/includes/config.php|.svn',
'
Hi, grow($part) returns an array, I don't know how to create a ref to array
in one step.
@$part = grow($part) doesn't work here.To my knowledge, it is used for
changing the array $part refers to, but $part is not a ref , it‘s a string,
it can't refer anything until it's changed to a ref.
$part =
> "RD" == Rob Dixon writes:
RD> On 29/04/2011 10:27, Uri Guttman wrote:
RD> Good call Brian. It's not at all obvious that all the elements of a hash
RD> slice will be created if they don't exist :)
>>
>> and they won't be anyhow. you need have lvalues to autovivify hash (or
>> a
On 29/04/2011 10:27, Uri Guttman wrote:
"RD" == Rob Dixon writes:
RD> On 29/04/2011 09:15, Brian Fraser wrote:
>> On Fri, Apr 29, 2011 at 5:02 AM, Uri Guttman
wrote:
>>>
>>> so you can streamline yours with a slice:
>>>
>>> my $status = join '', grep defined, @jvalue{
> "RD" == Rob Dixon writes:
RD> On 29/04/2011 09:15, Brian Fraser wrote:
>> On Fri, Apr 29, 2011 at 5:02 AM, Uri Guttman wrote:
>>>
>>> so you can streamline yours with a slice:
>>>
>>> my $status = join '', grep defined, @jvalue{ 0 .. 5 } ;
>>
>> This one was on purpose t
On 29/04/2011 10:15, Agnello George wrote:
sorry i ment
if (stdout == keys (%$retrn{$stdout}) ) {
##so some code
}
Erm, perhaps
if ($stdout == keys %{$retrn{$stdout}}) {
But that would compare the value of $stdout with the /number/ of keys
in the hash, which is always
> "AG" == Agnello George writes:
AG> sorry i ment
AG>if (stdout == keys (%$retrn{$stdout}) ) {
AG>##so some code
AG> }
i don't think you are getting it yet. keys gets you the list of keys
ONLY in a list context. == provides a scalar context which will get you
the
On 29/04/2011 10:14, Agnello George wrote:
On Fri, Apr 29, 2011 at 2:33 PM, Rob Dixon wrote:
On 29/04/2011 09:47, Agnello George wrote:
my %retrn = ( 0 =>{ 0 =>' successful'},
1 =>{ 1 =>'insufficient'},
2 =>{ 2 =>'txtfile missing'},
3 =>
On Fri, Apr 29, 2011 at 2:44 PM, Agnello George
wrote:
> On Fri, Apr 29, 2011 at 2:33 PM, Rob Dixon wrote:
>> On 29/04/2011 09:47, Agnello George wrote:
>>>
>>> my %retrn = ( 0 => { 0 => ' successful'},
>>> 1 => { 1 => 'insufficient'},
>>> 2 => { 2 => 'txtfile missing'},
>
On 29/04/2011 09:15, Brian Fraser wrote:
On Fri, Apr 29, 2011 at 5:02 AM, Uri Guttman wrote:
so you can streamline yours with a slice:
my $status = join '', grep defined, @jvalue{ 0 .. 5 } ;
This one was on purpose though - The slice might insert new keys into the
hash, and I recently spent
On Fri, Apr 29, 2011 at 2:33 PM, Rob Dixon wrote:
> On 29/04/2011 09:47, Agnello George wrote:
>>
>> my %retrn = ( 0 => { 0 => ' successful'},
>> 1 => { 1 => 'insufficient'},
>> 2 => { 2 => 'txtfile missing'},
>> 3 => { 3 => 'bad dir'},
>> );
>>
>> ( i kno
On 29/04/2011 09:47, Agnello George wrote:
my %retrn = ( 0 => { 0 => ' successful'},
1 => { 1 => 'insufficient'},
2 => { 2 => 'txtfile missing'},
3 => { 3 => 'bad dir'},
);
( i know this hash looks funny , but is the hash i got to use )
suppose $s
Agnello George wrote:
Hi All
Hello,
I got a hash like this :
my %retrn = ( 0 => { 0 => ' successful'},
1 => { 1 => 'insufficient'},
2 => { 2 => 'txtfile missing'},
3 => { 3 => 'bad dir'},
);
( i know this hash looks funny , but is the hash i g
Hi All
I got a hash like this :
my %retrn = ( 0 => { 0 => ' successful'},
1 => { 1 => 'insufficient'},
2 => { 2 => 'txtfile missing'},
3 => { 3 => 'bad dir '},
);
( i know this hash looks funny , but is the hash i got to use )
suppose $stdout = 0;
i need to
On Fri, Apr 29, 2011 at 5:02 AM, Uri Guttman wrote:
>
> also why use qw for sequential numbers when a range will do?
>
> Because I went stupid and just blindly copypasted instead of thinking :)
Seriously, why use qw when I'm not _quoting words_?
> so you can streamline yours with a slice:
>
> m
> "BF" == Brian Fraser writes:
BF> On Fri, Apr 29, 2011 at 4:27 AM, Agnello George
wrote:
>> Hi All
>>
>> is there a better way of writing this script
>>
>>
BF> "Better" is fairly subjective - And with only a part of the program,
there
BF> isn't much that can be said. Is
On Fri, Apr 29, 2011 at 1:09 PM, Uri Guttman wrote:
>> "AG" == Agnello George writes:
>
> AG> is there a better way of writing this script
>
> this is not a script but a short code snippet. there are many ways to
> redo this. many questions could be asked as well.
>
> AG> my @resultss = qw
> "AG" == Agnello George writes:
AG> is there a better way of writing this script
this is not a script but a short code snippet. there are many ways to
redo this. many questions could be asked as well.
AG> my @resultss = qw( 0 1 2 3 4 5 ) ;
is that always a fixed list? could @jvalue h
On Fri, Apr 29, 2011 at 4:27 AM, Agnello George wrote:
> Hi All
>
> is there a better way of writing this script
>
>
"Better" is fairly subjective - And with only a part of the program, there
isn't much that can be said. Is $status a global variable, or lexical?
On the other hand, if you mean mo
Hi All
is there a better way of writing this script
my @resultss = qw( 0 1 2 3 4 5 ) ;
foreach ( @resultss) {
if ( defined( $jvalue{$_}){
$status .= $jvalue{$_} ;
}
}
Thanks
--
Regards
Agnello D'souza
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands,
26 matches
Mail list logo