Sponsored Content
Top Forums Shell Programming and Scripting unable to return multilple values in perl Post 302604553 by harpal singh on Monday 5th of March 2012 10:25:16 AM
Old 03-05-2012
Thanks again to explain in detail.
Yes i tried this also @array = <FILE> and you are absolutely right,mine file is large having so many configurable parameters.
I also tried the second method open the file before each if-block and close it before opening it again before 2nd if-block.it worked but once again you are right Smilie it would be over kill.
anyway mine script is working fine now..Once again thanks a million.. Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

exit/return values

Sys: HP-UX 9000 In the calling script how do I 'read' the return/exit value of a called script?:confused: THX in advance for any assistence.:) (1 Reply)
Discussion started by: vslewis
1 Replies

2. Shell Programming and Scripting

perl "system" cmd return values..

perl 5.6.1: when i try a "system" command(with if loops for $?), i get this: child exited with value 1 what is meant by this $? values and what does it meant if it returns 1?.. (0 Replies)
Discussion started by: sekar sundaram
0 Replies

3. Shell Programming and Scripting

Possible return values for $?

I think the $? returns 0 if the last issued command was successful and otherwise if not. But does anyone knows the value list that may be returned ? (or it is only zero/one ? ) Thanks in advance, Abrahao. (3 Replies)
Discussion started by: 435 Gavea
3 Replies

4. UNIX for Dummies Questions & Answers

Need to write messages to Multilple users

hi, I need to send a message to multiple users to all there logged on terminals i tried write but its send to only one user and only one terminal i cant use wall command because all the people in group should not receive the message (3 Replies)
Discussion started by: pbsrinivas
3 Replies

5. Shell Programming and Scripting

Help: return values from awk

Hi. I have a script like this: nawk 'BEGIN {FS=","; TOT1=0; REJ1=0;} { if($7=="TOTAL") { TOT1=TOT1 +$8} if($7=="REJS") { REJ1=REJ1 +$8} }' FILE_123.dat and... (1 Reply)
Discussion started by: mrodrig
1 Replies

6. Shell Programming and Scripting

unable to return a decimal value from a function

Hi Guys, I am unable to return a decimal value from a function to the main script. I am getting the correct value in the function but when it is returning to the main script using "return" it is coming as 0. Below is my code. read VALUE_V fun_FATHERID fun_SONID fun_TOPID fun_RTYPE <... (2 Replies)
Discussion started by: mac4rfree
2 Replies

7. Shell Programming and Scripting

Can $? return multiple values?

Hi, I have a script which does something like the below: execute_some_script.sh $arg1 $arg2 `exec-some-cmd` if then; do something else do something else fi However, during some cases, there is an error saying: line xxx: [: too many arguments at the line number which has... (5 Replies)
Discussion started by: laloo
5 Replies

8. Shell Programming and Scripting

Need Multiple Return Values

Hi, I need to retrun multiple values function errorFileCreation { echo "Before" return -1 "Siva"; echo "Aftyer" } echo ${?} - This can be used to getting first value. how can i get second one. Advance Thanks... Shiv (3 Replies)
Discussion started by: rsivasan
3 Replies

9. Shell Programming and Scripting

Return multiple values using for loop in perl

I am using a for loop to copy files from say DIR1 and DIR2 to DIR3.I have to check whether files are copied from DIR1 and DIR2 and print the respective message. @path=("$DIR1","$DIR2"); foreach (@path) { $rc=system("cp $_/*xml $DIR3"); if ($rc == 0) { print "Files were copied... (1 Reply)
Discussion started by: liyakathali
1 Replies

10. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies
MooseX::Param(3pm)					User Contributed Perl Documentation					MooseX::Param(3pm)

NAME
MooseX::Param - Simple role to provide a standard param method SYNOPSIS
package My::Template::System; use Moose; with 'MooseX::Param'; # ... my $template = My::Template::System->new( params => { foo => 10, bar => 20, baz => 30, } ); # fetching params $template->param('foo'); # 10 # getting list of params $template->param(); # foo, bar, baz # setting params $template->param(foo => 30, bar => 100); DESCRIPTION
This is a very simple Moose role which provides a CGI like "param" method. I found that I had written this code over and over and over and over again, and each time it was the same. So I thought, why not put it in a role? ATTRIBUTES
params This role provides a "params" attribute which has a read-only accessor, and a HashRef type constraint. It also adds a builder method (see "init_params" method below) to properly initialize it. METHODS
params Return the HASH ref in which the parameters are stored. param This is your standard CGI style "param" method. If passed no arguments, it will return a list of param names. If passed a single name argument it will return the param associated with that name. If passed a key value pair (or set of key value pairs) it will assign them into the params. init_params This is the params attribute "builder" option, so it is called the params are initialized. NOTE: You can override this by defining your own version in your class, because local class methods beat role methods in composition. meta Returns the role metaclass. SIMILAR MODULES
The "param" method can be found in several other modules, such as CGI, CGI::Application and HTML::Template to name a few. This is such a common Perl idiom that I felt it really deserved it's own role (if for nothing more than I was sick of re-writing and copy-pasting it all the time). There are also a few modules which attempt to solve the same problem as this module. Those are: Class::Param This module is much more ambitious than mine, and provides much deeper functionality. For most of my purposes, this module would have been overkill, but if you need really sophisticated param handling and the ability to provide several different APIs (tied, etc), this module is probably the way to go. Mixin::ExtraFields::Param This module is very similar to mine, but for a different framework. It works with the Mixin::ExtraFields framework. BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. AUTHOR
Stevan Little <stevan@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2007 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-29 MooseX::Param(3pm)
All times are GMT -4. The time now is 02:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy