Sponsored Content
Top Forums Shell Programming and Scripting Separate a hash variable into 2 parts in Perl Post 302951850 by derekludwig on Tuesday 11th of August 2015 07:05:37 AM
Old 08-11-2015
Can you post what you have tried? And a less-simplistic data sample?

The leaf node (under scripting) is a list containing one element (language). What is the desired output if/when this list contains more than one element?

How was "Perl1 Perl2 Perl3" -> "Perl4 Perl 5 Perl6" derived? Where is the dependency?

Did you want the PerlNs combined into a single node?

- D

And
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Pattern Matching a HASH variable

Hi All, I'm trying to test a Hash variable but it's not working. Here is my code - can anyone tell me if the test is valid? for (keys %enabled_yn) { if ($enabled_yn{$1} =~ m/\s+Y/) { $html =~ s/%(\w+)%/\<b\>\<font color\=orange\>$enabled_yn{$1}\<\/font\>\<\/b\>/g; }... (1 Reply)
Discussion started by: pondlife
1 Replies

2. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

3. UNIX for Advanced & Expert Users

Passing Hash variable in to sql query in perl

Hi Everyone, Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below i have defined two Hash %lc and %tab as below $lc{'REFF'}='V_RES_CLASS'; $lc{'CALE'}='V_CAP_CLASS'; $lc{'XRPD'}='V_XFMR_CLASS'; $tab{'V_RES_CLASS'}='V_MFR_SERS';... (6 Replies)
Discussion started by: jam_prasanna
6 Replies

4. Shell Programming and Scripting

perl hash - using a range as a hash key.

Hi, In Perl, is it possible to use a range of numbers with '..' as a key in a hash? Something in like: %hash = ( '768..1536' => '1G', '1537..2560' => '2G' ); That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies

5. Shell Programming and Scripting

Perl: accessing reference to variable inside hash.

Below is hash which contains reference to variables: my %mandatoryFields = ( 1 => \$msgtype, 2 => \$switchtype, 3 => \$card_nbr, 4 => \$natv_tran_type_code, 5 => \$amt_1 ); This... (0 Replies)
Discussion started by: som.nitk
0 Replies

6. Shell Programming and Scripting

Using bash to separate files files based on parts of a filename

Hey guys, Sorry for the basic question but I have a lot of files that I want to separate into groups based on filenames which I can then cat together. Eg I have: (a_b_c.txt) WB34_2_SLA8.txt WB34_1_SLA8.txt WB34_1_DB10.txt WB34_2_DB10.txt WB34_1_SLA8.txt WB34_2_SLA8.txt 77_1_SLA8.txt... (1 Reply)
Discussion started by: Breentax
1 Replies

7. Shell Programming and Scripting

In Perl can i define a hash with value as variable?

Hi, Is it possible in perl to have a hash defined with variables as theirs key values, like: %account = ('username' => 'boy', 'password' => $password); Thanks (1 Reply)
Discussion started by: zing_foru
1 Replies

8. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

9. Shell Programming and Scripting

How to parse parts of 1 column into two separate columns?

I have a shell script that is currently transferring a csv file from a server into a Teradata database table. One of the 30 or so columns is called "destination_url". In that URL there are parameters, and it is possible for those parameters to be repeated because of referring companies copying... (3 Replies)
Discussion started by: craigwg
3 Replies

10. Shell Programming and Scripting

Improve awk code that has three separate parts

I have a very inefficient awk below that I need some help improving. Basically, there are three parts, that ideally, could be combined into one search and one output file. Thank you :). Part 1: Check if the user inputted string contains + or - in it and if it does the input is writting to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
Pod::Abstract::Tree(3pm)				User Contributed Perl Documentation				  Pod::Abstract::Tree(3pm)

NAME
Pod::Abstract::Tree - Manage a level of Pod document tree Nodes. DESCRIPTION
Pod::Abstract::Tree keeps track of a set of Pod::Abstract::Node elements, and allows manipulation of that list of elements. Elements are stored in an ordered set - a single node can appear once only in a single document tree, so inserting a node at a point will also remove it from it's previous location. This is an internal class to Pod::Abstract::Node, and should not generally be used externally. METHODS
detach $tree->detach($node); Unparent the $node from $tree. All other elements will be shifted to fill the empty spot. push Add an element to the end of the node list. pop Remove an element from the end of the node list. insert_before $tree->insert_before($target,$node); Insert $node before $target. Both must be children of $tree insert_after $tree->insert_after($target,$node); Insert $node after $target. Both must be children of $tree unshift Remove the first node from the node list and return it. Unshift takes linear time - it has to relocate every other element in id_map so that they stay in line. children Returns the in-order node list. index_relative my $node = $tree->index_relative($target, $offset); This method will return a node at an offset of $offset (which may be negative) from this tree structure. If there is no such node, undef will be returned. For example, an offset of 1 will give the following element of $node. AUTHOR
Ben Lilburne <bnej@mac.com> COPYRIGHT AND LICENSE
Copyright (C) 2009 Ben Lilburne This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-01-03 Pod::Abstract::Tree(3pm)
All times are GMT -4. The time now is 02:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy