% in perl | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

% in perl

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-01-2013
ptappeta ptappeta is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 3 June 2014, 4:39 AM EDT
Posts: 50
Thanks: 6
Thanked 1 Time in 1 Post
% in perl

whats this means in perl?




Code:
 
%BDayHeadRow = ( 'BUSDAT', '1', 'ARRDAT', '1', 'SHAWBUSDAT', '2', );
%BDaySize = ( 'BUSDAT', '8', 'ARRDAT', '8', 'SHAWBUSDAT', '6', );
%BDayStartPos = ( 'BUSDAT', '25', 'ARRDAT', '34', 'SHAWBUSDAT', '8', );
%BDayTrail =
  ( 'BUSDAT', 'IMATRL', 'ARRDAT', 'IMATRL', 'SHAWBUSDAT', 'END OF TRS', );

Sponsored Links
    #2  
Old 03-01-2013
balajesuri's Avatar
balajesuri balajesuri is offline Forum Advisor  
#! /bin/bash
 
Join Date: Apr 2009
Last Activity: 22 August 2014, 7:46 AM EDT
Location: India
Posts: 1,822
Thanks: 24
Thanked 523 Times in 502 Posts
% is an identifier for a hash variable (perl-ish name for associative arrays).
The data is stored as key-value pairs.
Another form of defining a hash that is pleasing to the eye is:

Code:
%BDayHeadRow = ( 'BUSDAT'     => '1',
                 'ARRDAT'     => '1',
                 'SHAWBUSDAT' => '2' );

'BUSDAT' is the key and the corresponding value is 1 and so on...
The Following User Says Thank You to balajesuri For This Useful Post:
ptappeta (03-01-2013)
Sponsored Links
    #3  
Old 03-01-2013
PikK45 PikK45 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 10 July 2014, 12:57 PM EDT
Location: Chennai
Posts: 567
Thanks: 43
Thanked 74 Times in 72 Posts
These are called hashes..

Refer here
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl and HP-UX : instmodsh in combination with software depot : update inventory for installed Perl bora99 UNIX for Advanced & Expert Users 0 04-16-2012 11:25 AM
HELP on Perl array / sorting - trying to convert Korn Shell Script to Perl newbie_01 Shell Programming and Scripting 3 11-06-2011 01:26 AM
Hidden Characters in Regular Expression Matching Perl - Perl Newbie kittyluva2 Shell Programming and Scripting 4 07-28-2011 01:31 AM
Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time. butterfly20 Shell Programming and Scripting 2 01-13-2011 07:35 AM
Passing date formats in Perl: i.e. Jul/10/2007 -> 20070710 (yyyymmdd) - Perl akil Shell Programming and Scripting 7 07-17-2009 09:09 AM



All times are GMT -4. The time now is 08:14 AM.