LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-06-2010, 01:40 AM   #1
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Rep: Reputation: 32
Custom delimiter for hash in perl?


Can I have a custom delimiter for hash in perl?
 
Old 01-06-2010, 07:45 AM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Do you mean the '%' sigil? If so, I don't believe that this is possible. If you mean something else, you'll have to explain a little better.
 
Old 01-06-2010, 11:19 PM   #3
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by bartonski View Post
Do you mean the '%' sigil? If so, I don't believe that this is possible. If you mean something else, you'll have to explain a little better.
I think that "%" is not the delimiter for a hash.
I mean the "=>" symbol. Actually when we are defining a hash we use this symbol. I want to customize that symbol. My question is can we change that delimiter?
 
Old 02-01-2010, 11:33 PM   #4
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
I want some more posts on this thread......
 
Old 02-02-2010, 01:50 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
That '=>' is known as a 'fat comma' and you can't change it AFAIK, unless you want to explicitly use quotes (') around the hash keys.
See
http://en.wikipedia.org/wiki/Fat_comma
http://www.perlfoundation.org/perl5/index.cgi?fat_comma
http://www.perlmonks.org/?node_id=471590

Perl best practice is to
Code:
use strict;
use warnings;  #  or the -w switch
and use the '=>' when declaring hash contents.
 
  


Reply

Tags
hash, perl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How use CUT -d 'delimiter' is delimiter is a TAB? frenchn00b Programming 12 11-06-2013 03:17 AM
[SOLVED] Perl Array delimiter ashok.g Programming 8 12-23-2009 05:50 AM
Using hash value as key for other hash in Perl scuzzman Programming 6 02-14-2006 05:08 PM
Perl and Hash automatic PB0711 Programming 3 09-23-2005 02:14 AM
Issues calling sort from perl using pipe as delimiter amytys Programming 1 10-20-2004 09:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration