Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


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

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-01-2013
Registered User
 
Join Date: Jul 2012
Posts: 39
Thanks: 4
Thanked 0 Times in 0 Posts
% 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
#! /bin/bash
 
Join Date: Apr 2009
Location: India
Posts: 1,559
Thanks: 14
Thanked 437 Times in 422 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
Registered User
 
Join Date: Jul 2012
Location: Chennai
Posts: 453
Thanks: 34
Thanked 57 Times in 55 Posts
These are called hashes..

Refer here
Sponsored Links
Reply

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 11:41 PM.