subroutine Questions

2

Solved

I know the subroutine in perl pass arg by reference. But in the below code, the foreach loop in the subroutine should not be changing the value for @list because the my $i should be creating a new ...
Calandracalandria asked 7/6, 2014 at 12:23

5

Solved

Ok so i was wondering how i would go about calling a perl subroutine from the command line. So if my program is Called test, and the subroutine is called fields i would like to call it from the com...
Mccollough asked 13/4, 2014 at 4:12

2

Solved

I need to be able to write and call my own subroutines in a Mojolicious::Lite Application. However, the intuitive way to do this doesn't seem to be working. I emailed a colleague who has more Mojol...
Unhallow asked 8/4, 2014 at 17:37

1

I have a long piece of inherited FORTRAN77 code that I call from R using .Fortran(). The Fortran code contains a set of subroutines, and works when embedded in a Fortran program and subsequently co...
Stubbed asked 16/1, 2013 at 11:28

1

Solved

I am trying to generalize a function call from a subroutine. So my idea is something like this if (case1) then call MainSubroutine1(myFun) elseif (case2) call MainSubroutine2(myFun) end if do i...
Bittner asked 31/1, 2014 at 2:54

2

Solved

The Situation I am in the process of creating a simple template file that will aid in creating future scripts for doing various tasks via command line on *nix systems. As part of this, I might lik...
Scotticism asked 17/12, 2013 at 23:45

4

Solved

I'm writing Perl for quite some time now and always discovering new things, and I just ran into something interesting that I don't have the explanation to it, nor found it over the web. sub a { s...
Monologue asked 17/4, 2012 at 13:29

3

I would like to call a sub from another sub inside in the same module. The first sub would be my main code and there I would call the second subroutine. Second subroutine receives multiple inputs a...
Greenheart asked 26/5, 2013 at 19:49

2

Solved

I'm working with hashes in perl, but don't understand why the hash value changes in the following: use strict; sub test { my ($value_ref) = @_; my %value = %$value_ref; $value{'abc'}{'xyz'} = ...
Huffy asked 8/11, 2013 at 18:42

1

Solved

I'm a bit confused about the use of an interface block inside a module and the use of the CONTAINS statement to create an "explicit interface" for a procedure inside a module. I usually write a pr...
Sourdough asked 5/11, 2013 at 3:1

1

Solved

I need in a program to pass some allocatable arrays to subroutines, and i need to know if the way I do it are in the standard or not. If you know where I can search for the standard of fortran, Te...
Ravens asked 23/10, 2013 at 9:30

2

Solved

My understanding is that in order to get the date from a file passed into a subroutine as an argument, you must re-set that argument as a variable within the subroutine. Is this correct? This doesn...
Disclimax asked 25/9, 2013 at 13:18

2

I am new to Fortran. I am working on a research project where I am using an open source project that has several files distributed in multiple folders. i found the dependency of each programs but c...
Pronominal asked 27/8, 2013 at 11:18

5

Solved

Need help figuring out how to do this. My code: my %hash; $hash{'1'}= {'Make' => 'Toyota','Color' => 'Red',}; $hash{'2'}= {'Make' => 'Ford','Color' => 'Blue',}; $hash{'3'}= {'Make' =&g...
Geanine asked 3/2, 2011 at 23:51

1

Solved

I am having a problem with the PRESENT statement with Fortran 95. Currently I am using Silverfrost's Plato and their FTN95 compiler (in "Release Win32" mode). What I wanted to do is to create a sub...
Frazzle asked 18/8, 2013 at 17:57

3

Solved

I just looked in disbelief at this sequence: my $line; $rc = getline($line); # read next line and store in $line I had understood all along that Perl arguments were passed by value, so whenever ...
Ground asked 28/5, 2013 at 3:56

1

Solved

Running perl 5.12.4 Am getting disparity between result of a function when a hash is assigned within the return statement or beforehand. Easiest example is: perl -e 'sub s1 { my @a=qw/b 1 c 2 a 3...
Goltz asked 7/5, 2013 at 4:15

4

Solved

As per perldoc perlsub: The & is optional in modern Perl, as are parentheses if the subroutine has been predeclared. I notice that a lot of times, people use the fact that you can o...
Salbu asked 2/4, 2013 at 19:44

2

Solved

I have to work with KSH (yeah that hell shell). I need to use a fork, a subroutine as following: #!/bin/ksh PIPE=PIPE_$$ PIPE_ERR=PIPE_ERR_$$ export TEST_FILS $(. ./LanceFils.ksh 2>${PI...
Olivia asked 13/3, 2013 at 10:44

1

Solved

I'm creating a request queue in a custom thread TMyThread and I'm having difficulties defining a procedure type which can be used for a subroutine. I have a record which represents the reques...
Nordstrom asked 3/3, 2013 at 2:17

5

Solved

I am trying to figure the best way to differeniate in Perl between cases where an argument has not been passed, and where an argument has been passed as 0, since they mean different things to me. ...
Monstrance asked 28/11, 2011 at 17:18

7

Solved

I am learning perl and understand that it is a common and accepted practice to unpack subroutine arguments using shift. I also understand that it is common and acceptable practice to omit function ...
Oldworld asked 31/12, 2012 at 10:50

2

Solved

I am using a Function to make an array. The input is also an array. When running it gives me an invalid ReDim compile error. Before this was run in a sub routine and the ReDim worked well but now I...
Ezara asked 24/12, 2012 at 23:3

4

Solved

I am facing compilation error while declaring array type argument in perl subroutine defination. My complete code is below: use Data::Dumper; use Win32; use Win32::Service; use strict; use warnin...
Shackelford asked 20/12, 2012 at 9:40

1

Solved

The following code, combining module procedures and external procedures: module module_dummy implicit none contains subroutine foo(a) real, intent(inout) :: a(:) call bar(a) end subrout...
Stubbed asked 8/11, 2012 at 17:2

© 2022 - 2024 — McMap. All rights reserved.