Sponsored Content
Top Forums Shell Programming and Scripting perl: storing regex in array variables trouble Post 302230369 by era on Friday 29th of August 2008 07:17:14 AM
Old 08-29-2008
With a string in double quotes, the $1 gets interpolated at the time you define the string. Try single quotes and eval print $res;
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

storing variables in array.Please help

Hi All, I need some help with arrays. I need to take input from the user for hostname, username and password until he enters .(dot) or any other character and store the values in the variable array. I would further connect to the hostname using username and passwd and copy files from server to... (7 Replies)
Discussion started by: nua7
7 Replies

2. Shell Programming and Scripting

Perl Array Variables to be returned to main

Hi All, I can;t seem to print out the array in sequence using the below subroutine. My first element in the array @lotsuffix is suppose to be $lotsuffix as defined in the subroutine, but when the array variable is being pass on the main program, my first element actually becomes $lotsuffix ! ... (4 Replies)
Discussion started by: Raynon
4 Replies

3. Shell Programming and Scripting

date capturing regex and storing

Hi all I need help on how to store two or more date formates captured using regex from an input sentence in PERL ? For example, I have an input sentence consisting of two dates such as : The departure date is August 12, 2009 and arrival date is 20.08.2009. Now, I want to capture the two... (4 Replies)
Discussion started by: my_Perl
4 Replies

4. UNIX for Dummies Questions & Answers

Trouble with grouping regex

Hi Forum im trying to use grouping in a regex statement in a function in a script this is the criteria im trying to match :It MUST have 3 character at the beginning. After that it can have a mix of spaces,alpha-numeric and dashes in any order eg HUG this-stuff, FGU taylor-8-shoes, ZDFnintendo... (2 Replies)
Discussion started by: ShinTec
2 Replies

5. Shell Programming and Scripting

Perl regex and sort trouble

Hi so I have these files where the first thing in them says something along the lines of "This document was accessed 'date' blah blah", I was thinking of a way to extract that date and then sort the files based on that date. My question is how do I get rid of the words in that statement so that... (6 Replies)
Discussion started by: vas28r13
6 Replies

6. Shell Programming and Scripting

Storing data in perl 2D array

Respected All, Kindly help me out. I have got file listings in a directory like this: -rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log -rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log -rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log -rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies

7. Shell Programming and Scripting

perl : searching for month and storing the date and time in an array

I am writing the code in perl. I have an array in perl and each variable in the array contains the data in the below format Now I need to check the below variable w.r.t system month I need to store the date and time(Tue Aug 7 03:54:12 2012) from the below data into file if contains only 'Aug'... (5 Replies)
Discussion started by: giridhar276
5 Replies

8. Shell Programming and Scripting

Storing the SQL results in array variables

Requirement 1) I need to execute 15 SQL queries in oracle through linux script. All these query results needs to be stored in array variables. Requirement 2) And these 15 queries needs to be executed in parallel. Requirement 3) Once all the queries executed then the shell script should... (3 Replies)
Discussion started by: Niranjancse
3 Replies

9. Shell Programming and Scripting

Bash 3.2 - Array / Regex - IF 3rd member in array ends in 5 digits then do somthing...

Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help. pesudo code if == ENDSINFIVEINTS ]]; then do... (4 Replies)
Discussion started by: briandanielz
4 Replies

10. Shell Programming and Scripting

Storing the Linux command output to an array in perl script

Hi I am trying to store the output of a command into an array in perl script. I am able to store but the problem is i am unable to print the array line with one line space. i mean i inserted the \n in loop ...but not getting the result. I have written like this #!/usr/bin/perl @a =... (2 Replies)
Discussion started by: kumar85shiv
2 Replies
INTERP(3)						User Contributed Perl Documentation						 INTERP(3)

NAME
PDL::GSL::INTERP - PDL interface to Interpolation routines in GSL DESCRIPTION
This is an interface to the interpolation package present in the GNU Scientific Library. SYNOPSIS
use PDL; use PDL::GSL::INTERP; my $x = sequence(10); my $y = exp($x); my $spl = PDL::GSL::INTERP->init('cspline',$x,$y); my $res = $spl->eval(4.35); $res = $spl->deriv(4.35); $res = $spl->deriv2(4.35); $res = $spl->integ(2.1,7.4); FUNCTIONS
init() The init method initializes a new instance of INTERP. It needs as input an interpolation type and two piddles holding the x and y values to be interpolated. The GSL routines require that x be monotonically increasing and a quicksort is performed by default to ensure that. You can skip the quicksort by passing the option {Sort => 0}. The available interpolation types are : o linear o polynomial o cspline (natural cubic spline) o cspline_periodic (periodic cubic spline) o akima (natural akima spline) o akima_periodic (periodic akima spline) Please check the GSL documentation for more information. Usage: $blessed_ref = PDL::GSL::INTERP->init($interp_method,$x,$y,$opt); Example: $x = sequence(10); $y = exp($x); $spl = PDL::GSL::INTERP->init('cspline',$x,$y) $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 1}) #same as above # no sorting done on x, user is certain that x is monotonically increasing $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); eval() The function eval returns the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->eval($points,$opt); Example: my $res = $spl->eval($x) $res = $spl->eval($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->eval($x,{Extrapolate => 1}) deriv() The deriv function returns the derivative of the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->deriv($points,$opt); Example: my $res = $spl->deriv($x) $res = $spl->deriv($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->deriv($x,{Extrapolate => 1}) deriv2() The deriv2 function returns the second derivative of the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->deriv2($points,$opt); Example: my $res = $spl->deriv2($x) $res = $spl->deriv2($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->deriv2($x,{Extrapolate => 1}) integ() The integ function returns the integral of the interpolating function between two points. By default it will barf if you try to extrapolate, to comply silently if one of the integration limits is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->integ($a,$b,$opt); Example: my $res = $spl->integ($a,$b) $res = $spl->integ($a,$b,{Extrapolate => 0}) #same as above # silently comply if $a or $b are out of range $res = $spl->eval($a,$b,{Extrapolate => 1}) BUGS
Feedback is welcome. SEE ALSO
PDL The GSL documentation is online at http://sources.redhat.com/gsl/ref/gsl-ref_toc.html AUTHOR
This file copyright (C) 2003 Andres Jordan <andresj@physics.rutgers.edu> All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL interpolation module was written by Gerard Jungman. perl v5.12.1 2010-07-05 INTERP(3)
All times are GMT -4. The time now is 09:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy