The UNIX and Linux Forums  

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


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl equivalent to grep -c popeye Shell Programming and Scripting 6 04-18-2008 10:57 PM
Strtok function.... Tanvirk Linux 3 01-24-2008 07:16 AM
export equivalent command in PERL ammu Shell Programming and Scripting 1 09-17-2007 12:46 PM
better way than strtok? annie High Level Programming 7 10-05-2005 11:01 AM
Perl equivalent of ksh if / echo statement gefa Shell Programming and Scripting 2 02-17-2005 09:07 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-06-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 138
Arrow strtok equivalent in perl

Hi All,

Is their any equivalent for strtok (in c) to use in perl script.

Thanks in advance.
JS
Reply With Quote
Forum Sponsor
  #2  
Old 05-06-2008
Registered User
 

Join Date: Jan 2008
Posts: 327
I believe the split() function is the same. split() splits a string into a list of tokens:

$foo = 'this is a test';
@tokens = split(/ /,$foo);
print "$_\n" fo @tokens;

output:

this
is
a
test

split - perldoc.perl.org
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0